mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 17:55:37 +02:00
Get rid of CSS transform on each annotation in the annotation layer
- each annotation has its coordinates/dimensions expressed in percentage, hence it's correctly positioned whatever the scale factor is; - the font sizes are expressed in percentage too and the main font size is scaled thanks a css var (--scale-factor); - the rotation is now applied on the div annotationLayer; - this patch improve the rendering of some strings where the glyph spacing was not correct (it's a Firefox bug); - it helps to simplify the code and it should slightly improve the update of page (on zoom or rotation).
This commit is contained in:
parent
6dc8d1f532
commit
e2db9bacef
17 changed files with 154 additions and 155 deletions
|
@ -3021,9 +3021,6 @@ class CanvasGraphics {
|
|||
canvasHeight
|
||||
);
|
||||
const { canvas, context } = this.annotationCanvas;
|
||||
const viewportScaleFactorStr = `var(--zoom-factor) * ${PixelsPerInch.PDF_TO_CSS_UNITS}`;
|
||||
canvas.style.width = `calc(${width}px * ${viewportScaleFactorStr})`;
|
||||
canvas.style.height = `calc(${height}px * ${viewportScaleFactorStr})`;
|
||||
this.annotationCanvasMap.set(id, canvas);
|
||||
this.annotationCanvas.savedCtx = this.ctx;
|
||||
this.ctx = context;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue