mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
[Editor] Add the possibility to change line opacity in Ink editor
This commit is contained in:
parent
45b9e8417d
commit
7831a100b3
10 changed files with 215 additions and 19 deletions
|
@ -30,6 +30,7 @@ class AnnotationEditorParams {
|
|||
editorFreeTextColor,
|
||||
editorInkColor,
|
||||
editorInkThickness,
|
||||
editorInkOpacity,
|
||||
}) {
|
||||
editorFreeTextFontSize.addEventListener("input", evt => {
|
||||
this.eventBus.dispatch("switchannotationeditorparams", {
|
||||
|
@ -59,6 +60,13 @@ class AnnotationEditorParams {
|
|||
value: editorInkThickness.valueAsNumber,
|
||||
});
|
||||
});
|
||||
editorInkOpacity.addEventListener("input", evt => {
|
||||
this.eventBus.dispatch("switchannotationeditorparams", {
|
||||
source: this,
|
||||
type: AnnotationEditorParamsType.INK_OPACITY,
|
||||
value: editorInkOpacity.valueAsNumber,
|
||||
});
|
||||
});
|
||||
|
||||
this.eventBus._on("annotationeditorparamschanged", evt => {
|
||||
for (const [type, value] of evt.details) {
|
||||
|
@ -75,6 +83,9 @@ class AnnotationEditorParams {
|
|||
case AnnotationEditorParamsType.INK_THICKNESS:
|
||||
editorInkThickness.value = value;
|
||||
break;
|
||||
case AnnotationEditorParamsType.INK_OPACITY:
|
||||
editorInkOpacity.value = value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue