Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
7f5fb731
Commit
7f5fb731
authored
Apr 15, 2020
by
Eric M
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added selection outline to locked nodes.
parent
5b4ea652
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
canvas_item_editor_plugin.cpp
editor/plugins/canvas_item_editor_plugin.cpp
+8
-2
No files found.
editor/plugins/canvas_item_editor_plugin.cpp
View file @
7f5fb731
...
...
@@ -3200,13 +3200,15 @@ void CanvasItemEditor::_draw_selection() {
RID
ci
=
viewport
->
get_canvas_item
();
List
<
CanvasItem
*>
selection
=
_get_edited_canvas_items
(
fals
e
,
false
);
List
<
CanvasItem
*>
selection
=
_get_edited_canvas_items
(
tru
e
,
false
);
bool
single
=
selection
.
size
()
==
1
;
for
(
List
<
CanvasItem
*>::
Element
*
E
=
selection
.
front
();
E
;
E
=
E
->
next
())
{
CanvasItem
*
canvas_item
=
Object
::
cast_to
<
CanvasItem
>
(
E
->
get
());
CanvasItemEditorSelectedItem
*
se
=
editor_selection
->
get_node_editor_data
<
CanvasItemEditorSelectedItem
>
(
canvas_item
);
bool
item_locked
=
canvas_item
->
has_meta
(
"_edit_lock_"
);
// Draw the previous position if we are dragging the node
if
(
show_helpers
&&
(
drag_type
==
DRAG_MOVE
||
drag_type
==
DRAG_ROTATE
||
...
...
@@ -3246,6 +3248,10 @@ void CanvasItemEditor::_draw_selection() {
Color
c
=
Color
(
1
,
0.6
,
0.4
,
0.7
);
if
(
item_locked
)
{
c
=
Color
(
0.7
,
0.7
,
0.7
,
0.7
);
}
for
(
int
i
=
0
;
i
<
4
;
i
++
)
{
viewport
->
draw_line
(
endpoints
[
i
],
endpoints
[(
i
+
1
)
%
4
],
c
,
Math
::
round
(
2
*
EDSCALE
));
}
...
...
@@ -3258,7 +3264,7 @@ void CanvasItemEditor::_draw_selection() {
viewport
->
draw_set_transform_matrix
(
viewport
->
get_transform
());
}
if
(
single
&&
(
tool
==
TOOL_SELECT
||
tool
==
TOOL_MOVE
||
tool
==
TOOL_SCALE
||
tool
==
TOOL_ROTATE
||
tool
==
TOOL_EDIT_PIVOT
))
{
//kind of sucks
if
(
single
&&
!
item_locked
&&
(
tool
==
TOOL_SELECT
||
tool
==
TOOL_MOVE
||
tool
==
TOOL_SCALE
||
tool
==
TOOL_ROTATE
||
tool
==
TOOL_EDIT_PIVOT
))
{
//kind of sucks
// Draw the pivot
if
(
canvas_item
->
_edit_use_pivot
())
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment