mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
[Editor] Correctly set the accessibility data when copying & pasting a stamp with an alt text (bug 1903589)
This commit is contained in:
parent
9afd3a5b2f
commit
67f9756fce
3 changed files with 74 additions and 0 deletions
|
@ -40,6 +40,8 @@ import { noContextMenu } from "../display_utils.js";
|
|||
* Base class for editors.
|
||||
*/
|
||||
class AnnotationEditor {
|
||||
#accessibilityData = null;
|
||||
|
||||
#allResizerDivs = null;
|
||||
|
||||
#altText = null;
|
||||
|
@ -993,6 +995,10 @@ class AnnotationEditor {
|
|||
}
|
||||
AltText.initialize(AnnotationEditor._l10nPromise);
|
||||
this.#altText = new AltText(this);
|
||||
if (this.#accessibilityData) {
|
||||
this.#altText.data = this.#accessibilityData;
|
||||
this.#accessibilityData = null;
|
||||
}
|
||||
await this.addEditToolbar();
|
||||
}
|
||||
|
||||
|
@ -1330,6 +1336,7 @@ class AnnotationEditor {
|
|||
uiManager,
|
||||
});
|
||||
editor.rotation = data.rotation;
|
||||
editor.#accessibilityData = data.accessibilityData;
|
||||
|
||||
const [pageWidth, pageHeight] = editor.pageDimensions;
|
||||
const [x, y, width, height] = editor.getRectInCurrentCoords(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue