Menu

#255 Drawing line sometimes shows a 360 degree angle

v0.9.29
closed
nobody
None
1
2022-07-03
2022-07-03
No

When drawing an almost horizontal line, the text description sometimes says that the line is 0 degrees, and sometimes 360 degrees. This is confusing, since 360° = 0°. Should be changed to always say 0 degrees.

Tested using the latest Git version.

Discussion

  • William Kendrick

    • Group: v0.9.28 --> v0.9.29
     
  • Pere Pujal i Carabantes

    Manually rounding 359.5 to 0 seems to fix it

    diff --git a/src/tuxpaint.c b/src/tuxpaint.c
    index a7948c7d..91ce84c5 100644
    --- a/src/tuxpaint.c
    +++ b/src/tuxpaint.c
    @@ -5976,6 +5976,9 @@ static void mainloop(void)
    if (angle < 0.0)
    angle += 360.0;

    • if (angle >= 359.5)
    • angle = 0.0; / Manually rounding to 0 as %.0f would have rounded to 360 /
      +
      update_screen(line_start_x + r_canvas.x,
      line_start_y + r_canvas.y, old_x + r_canvas.x, old_y + r_canvas.y);
      update_screen(line_start_x + r_canvas.x,
     
  • William Kendrick

    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB