Ensure easy rotation of corner-stretched shapes

If corner-stretched shape is pulled to the left, make sure the
rotation step works properly.
This commit is contained in:
Bill Kendrick 2020-08-28 21:51:51 -07:00
parent b88c8a9030
commit 93f05af10d

View file

@ -2212,6 +2212,8 @@ enum
SHAPE_TOOL_MODE_DONE
};
int shape_reverse;
int brushflag, xnew, ynew, eraflag, lineflag, magicflag, keybd_flag, keybd_position, keyglobal, initial_y, gen_key_flag,
ide, activeflag, old_x, old_y;
@ -5359,6 +5361,8 @@ static void mainloop(void)
do_shape(shape_start_x, shape_start_y, new_x, new_y, 0, 0);
shape_reverse = (new_x < shape_start_x);
/* FIXME: Fix update shape function! */
@ -13256,9 +13260,12 @@ static int shape_rotation(int ctr_x, int ctr_y, int ox, int oy)
{
int deg;
deg = (atan2(oy - ctr_y, ox - ctr_x) * 180 / M_PI);
if (shape_reverse && shape_mode == SHAPEMODE_CORNER) {
deg = (deg + 180) % 360;
}
if (shape_radius < 50)
deg = ((deg - 15) / 30) * 30;
else if (shape_radius < 100)