Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32211565
D8831.1765136932.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D8831.1765136932.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 7, 7:48 PM (6 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5843509
Default Alt Text
D8831.1765136932.diff (1 KB)
Attached To
Mode
D8831: [web] update calculateMaxTextWidth to consider different font sizes
Attached
Detach File
Event Timeline
Log In to Comment