iBrush rotation now snap cursor in an useful way (to fixed angles)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1582 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
parent
520da7d168
commit
715ddad331
@ -958,6 +958,10 @@ void Rotate_brush_1_5(void)
|
||||
Operation_pop(&old_y);
|
||||
Operation_pop(&old_x);
|
||||
|
||||
// On corrige les coordonnées de la ligne si la touche shift est appuyée...
|
||||
if(SDL_GetModState() & KMOD_SHIFT)
|
||||
Clamp_coordinates_regular_angle(Brush_rotation_center_X,Brush_rotation_center_Y,&Paintbrush_X,&Paintbrush_Y);
|
||||
|
||||
if ( (Paintbrush_X!=old_x) || (Paintbrush_Y!=old_y) || (prev_state!=2) )
|
||||
{
|
||||
if ( (Brush_rotation_center_X==Paintbrush_X)
|
||||
@ -1021,6 +1025,10 @@ void Rotate_brush_0_5(void)
|
||||
Operation_pop(&old_y);
|
||||
Operation_pop(&old_x);
|
||||
|
||||
// On corrige les coordonnées de la ligne si la touche shift est appuyée...
|
||||
if(SDL_GetModState() & KMOD_SHIFT)
|
||||
Clamp_coordinates_regular_angle(Brush_rotation_center_X,Brush_rotation_center_Y,&Paintbrush_X,&Paintbrush_Y);
|
||||
|
||||
if ((Paintbrush_X!=old_x) || (Paintbrush_Y!=old_y) || (prev_state!=3))
|
||||
{
|
||||
if ( (Brush_rotation_center_X==Paintbrush_X)
|
||||
|
||||
@ -494,9 +494,7 @@ void Line_12_5(void)
|
||||
|
||||
// On corrige les coordonnées de la ligne si la touche shift est appuyée...
|
||||
if(SDL_GetModState() & KMOD_SHIFT)
|
||||
{
|
||||
Clamp_coordinates_regular_angle(start_x,start_y,&cursor_x,&cursor_y);
|
||||
}
|
||||
|
||||
// On vient de bouger
|
||||
if ((cursor_x!=end_x) || (cursor_y!=end_y))
|
||||
|
||||
@ -1505,6 +1505,7 @@ void Compute_paintbrush_coordinates(void)
|
||||
{
|
||||
// Operations that don't implement it
|
||||
case OPERATION_LINE:
|
||||
case OPERATION_ROTATE_BRUSH:
|
||||
Snap_axis=0;
|
||||
break;
|
||||
// Operations that implement it
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user