[Editor] Add the possibility to move an empty freetext editor with the keyboard (bug 1845088)

This commit is contained in:
Calixte Denizet 2023-07-26 22:11:55 +02:00
parent 8f83a1359e
commit 93b09f6320
3 changed files with 175 additions and 36 deletions

View file

@ -561,9 +561,9 @@ class AnnotationEditorUIManager {
#container = null;
static #TRANSLATE_SMALL = 1; // page units.
static TRANSLATE_SMALL = 1; // page units.
static #TRANSLATE_BIG = 10; // page units.
static TRANSLATE_BIG = 10; // page units.
static get _keyboardManager() {
const arrowChecker = self => {
@ -576,8 +576,8 @@ class AnnotationEditorUIManager {
self.hasSomethingToControl()
);
};
const small = this.#TRANSLATE_SMALL;
const big = this.#TRANSLATE_BIG;
const small = this.TRANSLATE_SMALL;
const big = this.TRANSLATE_BIG;
return shadow(
this,
"_keyboardManager",
@ -1379,8 +1379,10 @@ class AnnotationEditorUIManager {
});
}
translateSelectedEditors(x, y) {
this.commitOrRemove();
translateSelectedEditors(x, y, noCommit = false) {
if (!noCommit) {
this.commitOrRemove();
}
if (!this.hasSelection) {
return;
}