diff options
Diffstat (limited to 'core/math')
-rw-r--r-- | core/math/geometry_2d.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/core/math/geometry_2d.h b/core/math/geometry_2d.h index c32d9187af..929d69ffc9 100644 --- a/core/math/geometry_2d.h +++ b/core/math/geometry_2d.h @@ -453,17 +453,17 @@ public: return H; } - static Vector<Point2i> bresenham_line(const Point2i &p_start, const Point2i &p_end) { + static Vector<Point2i> bresenham_line(const Point2i &p_from, const Point2i &p_to) { Vector<Point2i> points; - Vector2i delta = (p_end - p_start).abs() * 2; - Vector2i step = (p_end - p_start).sign(); - Vector2i current = p_start; + Vector2i delta = (p_to - p_from).abs() * 2; + Vector2i step = (p_to - p_from).sign(); + Vector2i current = p_from; if (delta.x > delta.y) { int err = delta.x / 2; - for (; current.x != p_end.x; current.x += step.x) { + for (; current.x != p_to.x; current.x += step.x) { points.push_back(current); err -= delta.y; @@ -475,7 +475,7 @@ public: } else { int err = delta.y / 2; - for (; current.y != p_end.y; current.y += step.y) { + for (; current.y != p_to.y; current.y += step.y) { points.push_back(current); err -= delta.x; |