Merge pull request #111687 from kevinlam508/update-selection-highlight-on-hidden-select
Fix selection highlight not updating when selecting a hidden canvasitems
This commit is contained in:
@@ -4492,6 +4492,32 @@ void CanvasItemEditor::_selection_changed() {
|
||||
temp_pivot = Vector2(Math::INF, Math::INF);
|
||||
viewport->queue_redraw();
|
||||
}
|
||||
|
||||
// Check to redraw to clear anything drawn from visible selections if no selections are visible.
|
||||
bool has_visible = false;
|
||||
for (const KeyValue<ObjectID, Object *> &E : editor_selection->get_selection()) {
|
||||
CanvasItem *ci = ObjectDB::get_instance<CanvasItem>(E.key);
|
||||
if (!ci || !ci->is_visible_in_tree()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Viewport *vp = ci->get_viewport();
|
||||
if (vp && !vp->is_visible_subviewport()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
CanvasItemEditorSelectedItem *se = editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(ci);
|
||||
if (se) {
|
||||
has_visible = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (had_visible_selection != has_visible) {
|
||||
if (!has_visible) {
|
||||
viewport->queue_redraw();
|
||||
}
|
||||
had_visible_selection = has_visible;
|
||||
}
|
||||
}
|
||||
|
||||
void CanvasItemEditor::edit(CanvasItem *p_canvas_item) {
|
||||
|
||||
@@ -234,6 +234,7 @@ private:
|
||||
real_t resample_delay = 0.3;
|
||||
|
||||
bool selected_from_canvas = false;
|
||||
bool had_visible_selection = false;
|
||||
|
||||
// Defaults are defined in clear().
|
||||
Point2 grid_offset;
|
||||
|
||||
Reference in New Issue
Block a user