Fix #2401 Cuve face selection issue when selecting group

When selecting multiple cubes, inherit the face selection from the first selected cube
Tweak issue template to explain what format means
This commit is contained in:
JannisX11 2024-07-03 21:36:44 +02:00
parent 4d701548b2
commit 5d90a5a062
5 changed files with 24 additions and 4 deletions

View File

@ -29,6 +29,7 @@ body:
id: format
attributes:
label: Model format in which the issue occurs
description: Format means which option you choose when creating a new model. Not the file extension.
validations:
required: true
- type: dropdown

View File

@ -252,6 +252,18 @@ class Cube extends OutlinerElement {
}
return this;
}
selectLow(...args) {
let was_selected = this.selected;
super.selectLow(...args);
if (!was_selected && Cube.selected[0]) {
let other_selected_faces = UVEditor.selected_faces.slice();
let own_selected_faces = UVEditor.getSelectedFaces(this, true);
if (other_selected_faces?.length && !own_selected_faces?.length) {
own_selected_faces.replace(other_selected_faces);
}
}
return this;
}
size(axis, floored) {
var scope = this;
let epsilon = 0.0000001;

View File

@ -68,10 +68,11 @@ class Group extends OutlinerNode {
var scope = this;
if (Blockbench.hasFlag('renaming') || this.locked) return this;
if (!event) event = true
var allSelected = Group.selected === this && selected.length && this.matchesSelection()
var allSelected = Group.selected === this && selected.length && this.matchesSelection();
let previous_first_selected = Project.selected_elements[0];
//Clear Old Group
if (Group.selected) Group.selected.unselect()
if (Group.selected) Group.selected.unselect();
if ((event.shiftKey || Pressing.overrides.shift) !== true && (event.ctrlOrCmd || Pressing.overrides.ctrl) !== true) {
selected.length = 0
}
@ -87,6 +88,10 @@ class Group extends OutlinerNode {
//Select Only Group, unselect Children
selected.length = 0
} else {
// Fix for #2401
if (previous_first_selected && previous_first_selected.isChildOf(this)) {
selected.push(previous_first_selected);
}
scope.children.forEach(function(s) {
s.selectLow()
})

View File

@ -478,7 +478,9 @@ class OutlinerElement extends OutlinerNode {
//Normal
} else {
selected.forEachReverse(obj => obj.unselect())
selected.forEachReverse(obj => {
if (obj != this) obj.unselect();
})
if (Group.selected) Group.selected.unselect()
this.selectLow()
just_selected.push(this)

View File

@ -1,7 +1,7 @@
{
"name": "Blockbench",
"description": "Low-poly modeling and animation software",
"version": "4.10.3",
"version": "4.10.4",
"license": "GPL-3.0-or-later",
"author": {
"name": "JannisX11",