Page MenuHomePhabricator

D8831.id29939.diff
No OneTemporary

D8831.id29939.diff

diff --git a/web/utils/text-utils.js b/web/utils/text-utils.js
--- a/web/utils/text-utils.js
+++ b/web/utils/text-utils.js
@@ -6,8 +6,12 @@
function calculateMaxTextWidth(
texts: $ReadOnlyArray<string>,
- font: string,
+ fontSize: number,
): number {
+ const font =
+ `${fontSize}px "Inter", -apple-system, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", ` +
+ '"Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", ui-sans-serif';
+
if (!canvas) {
canvas = document.createElement('canvas');
}
diff --git a/web/utils/tooltip-utils.js b/web/utils/tooltip-utils.js
--- a/web/utils/tooltip-utils.js
+++ b/web/utils/tooltip-utils.js
@@ -46,10 +46,6 @@
+actionButtonContent: React.Node,
};
-const font =
- '14px "Inter", -apple-system, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", ' +
- '"Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", ui-sans-serif';
-
type FindTooltipPositionArgs = {
+sourcePositionInfo: PositionInfo,
+tooltipSize: TooltipSize,
@@ -335,7 +331,7 @@
+height: number,
} {
const textWidth =
- calculateMaxTextWidth([...tooltipLabels, timestamp], font) +
+ calculateMaxTextWidth([...tooltipLabels, timestamp], 14) +
2 * tooltipLabelStyle.padding;
const buttonsWidth =
tooltipLabels.length *

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 26, 3:29 PM (20 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2585354
Default Alt Text
D8831.id29939.diff (1 KB)

Event Timeline