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
b3496ee7
Commit
b3496ee7
authored
Aug 31, 2017
by
Rémi Verschelde
Committed by
GitHub
Aug 31, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #10763 from poke1024/realtime-polygon-2d-fix
Fixes two glitches in polygon2d wip mode introduced with #10614
parents
752459cc
d8fcc7d1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
polygon_2d_editor_plugin.cpp
editor/plugins/polygon_2d_editor_plugin.cpp
+8
-5
No files found.
editor/plugins/polygon_2d_editor_plugin.cpp
View file @
b3496ee7
...
...
@@ -402,10 +402,13 @@ bool Polygon2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
cpoint
=
canvas_item_editor
->
snap_point
(
cpoint
);
edited_point_pos
=
node
->
get_global_transform
().
affine_inverse
().
xform
(
cpoint
);
Vector
<
Vector2
>
poly
=
Variant
(
node
->
get_polygon
());
ERR_FAIL_INDEX_V
(
edited_point
,
poly
.
size
(),
false
);
poly
[
edited_point
]
=
edited_point_pos
-
node
->
get_offset
();
node
->
set_polygon
(
Variant
(
poly
));
if
(
!
wip_active
)
{
Vector
<
Vector2
>
poly
=
Variant
(
node
->
get_polygon
());
ERR_FAIL_INDEX_V
(
edited_point
,
poly
.
size
(),
false
);
poly
[
edited_point
]
=
edited_point_pos
-
node
->
get_offset
();
node
->
set_polygon
(
Variant
(
poly
));
}
canvas_item_editor
->
get_viewport_control
()
->
update
();
}
...
...
@@ -430,7 +433,7 @@ void Polygon2DEditor::_canvas_draw() {
Transform2D
xform
=
canvas_item_editor
->
get_canvas_transform
()
*
node
->
get_global_transform
();
Ref
<
Texture
>
handle
=
get_icon
(
"EditorHandle"
,
"EditorIcons"
);
if
(
edited_point
>=
0
&&
EDITOR_DEF
(
"editors/poly_editor/show_previous_outline"
,
true
))
{
if
(
!
wip_active
&&
edited_point
>=
0
&&
EDITOR_DEF
(
"editors/poly_editor/show_previous_outline"
,
true
))
{
const
Color
col
=
node
->
get_color
().
contrasted
();
const
int
n
=
pre_move_edit
.
size
();
...
...
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