Skip to content

Commit

Permalink
Avoid having overflowing sections (mozilla#15036 follow-up)
Browse files Browse the repository at this point in the history
  • Loading branch information
calixteman committed Jun 19, 2022
1 parent 45de73b commit af47a0b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/display/annotation_layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ class WidgetAnnotationElement extends AnnotationElement {
const height = Math.abs(this.data.rect[3] - this.data.rect[1]);
computedFontSize = Math.min(fontSize, Math.round(height / LINE_FACTOR));
}
style.fontSize = `${computedFontSize}%`;
style.fontSize = `calc(${computedFontSize}px * var(--scale-factor))`;

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

Expand Down
3 changes: 1 addition & 2 deletions web/annotation_layer_builder.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
position: absolute;
top: 0;
left: 0;
font-size: calc(100px * var(--scale-factor));
pointer-events: none;
transform-origin: 0 0;
}
Expand Down Expand Up @@ -90,7 +89,7 @@
background-image: var(--annotation-unfocused-field-background);
border: 1px solid transparent;
box-sizing: border-box;
font: 9% sans-serif;
font: calc(9px * var(--scale-factor)) sans-serif;
height: 100%;
margin: 0;
vertical-align: top;
Expand Down

0 comments on commit af47a0b

Please sign in to comment.