summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorCarl Olsson <carl.olsson@gmail.com>2015-03-23 08:24:52 +1000
committerCarl Olsson <carl.olsson@gmail.com>2015-03-23 08:24:52 +1000
commit817f9debe787fc8001c03407f924f61fd5f0f7ad (patch)
tree89bcb1935240a77d566e8886573be52fb8f8a4bc /tools
parentfb2cdfe7edcc2ccafea7604afd104f582e5b9c17 (diff)
Add iostream include to collada plugin and change to light occluder to use canvas item snap function.
Diffstat (limited to 'tools')
-rw-r--r--tools/editor/io_plugins/editor_import_collada.cpp1
-rw-r--r--tools/editor/plugins/light_occluder_2d_editor_plugin.cpp15
2 files changed, 3 insertions, 13 deletions
diff --git a/tools/editor/io_plugins/editor_import_collada.cpp b/tools/editor/io_plugins/editor_import_collada.cpp
index d2c9f395d2..c12fb0535c 100644
--- a/tools/editor/io_plugins/editor_import_collada.cpp
+++ b/tools/editor/io_plugins/editor_import_collada.cpp
@@ -39,6 +39,7 @@
#include "scene/resources/packed_scene.h"
#include "os/os.h"
#include "tools/editor/editor_node.h"
+#include <iostream>
struct ColladaImport {
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();