Skip to content

Commit 4d8304c

Browse files
committed
Avoid having overflowing sections (#15036 follow-up)
1 parent 45de73b commit 4d8304c

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/display/annotation_layer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,7 @@ class WidgetAnnotationElement extends AnnotationElement {
908908
const height = Math.abs(this.data.rect[3] - this.data.rect[1]);
909909
computedFontSize = Math.min(fontSize, Math.round(height / LINE_FACTOR));
910910
}
911-
style.fontSize = `${computedFontSize}%`;
911+
style.fontSize = `calc(${computedFontSize}px * var(--scale-factor)`;
912912

913913
style.color = Util.makeHexColor(fontColor[0], fontColor[1], fontColor[2]);
914914

web/annotation_layer_builder.css

-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
position: absolute;
4242
top: 0;
4343
left: 0;
44-
font-size: calc(100px * var(--scale-factor));
4544
pointer-events: none;
4645
transform-origin: 0 0;
4746
}

0 commit comments

Comments
 (0)