summaryrefslogtreecommitdiff
path: root/tools/editor
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2015-02-14 19:25:35 -0300
committerJuan Linietsky <reduzio@gmail.com>2015-02-14 19:25:35 -0300
commit7ebb224ec1d81ccd62b77f21f01f5267220aee09 (patch)
tree946393768bd9762cc5fb7a4ffbb1837b7a440261 /tools/editor
parentd2f86cc09bf4136ebc1c2bbb8ec7b48a439c0371 (diff)
parent8bb1e19d7355ac92ec5cfe39fbb6db73d6c0fffe (diff)
Merge pull request #1362 from not-surt/tile_map_body_mode
Added body mode property for TileMap as kinematic body
Diffstat (limited to 'tools/editor')
-rw-r--r--tools/editor/plugins/collision_polygon_editor_plugin.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/tools/editor/plugins/collision_polygon_editor_plugin.cpp b/tools/editor/plugins/collision_polygon_editor_plugin.cpp
index b92acb60f9..a6f2085a19 100644
--- a/tools/editor/plugins/collision_polygon_editor_plugin.cpp
+++ b/tools/editor/plugins/collision_polygon_editor_plugin.cpp
@@ -31,6 +31,8 @@
#include "os/file_access.h"
#include "tools/editor/editor_settings.h"
#include "scene/3d/camera.h"
+#include "canvas_item_editor_plugin.h"
+
void CollisionPolygonEditor::_notification(int p_what) {
switch(p_what) {
@@ -71,14 +73,14 @@ void CollisionPolygonEditor::_node_removed(Node *p_node) {
Vector2 CollisionPolygonEditor::snap_point(const Vector2& p_point) const {
return p_point;
- /*
- if (canvas_item_editor->is_snap_active()) {
+
+ if (CanvasItemEditor::get_singleton()->is_snap_active()) {
- return p_point.snapped(Vector2(1,1)*canvas_item_editor->get_snap());
+ return p_point.snapped(Vector2(1,1)*CanvasItemEditor::get_singleton()->get_snap());
} else {
return p_point;
- } ??? */
+ }
}
void CollisionPolygonEditor::_menu_option(int p_option) {
@@ -148,7 +150,7 @@ bool CollisionPolygonEditor::forward_spatial_input_event(Camera* p_camera,const
Vector2 cpoint(spoint.x,spoint.y);
- //cpoint=snap_point(cpoint); snap?
+ cpoint=snap_point(cpoint);
Vector<Vector2> poly = node->get_polygon();
@@ -362,7 +364,7 @@ bool CollisionPolygonEditor::forward_spatial_input_event(Camera* p_camera,const
Vector2 cpoint(spoint.x,spoint.y);
- //cpoint=snap_point(cpoint);
+ cpoint=snap_point(cpoint);
edited_point_pos = cpoint;
_polygon_draw();