mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
[Annotation] Take into account the stroke alpha for a FreeText without appearance
This commit is contained in:
parent
ecd86ccffc
commit
a25895bf72
5 changed files with 30 additions and 4 deletions
|
@ -3511,8 +3511,8 @@ class FreeTextAnnotation extends MarkupAnnotation {
|
|||
const { xref } = params;
|
||||
this.data.annotationType = AnnotationType.FREETEXT;
|
||||
this.setDefaultAppearance(params);
|
||||
|
||||
if (!this.appearance && this._isOffscreenCanvasSupported) {
|
||||
const strokeAlpha = params.dict.get("CA");
|
||||
const fakeUnicodeFont = new FakeUnicodeFont(xref, "sans-serif");
|
||||
const fontData = this.data.defaultAppearanceData;
|
||||
this.appearance = fakeUnicodeFont.createAppearance(
|
||||
|
@ -3520,7 +3520,8 @@ class FreeTextAnnotation extends MarkupAnnotation {
|
|||
this.rectangle,
|
||||
this.rotation,
|
||||
fontData.fontSize || 10,
|
||||
fontData.fontColor
|
||||
fontData.fontColor,
|
||||
strokeAlpha
|
||||
);
|
||||
this._streams.push(this.appearance, FakeUnicodeFont.toUnicodeStream);
|
||||
} else if (!this._isOffscreenCanvasSupported) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue