Page MenuHomePhabricator

D8831.id30402.diff
No OneTemporary

D8831.id30402.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
Sat, Nov 30, 4:35 AM (20 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2599380
Default Alt Text
D8831.id30402.diff (1 KB)

Event Timeline