mirror of https://github.com/GNOME/gimp.git
movements restricted to 45 degrees (Ctrl+Alt) feel more natural now
--Sven
This commit is contained in:
parent
b48e3c7a33
commit
ed81308375
|
@ -1,3 +1,9 @@
|
|||
Sat Aug 14 14:35:16 MEST 1999 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/blend.c
|
||||
* app/paint_core.c: movements restricted to 45 degrees (Ctrl+Alt)
|
||||
feel more natural now
|
||||
|
||||
Fri Aug 13 15:28:00 PDT 1999 Manish Singh <yosh@gimp.org>
|
||||
|
||||
* Makefile.am: add pixmaps/dropper.xpm to EXTRA_DIST
|
||||
|
|
19
app/blend.c
19
app/blend.c
|
@ -632,15 +632,14 @@ blend_motion (Tool *tool,
|
|||
{
|
||||
if (mevent->state & GDK_CONTROL_MASK)
|
||||
{
|
||||
double dx, dy;
|
||||
int dx, dy, d;
|
||||
|
||||
dx = blend_tool->endx - blend_tool->startx;
|
||||
dy = blend_tool->endy - blend_tool->starty;
|
||||
|
||||
blend_tool->endx = blend_tool->endx +
|
||||
((dx < 0) && (dy > 0) ? - MAX (dx, dy) : MAX (dx, dy));
|
||||
blend_tool->endy = blend_tool->endy +
|
||||
((dy < 0) && (dx > 0) ? - MAX (dx, dy) : MAX (dx, dy));
|
||||
d = (abs(dx) + abs(dy)) >> 1;
|
||||
|
||||
blend_tool->endx = blend_tool->startx + ((dx < 0) ? -d : d);
|
||||
blend_tool->endy = blend_tool->starty + ((dy < 0) ? -d : d);
|
||||
}
|
||||
else
|
||||
blend_tool->endx = blend_tool->startx;
|
||||
|
@ -653,9 +652,9 @@ blend_motion (Tool *tool,
|
|||
{
|
||||
g_snprintf (vector, sizeof (vector), gdisp->cursor_format_str,
|
||||
_("Blend: "),
|
||||
abs(blend_tool->endx - blend_tool->startx),
|
||||
blend_tool->endx - blend_tool->startx,
|
||||
", ",
|
||||
abs(blend_tool->endy - blend_tool->starty));
|
||||
blend_tool->endy - blend_tool->starty);
|
||||
}
|
||||
else /* show real world units */
|
||||
{
|
||||
|
@ -663,10 +662,10 @@ blend_motion (Tool *tool,
|
|||
|
||||
g_snprintf (vector, sizeof (vector), gdisp->cursor_format_str,
|
||||
_("Blend: "),
|
||||
abs(blend_tool->endx - blend_tool->startx) * unit_factor /
|
||||
blend_tool->endx - blend_tool->startx * unit_factor /
|
||||
gdisp->gimage->xresolution,
|
||||
", ",
|
||||
abs(blend_tool->endy - blend_tool->starty) * unit_factor /
|
||||
blend_tool->endy - blend_tool->starty * unit_factor /
|
||||
gdisp->gimage->yresolution);
|
||||
}
|
||||
gtk_statusbar_push (GTK_STATUSBAR (gdisp->statusbar), blend_tool->context_id,
|
||||
|
|
|
@ -632,15 +632,14 @@ blend_motion (Tool *tool,
|
|||
{
|
||||
if (mevent->state & GDK_CONTROL_MASK)
|
||||
{
|
||||
double dx, dy;
|
||||
int dx, dy, d;
|
||||
|
||||
dx = blend_tool->endx - blend_tool->startx;
|
||||
dy = blend_tool->endy - blend_tool->starty;
|
||||
|
||||
blend_tool->endx = blend_tool->endx +
|
||||
((dx < 0) && (dy > 0) ? - MAX (dx, dy) : MAX (dx, dy));
|
||||
blend_tool->endy = blend_tool->endy +
|
||||
((dy < 0) && (dx > 0) ? - MAX (dx, dy) : MAX (dx, dy));
|
||||
d = (abs(dx) + abs(dy)) >> 1;
|
||||
|
||||
blend_tool->endx = blend_tool->startx + ((dx < 0) ? -d : d);
|
||||
blend_tool->endy = blend_tool->starty + ((dy < 0) ? -d : d);
|
||||
}
|
||||
else
|
||||
blend_tool->endx = blend_tool->startx;
|
||||
|
@ -653,9 +652,9 @@ blend_motion (Tool *tool,
|
|||
{
|
||||
g_snprintf (vector, sizeof (vector), gdisp->cursor_format_str,
|
||||
_("Blend: "),
|
||||
abs(blend_tool->endx - blend_tool->startx),
|
||||
blend_tool->endx - blend_tool->startx,
|
||||
", ",
|
||||
abs(blend_tool->endy - blend_tool->starty));
|
||||
blend_tool->endy - blend_tool->starty);
|
||||
}
|
||||
else /* show real world units */
|
||||
{
|
||||
|
@ -663,10 +662,10 @@ blend_motion (Tool *tool,
|
|||
|
||||
g_snprintf (vector, sizeof (vector), gdisp->cursor_format_str,
|
||||
_("Blend: "),
|
||||
abs(blend_tool->endx - blend_tool->startx) * unit_factor /
|
||||
blend_tool->endx - blend_tool->startx * unit_factor /
|
||||
gdisp->gimage->xresolution,
|
||||
", ",
|
||||
abs(blend_tool->endy - blend_tool->starty) * unit_factor /
|
||||
blend_tool->endy - blend_tool->starty * unit_factor /
|
||||
gdisp->gimage->yresolution);
|
||||
}
|
||||
gtk_statusbar_push (GTK_STATUSBAR (gdisp->statusbar), blend_tool->context_id,
|
||||
|
|
|
@ -191,6 +191,7 @@ paint_core_button_press (Tool *tool,
|
|||
paint_core->startytilt = paint_core->lastytilt = paint_core->curytilt;
|
||||
paint_core->startxtilt = paint_core->lastxtilt = paint_core->curxtilt;
|
||||
}
|
||||
|
||||
/* If shift is down and this is not the first paint
|
||||
* stroke, then draw a line from the last coords to the pointer
|
||||
*/
|
||||
|
@ -249,11 +250,11 @@ paint_core_button_press (Tool *tool,
|
|||
if (paint_core->pick_colors
|
||||
&& !(bevent->state & GDK_SHIFT_MASK)
|
||||
&& (bevent->state & (GDK_CONTROL_MASK | GDK_MOD1_MASK)))
|
||||
{
|
||||
paint_core_sample_color (drawable, x, y, bevent->state);
|
||||
paint_core->pick_state = TRUE;
|
||||
return;
|
||||
}
|
||||
{
|
||||
paint_core_sample_color (drawable, x, y, bevent->state);
|
||||
paint_core->pick_state = TRUE;
|
||||
return;
|
||||
}
|
||||
else
|
||||
paint_core->pick_state = FALSE;
|
||||
|
||||
|
@ -378,15 +379,14 @@ paint_core_cursor_update (Tool *tool,
|
|||
{
|
||||
if (mevent->state & GDK_CONTROL_MASK)
|
||||
{
|
||||
double dx, dy;
|
||||
double dx, dy, d;
|
||||
|
||||
dx = paint_core->curx - paint_core->lastx;
|
||||
dy = paint_core->cury - paint_core->lasty;
|
||||
d = (fabs(dx) + fabs(dy)) / 2;
|
||||
|
||||
paint_core->curx = paint_core->lastx +
|
||||
((dx < 0) && (dy > 0) ? - MAX (dx, dy) : MAX (dx, dy));
|
||||
paint_core->cury = paint_core->lasty +
|
||||
((dy < 0) && (dx > 0) ? - MAX (dx, dy) : MAX (dx, dy));
|
||||
paint_core->curx = paint_core->lastx + ((dx < 0) ? -d : d);
|
||||
paint_core->cury = paint_core->lasty + ((dy < 0) ? -d : d);
|
||||
}
|
||||
else
|
||||
paint_core->curx = paint_core->lastx;
|
||||
|
|
|
@ -632,15 +632,14 @@ blend_motion (Tool *tool,
|
|||
{
|
||||
if (mevent->state & GDK_CONTROL_MASK)
|
||||
{
|
||||
double dx, dy;
|
||||
int dx, dy, d;
|
||||
|
||||
dx = blend_tool->endx - blend_tool->startx;
|
||||
dy = blend_tool->endy - blend_tool->starty;
|
||||
|
||||
blend_tool->endx = blend_tool->endx +
|
||||
((dx < 0) && (dy > 0) ? - MAX (dx, dy) : MAX (dx, dy));
|
||||
blend_tool->endy = blend_tool->endy +
|
||||
((dy < 0) && (dx > 0) ? - MAX (dx, dy) : MAX (dx, dy));
|
||||
d = (abs(dx) + abs(dy)) >> 1;
|
||||
|
||||
blend_tool->endx = blend_tool->startx + ((dx < 0) ? -d : d);
|
||||
blend_tool->endy = blend_tool->starty + ((dy < 0) ? -d : d);
|
||||
}
|
||||
else
|
||||
blend_tool->endx = blend_tool->startx;
|
||||
|
@ -653,9 +652,9 @@ blend_motion (Tool *tool,
|
|||
{
|
||||
g_snprintf (vector, sizeof (vector), gdisp->cursor_format_str,
|
||||
_("Blend: "),
|
||||
abs(blend_tool->endx - blend_tool->startx),
|
||||
blend_tool->endx - blend_tool->startx,
|
||||
", ",
|
||||
abs(blend_tool->endy - blend_tool->starty));
|
||||
blend_tool->endy - blend_tool->starty);
|
||||
}
|
||||
else /* show real world units */
|
||||
{
|
||||
|
@ -663,10 +662,10 @@ blend_motion (Tool *tool,
|
|||
|
||||
g_snprintf (vector, sizeof (vector), gdisp->cursor_format_str,
|
||||
_("Blend: "),
|
||||
abs(blend_tool->endx - blend_tool->startx) * unit_factor /
|
||||
blend_tool->endx - blend_tool->startx * unit_factor /
|
||||
gdisp->gimage->xresolution,
|
||||
", ",
|
||||
abs(blend_tool->endy - blend_tool->starty) * unit_factor /
|
||||
blend_tool->endy - blend_tool->starty * unit_factor /
|
||||
gdisp->gimage->yresolution);
|
||||
}
|
||||
gtk_statusbar_push (GTK_STATUSBAR (gdisp->statusbar), blend_tool->context_id,
|
||||
|
|
|
@ -632,15 +632,14 @@ blend_motion (Tool *tool,
|
|||
{
|
||||
if (mevent->state & GDK_CONTROL_MASK)
|
||||
{
|
||||
double dx, dy;
|
||||
int dx, dy, d;
|
||||
|
||||
dx = blend_tool->endx - blend_tool->startx;
|
||||
dy = blend_tool->endy - blend_tool->starty;
|
||||
|
||||
blend_tool->endx = blend_tool->endx +
|
||||
((dx < 0) && (dy > 0) ? - MAX (dx, dy) : MAX (dx, dy));
|
||||
blend_tool->endy = blend_tool->endy +
|
||||
((dy < 0) && (dx > 0) ? - MAX (dx, dy) : MAX (dx, dy));
|
||||
d = (abs(dx) + abs(dy)) >> 1;
|
||||
|
||||
blend_tool->endx = blend_tool->startx + ((dx < 0) ? -d : d);
|
||||
blend_tool->endy = blend_tool->starty + ((dy < 0) ? -d : d);
|
||||
}
|
||||
else
|
||||
blend_tool->endx = blend_tool->startx;
|
||||
|
@ -653,9 +652,9 @@ blend_motion (Tool *tool,
|
|||
{
|
||||
g_snprintf (vector, sizeof (vector), gdisp->cursor_format_str,
|
||||
_("Blend: "),
|
||||
abs(blend_tool->endx - blend_tool->startx),
|
||||
blend_tool->endx - blend_tool->startx,
|
||||
", ",
|
||||
abs(blend_tool->endy - blend_tool->starty));
|
||||
blend_tool->endy - blend_tool->starty);
|
||||
}
|
||||
else /* show real world units */
|
||||
{
|
||||
|
@ -663,10 +662,10 @@ blend_motion (Tool *tool,
|
|||
|
||||
g_snprintf (vector, sizeof (vector), gdisp->cursor_format_str,
|
||||
_("Blend: "),
|
||||
abs(blend_tool->endx - blend_tool->startx) * unit_factor /
|
||||
blend_tool->endx - blend_tool->startx * unit_factor /
|
||||
gdisp->gimage->xresolution,
|
||||
", ",
|
||||
abs(blend_tool->endy - blend_tool->starty) * unit_factor /
|
||||
blend_tool->endy - blend_tool->starty * unit_factor /
|
||||
gdisp->gimage->yresolution);
|
||||
}
|
||||
gtk_statusbar_push (GTK_STATUSBAR (gdisp->statusbar), blend_tool->context_id,
|
||||
|
|
|
@ -191,6 +191,7 @@ paint_core_button_press (Tool *tool,
|
|||
paint_core->startytilt = paint_core->lastytilt = paint_core->curytilt;
|
||||
paint_core->startxtilt = paint_core->lastxtilt = paint_core->curxtilt;
|
||||
}
|
||||
|
||||
/* If shift is down and this is not the first paint
|
||||
* stroke, then draw a line from the last coords to the pointer
|
||||
*/
|
||||
|
@ -249,11 +250,11 @@ paint_core_button_press (Tool *tool,
|
|||
if (paint_core->pick_colors
|
||||
&& !(bevent->state & GDK_SHIFT_MASK)
|
||||
&& (bevent->state & (GDK_CONTROL_MASK | GDK_MOD1_MASK)))
|
||||
{
|
||||
paint_core_sample_color (drawable, x, y, bevent->state);
|
||||
paint_core->pick_state = TRUE;
|
||||
return;
|
||||
}
|
||||
{
|
||||
paint_core_sample_color (drawable, x, y, bevent->state);
|
||||
paint_core->pick_state = TRUE;
|
||||
return;
|
||||
}
|
||||
else
|
||||
paint_core->pick_state = FALSE;
|
||||
|
||||
|
@ -378,15 +379,14 @@ paint_core_cursor_update (Tool *tool,
|
|||
{
|
||||
if (mevent->state & GDK_CONTROL_MASK)
|
||||
{
|
||||
double dx, dy;
|
||||
double dx, dy, d;
|
||||
|
||||
dx = paint_core->curx - paint_core->lastx;
|
||||
dy = paint_core->cury - paint_core->lasty;
|
||||
d = (fabs(dx) + fabs(dy)) / 2;
|
||||
|
||||
paint_core->curx = paint_core->lastx +
|
||||
((dx < 0) && (dy > 0) ? - MAX (dx, dy) : MAX (dx, dy));
|
||||
paint_core->cury = paint_core->lasty +
|
||||
((dy < 0) && (dx > 0) ? - MAX (dx, dy) : MAX (dx, dy));
|
||||
paint_core->curx = paint_core->lastx + ((dx < 0) ? -d : d);
|
||||
paint_core->cury = paint_core->lasty + ((dy < 0) ? -d : d);
|
||||
}
|
||||
else
|
||||
paint_core->curx = paint_core->lastx;
|
||||
|
|
Loading…
Reference in New Issue