GitLab repository storage has been migrated to hashed layout. Please contact Infrastructure team if you notice any issues with repositories or hooks.

Commit a44f83c6 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

simplified.

2006-11-07  Sven Neumann  <sven@gimp.org>

	* app/tools/gimprectangletool.c
(gimp_rectangle_tool_oper_update):
	simplified.
parent 3d0bace9
2006-11-07 Sven Neumann <sven@gimp.org>
* app/tools/gimprectangletool.c (gimp_rectangle_tool_oper_update):
simplified.
2006-11-07 Sven Neumann <sven@gimp.org>
* plug-ins/pygimp/gimpmodule.c: added context_push() and
......
......@@ -10,16 +10,21 @@ new stuff is being done that will one day be released as GIMP 2.4.
Changes in GIMP 2.3.13
======================
- show information about embedded color profiles
- optionally apply color profiles on load
- show information about embedded color profiles in Image Properties dialog
- allow to apply color profiles on load (still work in progress)
- new vectors PDB API to replaces the old path API
- added "Auntie Alias" plug-in for antialiasing on lineart
- added Edit->Fade operation
- added Rounded Corners option to Rectangle Select tool
- improved WinIcon plug-in (now loads and saves 24 bit and Vista icons)
- merged tiny-fu; replaces Script-Fu Scheme interpreter with TinyScheme
- merged gimp-tiny-fu; replaces Script-Fu Scheme interpreter with TinyScheme
- remember unit and interpolation type in scale and resize dialogs
- changed default interpolation type to Cubic
- show comment in Image Properties dialog
- when loading in image as layers, don't merge the layers
- added experimental palette color selector module
- don't save thumbnails that don't match the image
- increased tool handle sizes for better usability
- bug fixes and code cleanup
......
......@@ -1371,10 +1371,7 @@ gimp_rectangle_tool_oper_update (GimpTool *tool,
GimpRectangleToolPrivate *private;
GimpDrawTool *draw_tool;
GimpDisplayShell *shell;
gboolean inside_x;
gboolean inside_y;
gdouble handle_w;
gdouble handle_h;
gboolean inside;
gint function;
g_return_if_fail (GIMP_IS_RECTANGLE_TOOL (tool));
......@@ -1389,73 +1386,75 @@ gimp_rectangle_tool_oper_update (GimpTool *tool,
return;
}
inside_x = coords->x > private->x1 && coords->x < private->x2;
inside_y = coords->y > private->y1 && coords->y < private->y2;
inside = (coords->x > private->x1 && coords->x < private->x2 &&
coords->y > private->y1 && coords->y < private->y2);
shell = GIMP_DISPLAY_SHELL (tool->display->shell);
handle_w = private->handle_w / SCALEFACTOR_X (shell);
handle_h = private->handle_h / SCALEFACTOR_Y (shell);
if (gimp_draw_tool_on_handle (draw_tool, display,
coords->x, coords->y,
GIMP_HANDLE_SQUARE,
private->x1, private->y1,
private->handle_w, private->handle_h,
GTK_ANCHOR_NORTH_WEST,
FALSE))
{
function = RECT_RESIZING_UPPER_LEFT;
}
else if (gimp_draw_tool_on_handle (draw_tool, display,
coords->x, coords->y,
GIMP_HANDLE_SQUARE,
private->x2, private->y2,
private->handle_w, private->handle_h,
GTK_ANCHOR_SOUTH_EAST,
FALSE))
{
function = RECT_RESIZING_LOWER_RIGHT;
}
else if (gimp_draw_tool_on_handle (draw_tool, display,
coords->x, coords->y,
GIMP_HANDLE_SQUARE,
private->x2, private->y1,
private->handle_w, private->handle_h,
GTK_ANCHOR_NORTH_EAST,
FALSE))
{
function = RECT_RESIZING_UPPER_RIGHT;
}
else if (gimp_draw_tool_on_handle (draw_tool, display,
coords->x, coords->y,
GIMP_HANDLE_SQUARE,
private->x1, private->y2,
private->handle_w, private->handle_h,
GTK_ANCHOR_SOUTH_WEST,
FALSE))
if (inside)
{
function = RECT_RESIZING_LOWER_LEFT;
}
else if ((fabs (coords->x - private->x1) < handle_w) && inside_x && inside_y)
{
function = RECT_RESIZING_LEFT;
}
else if ((fabs (coords->x - private->x2) < handle_w) && inside_x && inside_y)
{
function = RECT_RESIZING_RIGHT;
}
else if ((fabs (coords->y - private->y1) < handle_h) && inside_x && inside_y)
{
function = RECT_RESIZING_TOP;
}
else if ((fabs (coords->y - private->y2) < handle_h) && inside_x && inside_y)
{
function = RECT_RESIZING_BOTTOM;
}
else if (inside_x && inside_y)
{
function = RECT_MOVING;
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (tool->display->shell);
gdouble handle_w = private->handle_w / SCALEFACTOR_X (shell);
gdouble handle_h = private->handle_h / SCALEFACTOR_Y (shell);
if (gimp_draw_tool_on_handle (draw_tool, display,
coords->x, coords->y,
GIMP_HANDLE_SQUARE,
private->x1, private->y1,
private->handle_w, private->handle_h,
GTK_ANCHOR_NORTH_WEST,
FALSE))
{
function = RECT_RESIZING_UPPER_LEFT;
}
else if (gimp_draw_tool_on_handle (draw_tool, display,
coords->x, coords->y,
GIMP_HANDLE_SQUARE,
private->x2, private->y2,
private->handle_w, private->handle_h,
GTK_ANCHOR_SOUTH_EAST,
FALSE))
{
function = RECT_RESIZING_LOWER_RIGHT;
}
else if (gimp_draw_tool_on_handle (draw_tool, display,
coords->x, coords->y,
GIMP_HANDLE_SQUARE,
private->x2, private->y1,
private->handle_w, private->handle_h,
GTK_ANCHOR_NORTH_EAST,
FALSE))
{
function = RECT_RESIZING_UPPER_RIGHT;
}
else if (gimp_draw_tool_on_handle (draw_tool, display,
coords->x, coords->y,
GIMP_HANDLE_SQUARE,
private->x1, private->y2,
private->handle_w, private->handle_h,
GTK_ANCHOR_SOUTH_WEST,
FALSE))
{
function = RECT_RESIZING_LOWER_LEFT;
}
else if (fabs (coords->x - private->x1) < handle_w)
{
function = RECT_RESIZING_LEFT;
}
else if ((fabs (coords->x - private->x2) < handle_w))
{
function = RECT_RESIZING_RIGHT;
}
else if ((fabs (coords->y - private->y1) < handle_h))
{
function = RECT_RESIZING_TOP;
}
else if ((fabs (coords->y - private->y2) < handle_h))
{
function = RECT_RESIZING_BOTTOM;
}
else
{
function = RECT_MOVING;
}
}
else
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment