Merge 396cff56528e45a30a300d6baa5e8ee23e2886b7 into ec71e4ed651e659b06a4fa46ef0b18ff9ab2a8c7

This commit is contained in:
Antoine Legrain 2025-11-24 21:22:01 +05:30 committed by GitHub
commit 6f49b7b1a8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 1 deletions

View File

@ -824,7 +824,6 @@ class DrawingEditor extends AnnotationEditor {
this._currentParent = null; this._currentParent = null;
DrawingEditor.#currentDraw = null; DrawingEditor.#currentDraw = null;
DrawingEditor.#currentDrawingOptions = null; DrawingEditor.#currentDrawingOptions = null;
CurrentPointers.clearPointerType();
CurrentPointers.clearTimeStamp(); CurrentPointers.clearTimeStamp();
} }

View File

@ -1923,6 +1923,8 @@ class AnnotationEditorUIManager {
* Change the editor mode (None, FreeText, Ink, ...) * Change the editor mode (None, FreeText, Ink, ...)
* @param {number} mode * @param {number} mode
* @param {string|null} editId * @param {string|null} editId
* @param {boolean} [isFromUser] - true if the mode change is due to a
* user action.
* @param {boolean} [isFromKeyboard] - true if the mode change is due to a * @param {boolean} [isFromKeyboard] - true if the mode change is due to a
* keyboard action. * keyboard action.
* @param {boolean} [mustEnterInEditMode] - true if the editor must enter in * @param {boolean} [mustEnterInEditMode] - true if the editor must enter in
@ -1933,6 +1935,7 @@ class AnnotationEditorUIManager {
async updateMode( async updateMode(
mode, mode,
editId = null, editId = null,
isFromUser = false,
isFromKeyboard = false, isFromKeyboard = false,
mustEnterInEditMode = false, mustEnterInEditMode = false,
editComment = false editComment = false
@ -1980,6 +1983,11 @@ class AnnotationEditorUIManager {
await this.#signatureManager?.loadSignatures(); await this.#signatureManager?.loadSignatures();
} }
if (isFromUser) {
// reinitialize the pointer type when the mode is changed by the user
CurrentPointers.clearPointerType();
}
this.setEditingState(true); this.setEditingState(true);
await this.#enableAll(); await this.#enableAll();
this.unselectAll(); this.unselectAll();

View File

@ -2501,6 +2501,7 @@ class PDFViewer {
await this.#annotationEditorUIManager.updateMode( await this.#annotationEditorUIManager.updateMode(
mode, mode,
editId, editId,
/* isFromUser = */ true,
isFromKeyboard, isFromKeyboard,
mustEnterInEditMode, mustEnterInEditMode,
editComment editComment