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:
parent
b88c8a9030
commit
93f05af10d
1 changed files with 8 additions and 1 deletions
|
|
@ -2212,6 +2212,8 @@ enum
|
||||||
SHAPE_TOOL_MODE_DONE
|
SHAPE_TOOL_MODE_DONE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
int shape_reverse;
|
||||||
|
|
||||||
|
|
||||||
int brushflag, xnew, ynew, eraflag, lineflag, magicflag, keybd_flag, keybd_position, keyglobal, initial_y, gen_key_flag,
|
int brushflag, xnew, ynew, eraflag, lineflag, magicflag, keybd_flag, keybd_position, keyglobal, initial_y, gen_key_flag,
|
||||||
ide, activeflag, old_x, old_y;
|
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);
|
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! */
|
/* 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;
|
int deg;
|
||||||
|
|
||||||
|
|
||||||
deg = (atan2(oy - ctr_y, ox - ctr_x) * 180 / M_PI);
|
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)
|
if (shape_radius < 50)
|
||||||
deg = ((deg - 15) / 30) * 30;
|
deg = ((deg - 15) / 30) * 30;
|
||||||
else if (shape_radius < 100)
|
else if (shape_radius < 100)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue