summaryrefslogtreecommitdiff
path: root/scene/2d
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2015-04-30 10:06:18 -0300
committerJuan Linietsky <reduzio@gmail.com>2015-04-30 10:06:18 -0300
commit21939ce08b042b8cfcff16da780a4595aac500cd (patch)
tree6a6f8dd85426de1863e2802a725e6dc7b2e648bb /scene/2d
parent7773d70f449ae8dd66691661fe3ed86d1cabf219 (diff)
-some cleanups
-added tesselation function to curve and curve2d
Diffstat (limited to 'scene/2d')
-rw-r--r--scene/2d/camera_2d.cpp2
-rw-r--r--scene/2d/navigation2d.cpp8
2 files changed, 7 insertions, 3 deletions
diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp
index 2ebf34d34b..27a512845c 100644
--- a/scene/2d/camera_2d.cpp
+++ b/scene/2d/camera_2d.cpp
@@ -216,6 +216,7 @@ void Camera2D::_notification(int p_what) {
} break;
case NOTIFICATION_ENTER_TREE: {
+
viewport = NULL;
Node *n=this;
while(n){
@@ -526,6 +527,7 @@ Camera2D::Camera2D() {
drag_margin[MARGIN_RIGHT]=0.2;
drag_margin[MARGIN_BOTTOM]=0.2;
camera_pos=Vector2();
+ first=true;
smoothing=0.0;
zoom = Vector2(1, 1);
diff --git a/scene/2d/navigation2d.cpp b/scene/2d/navigation2d.cpp
index e4d10cad12..d427bf4bc3 100644
--- a/scene/2d/navigation2d.cpp
+++ b/scene/2d/navigation2d.cpp
@@ -516,7 +516,8 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2& p_start, const Vect
apex_poly=p;
portal_left=apex_point;
portal_right=apex_point;
- path.push_back(apex_point);
+ if (path[path.size()-1].distance_to(apex_point)>CMP_EPSILON)
+ path.push_back(apex_point);
skip=true;
}
}
@@ -536,7 +537,8 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2& p_start, const Vect
apex_poly=p;
portal_right=apex_point;
portal_left=apex_point;
- path.push_back(apex_point);
+ if (path[path.size()-1].distance_to(apex_point)>CMP_EPSILON)
+ path.push_back(apex_point);
}
}
@@ -547,7 +549,7 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2& p_start, const Vect
}
- if (path[path.size()-1]!=begin_point)
+ if (path[path.size()-1].distance_to(begin_point)>CMP_EPSILON)
path.push_back(begin_point);
path.invert();