From edc9ad13bf8f422f9495c4ede9bb9989969326e4 Mon Sep 17 00:00:00 2001 From: Calixte Denizet Date: Thu, 7 Jul 2022 16:40:33 +0200 Subject: [PATCH] [Editor] Change the cursor to a pen for the Ink editor --- src/display/editor/ink.js | 2 -- web/annotation_editor_layer_builder.css | 3 +++ web/images/toolbarButton-editorInk.svg | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/display/editor/ink.js b/src/display/editor/ink.js index 4767e5d7e3b9e..e2a8a4d4acf3b 100644 --- a/src/display/editor/ink.js +++ b/src/display/editor/ink.js @@ -233,7 +233,6 @@ class InkEditor extends AnnotationEditor { } super.enableEditMode(); - this.canvas.style.cursor = "pointer"; this.div.draggable = false; this.canvas.addEventListener("mousedown", this.#boundCanvasMousedown); this.canvas.addEventListener("mouseup", this.#boundCanvasMouseup); @@ -246,7 +245,6 @@ class InkEditor extends AnnotationEditor { } super.disableEditMode(); - this.canvas.style.cursor = "auto"; this.div.draggable = !this.isEmpty(); this.div.classList.remove("editing"); diff --git a/web/annotation_editor_layer_builder.css b/web/annotation_editor_layer_builder.css index a3e556a645905..2a52a914409e9 100644 --- a/web/annotation_editor_layer_builder.css +++ b/web/annotation_editor_layer_builder.css @@ -18,6 +18,7 @@ --hover-outline: dashed 2px blue; --freetext-line-height: 1.35; --freetext-padding: 2px; + --editorInk-editing-cursor: url(images/toolbarButton-editorInk.svg) 0 16; } @media (forced-colors: active) { @@ -119,6 +120,7 @@ height: 100%; z-index: 1; transform-origin: 0 0; + cursor: auto; } .annotationEditorLayer .background { @@ -132,6 +134,7 @@ .annotationEditorLayer .inkEditor.editing { resize: none; + cursor: var(--editorInk-editing-cursor), pointer; } .annotationEditorLayer .inkEditor .inkEditorCanvas { diff --git a/web/images/toolbarButton-editorInk.svg b/web/images/toolbarButton-editorInk.svg index fb9e13d5b3a40..2b37e85f30363 100644 --- a/web/images/toolbarButton-editorInk.svg +++ b/web/images/toolbarButton-editorInk.svg @@ -1,6 +1,6 @@ - +