Browse Source

Merge pull request #9162 from Zylann/fix_line2d_math

Fixed broken Line2D
Rémi Verschelde 8 years ago
parent
commit
ffe61e63d1
1 changed files with 3 additions and 3 deletions
  1. 3 3
      scene/2d/line_builder.cpp

+ 3 - 3
scene/2d/line_builder.cpp

@@ -337,7 +337,7 @@ void LineBuilder::build() {
 			} else if (current_joint_mode == LINE_JOINT_ROUND) {
 			} else if (current_joint_mode == LINE_JOINT_ROUND) {
 				Vector2 vbegin = cbegin - pos1;
 				Vector2 vbegin = cbegin - pos1;
 				Vector2 vend = cend - pos1;
 				Vector2 vend = cend - pos1;
-				strip_add_arc(pos1, vend.angle_to(vbegin), orientation);
+				strip_add_arc(pos1, vbegin.angle_to(vend), orientation);
 			}
 			}
 
 
 			if (intersection_result != SEGMENT_INTERSECT)
 			if (intersection_result != SEGMENT_INTERSECT)
@@ -498,7 +498,7 @@ void LineBuilder::strip_add_arc(Vector2 center, float angle_delta, Orientation o
 	if (angle_delta < 0.f)
 	if (angle_delta < 0.f)
 		angle_step = -angle_step;
 		angle_step = -angle_step;
 
 
-	float t = vbegin.angle_to(Vector2(1, 0));
+	float t = Vector2(1, 0).angle_to(vbegin);
 	float end_angle = t + angle_delta;
 	float end_angle = t + angle_delta;
 	Vector2 rpos(0, 0);
 	Vector2 rpos(0, 0);
 
 
@@ -525,7 +525,7 @@ void LineBuilder::new_arc(Vector2 center, Vector2 vbegin, float angle_delta, Col
 	if (angle_delta < 0.f)
 	if (angle_delta < 0.f)
 		angle_step = -angle_step;
 		angle_step = -angle_step;
 
 
-	float t = vbegin.angle_to(Vector2(1, 0));
+	float t = Vector2(1, 0).angle_to(vbegin);
 	float end_angle = t + angle_delta;
 	float end_angle = t + angle_delta;
 	Vector2 rpos(0, 0);
 	Vector2 rpos(0, 0);
 	float tt_begin = -Math_PI / 2.f;
 	float tt_begin = -Math_PI / 2.f;