Commit 9de19a1f authored by Ell's avatar Ell

app: orient the spiral op line controller so that 0-degree rotation points right

This way, it runs to the middle of the spiral arm, and stays centered
even when balance != 0.
parent 2da59e7b
......@@ -56,7 +56,7 @@ line_callback (GObject *config,
x = x1 / area->width;
y = y1 / area->height;
radius = sqrt (SQR (x2 - x1) + SQR (y2 - y1));
rotation = atan2 (x2 - x1, y2 - y1) * 180 / G_PI;
rotation = atan2 (-(y2 - y1), x2 - x1) * 180 / G_PI;
if (rotation < 0)
rotation += 360.0;
......@@ -93,8 +93,8 @@ config_notify (GObject *config,
x1 = x * area->width;
y1 = y * area->height;
x2 = x1 + sin (rotation * (G_PI / 180.0)) * radius;
y2 = y1 + cos (rotation * (G_PI / 180.0)) * radius;
x2 = x1 + cos (rotation * (G_PI / 180.0)) * radius;
y2 = y1 - sin (rotation * (G_PI / 180.0)) * radius;
set_func (set_data, area, x1, y1, x2, y2);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment