|
@@ -2796,7 +2796,7 @@ inline void gcode_G0_G1(
|
2796
|
2796
|
x1 = current_position[X_AXIS], y1 = current_position[Y_AXIS],
|
2797
|
2797
|
x2 = destination[X_AXIS], y2 = destination[Y_AXIS];
|
2798
|
2798
|
if (r && (x2 != x1 || y2 != y1)) {
|
2799
|
|
- const float e = clockwise ? -1 : 1, // clockwise -1, counterclockwise 1
|
|
2799
|
+ const float e = clockwise ^ (r < 0) ? -1 : 1, // clockwise -1/1, counterclockwise 1/-1
|
2800
|
2800
|
dx = x2 - x1, dy = y2 - y1, // X and Y differences
|
2801
|
2801
|
d = HYPOT(dx, dy), // Linear distance between the points
|
2802
|
2802
|
h = sqrt(sq(r) - sq(d * 0.5)), // Distance to the arc pivot-point
|