[Editor] Add the possibility to change line opacity in Ink editor

This commit is contained in:
Calixte Denizet 2022-07-24 22:19:09 +02:00
parent 45b9e8417d
commit 7831a100b3
10 changed files with 215 additions and 19 deletions

View file

@ -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;
}
}
});