Fixes two glitches in polygon2d wip mode introduced with #10614
This commit is contained in:
parent
c812c17633
commit
d8fcc7d1c2
@ -402,10 +402,13 @@ bool Polygon2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
|
|||||||
cpoint = canvas_item_editor->snap_point(cpoint);
|
cpoint = canvas_item_editor->snap_point(cpoint);
|
||||||
edited_point_pos = node->get_global_transform().affine_inverse().xform(cpoint);
|
edited_point_pos = node->get_global_transform().affine_inverse().xform(cpoint);
|
||||||
|
|
||||||
Vector<Vector2> poly = Variant(node->get_polygon());
|
if (!wip_active) {
|
||||||
ERR_FAIL_INDEX_V(edited_point, poly.size(), false);
|
|
||||||
poly[edited_point] = edited_point_pos - node->get_offset();
|
Vector<Vector2> poly = Variant(node->get_polygon());
|
||||||
node->set_polygon(Variant(poly));
|
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();
|
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();
|
Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
|
||||||
Ref<Texture> handle = get_icon("EditorHandle", "EditorIcons");
|
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 Color col = node->get_color().contrasted();
|
||||||
const int n = pre_move_edit.size();
|
const int n = pre_move_edit.size();
|
||||||
|
Loading…
Reference in New Issue
Block a user