diff options
author | Carl Olsson <carl.olsson@gmail.com> | 2015-03-23 08:24:52 +1000 |
---|---|---|
committer | Carl Olsson <carl.olsson@gmail.com> | 2015-03-23 08:24:52 +1000 |
commit | 817f9debe787fc8001c03407f924f61fd5f0f7ad (patch) | |
tree | 89bcb1935240a77d566e8886573be52fb8f8a4bc /tools/editor/plugins | |
parent | fb2cdfe7edcc2ccafea7604afd104f582e5b9c17 (diff) |
Add iostream include to collada plugin and change to light occluder to use canvas item snap function.
Diffstat (limited to 'tools/editor/plugins')
-rw-r--r-- | tools/editor/plugins/light_occluder_2d_editor_plugin.cpp | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/tools/editor/plugins/light_occluder_2d_editor_plugin.cpp b/tools/editor/plugins/light_occluder_2d_editor_plugin.cpp index 5fa3d8ac8f..bf882857d9 100644 --- a/tools/editor/plugins/light_occluder_2d_editor_plugin.cpp +++ b/tools/editor/plugins/light_occluder_2d_editor_plugin.cpp @@ -35,17 +35,6 @@ void LightOccluder2DEditor::_node_removed(Node *p_node) { } -Vector2 LightOccluder2DEditor::snap_point(const Vector2& p_point) const { - - if (canvas_item_editor->is_snap_active()) { - - return p_point.snapped(Vector2(1,1)*canvas_item_editor->get_snap()); - - } else { - return p_point; - } -} - void LightOccluder2DEditor::_menu_option(int p_option) { switch(p_option) { @@ -109,7 +98,7 @@ bool LightOccluder2DEditor::forward_input_event(const InputEvent& p_event) { Vector2 gpoint = Point2(mb.x,mb.y); Vector2 cpoint = canvas_item_editor->get_canvas_transform().affine_inverse().xform(gpoint); - cpoint=snap_point(cpoint); + cpoint=canvas_item_editor->snap_point(cpoint); cpoint = node->get_global_transform().affine_inverse().xform(cpoint); Vector<Vector2> poly = Variant(node->get_occluder_polygon()->get_polygon()); @@ -317,7 +306,7 @@ bool LightOccluder2DEditor::forward_input_event(const InputEvent& p_event) { Vector2 gpoint = Point2(mm.x,mm.y); Vector2 cpoint = canvas_item_editor->get_canvas_transform().affine_inverse().xform(gpoint); - cpoint=snap_point(cpoint); + cpoint=canvas_item_editor->snap_point(cpoint); edited_point_pos = node->get_global_transform().affine_inverse().xform(cpoint); canvas_item_editor->get_viewport_control()->update(); |