From cef79905aa2af85d43f666f74871fb7ce54c6298 Mon Sep 17 00:00:00 2001 From: JannisX11 Date: Wed, 12 Jun 2024 21:47:09 +0200 Subject: [PATCH] Fix some face selection issues in #2378 --- js/outliner/outliner.js | 3 +++ js/preview/preview.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/js/outliner/outliner.js b/js/outliner/outliner.js index 1ae946e1..450912d4 100644 --- a/js/outliner/outliner.js +++ b/js/outliner/outliner.js @@ -504,6 +504,9 @@ class OutlinerElement extends OutlinerNode { unselect() { Project.selected_elements.remove(this); this.selected = false; + if (UVEditor.selected_element_faces[this.uuid]) { + delete UVEditor.selected_element_faces[this.uuid]; + } TickUpdates.selection = true; return this; } diff --git a/js/preview/preview.js b/js/preview/preview.js index 0198ff66..f470d43c 100644 --- a/js/preview/preview.js +++ b/js/preview/preview.js @@ -781,7 +781,7 @@ class Preview { if (Toolbox.selected.selectElements && Modes.selected.selectElements && (data.type === 'element' || Toolbox.selected.id == 'knife_tool')) { if (Toolbox.selected.selectFace && data.face && data.element.type != 'mesh') { let face_selection = UVEditor.getSelectedFaces(data.element, true); - if (event.ctrlOrCmd || Pressing.overrides.ctrl || event.shiftKey || Pressing.overrides.shift) { + if (data.element.selected && (event.ctrlOrCmd || Pressing.overrides.ctrl || event.shiftKey || Pressing.overrides.shift)) { face_selection.safePush(data.face); } else { face_selection.replace([data.face]);