Skip to content

Commit 8d154d7

Browse files
Merge pull request #15064 from calixteman/rescale_followup
Avoid having overflowing sections (#15036 follow-up)
2 parents ef6142a + af47a0b commit 8d154d7

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/display/annotation_layer.js

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

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

web/annotation_layer_builder.css

+1-2
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
}
@@ -90,7 +89,7 @@
9089
background-image: var(--annotation-unfocused-field-background);
9190
border: 1px solid transparent;
9291
box-sizing: border-box;
93-
font: 9% sans-serif;
92+
font: calc(9px * var(--scale-factor)) sans-serif;
9493
height: 100%;
9594
margin: 0;
9695
vertical-align: top;

0 commit comments

Comments
 (0)