mirror of https://github.com/GNOME/gimp.git
Removed gimp_rectangle_tool_get_press_coords() as it doesn't make sense
2007-11-11 Martin Nordholts <martinn@svn.gnome.org> * app/tools/gimprectangletool.[ch]: Removed gimp_rectangle_tool_get_press_coords() as it doesn't make sense for a rectangle tool interface to provide this functionality. Clients should take care of that themselves. Also adjusted internal code accordingly. * app/tools/gimprectangleselecttool.c: Remember the pressed coordinates on _button_press instead of asking GimpRectangleTool about it. svn path=/trunk/; revision=24119
This commit is contained in:
parent
222d3349e6
commit
49e2670eb6
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
||||||
|
2007-11-11 Martin Nordholts <martinn@svn.gnome.org>
|
||||||
|
|
||||||
|
* app/tools/gimprectangletool.[ch]: Removed
|
||||||
|
gimp_rectangle_tool_get_press_coords() as it doesn't make sense
|
||||||
|
for a rectangle tool interface to provide this functionality.
|
||||||
|
Clients should take care of that themselves. Also adjusted
|
||||||
|
internal code accordingly.
|
||||||
|
|
||||||
|
* app/tools/gimprectangleselecttool.c: Remember the pressed
|
||||||
|
coordinates on _button_press instead of asking GimpRectangleTool
|
||||||
|
about it.
|
||||||
|
|
||||||
2007-11-11 Michael Natterer <mitch@gimp.org>
|
2007-11-11 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
* configure.in: depend on pango 1.18
|
* configure.in: depend on pango 1.18
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
|
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
#include "libgimpmath/gimpmath.h"
|
||||||
#include "libgimpwidgets/gimpwidgets.h"
|
#include "libgimpwidgets/gimpwidgets.h"
|
||||||
|
|
||||||
#include "tools-types.h"
|
#include "tools-types.h"
|
||||||
|
@ -67,6 +68,9 @@ typedef struct GimpRectSelectToolPrivate
|
||||||
|
|
||||||
gboolean round_corners;
|
gboolean round_corners;
|
||||||
gdouble corner_radius;
|
gdouble corner_radius;
|
||||||
|
|
||||||
|
gdouble press_x;
|
||||||
|
gdouble press_y;
|
||||||
} GimpRectSelectToolPrivate;
|
} GimpRectSelectToolPrivate;
|
||||||
|
|
||||||
|
|
||||||
|
@ -219,8 +223,11 @@ gimp_rect_select_tool_init (GimpRectSelectTool *rect_select)
|
||||||
GIMP_DIRTY_IMAGE_SIZE |
|
GIMP_DIRTY_IMAGE_SIZE |
|
||||||
GIMP_DIRTY_SELECTION);
|
GIMP_DIRTY_SELECTION);
|
||||||
|
|
||||||
priv->undo = NULL;
|
priv->undo = NULL;
|
||||||
priv->redo = NULL;
|
priv->redo = NULL;
|
||||||
|
|
||||||
|
priv->press_x = 0.0;
|
||||||
|
priv->press_y = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GObject *
|
static GObject *
|
||||||
|
@ -374,6 +381,9 @@ gimp_rect_select_tool_button_press (GimpTool *tool,
|
||||||
|
|
||||||
gimp_rectangle_tool_button_press (tool, coords, time, state, display);
|
gimp_rectangle_tool_button_press (tool, coords, time, state, display);
|
||||||
|
|
||||||
|
priv->press_x = coords->x;
|
||||||
|
priv->press_y = coords->y;
|
||||||
|
|
||||||
/* if we have an existing rectangle in the current display, then
|
/* if we have an existing rectangle in the current display, then
|
||||||
* we have already "executed", and need to undo at this point,
|
* we have already "executed", and need to undo at this point,
|
||||||
* unless the user has done something in the meantime
|
* unless the user has done something in the meantime
|
||||||
|
@ -703,6 +713,12 @@ gimp_rect_select_tool_execute (GimpRectangleTool *rectangle,
|
||||||
gint w,
|
gint w,
|
||||||
gint h)
|
gint h)
|
||||||
{
|
{
|
||||||
|
GimpRectSelectTool *rect_sel_tool;
|
||||||
|
GimpRectSelectToolPrivate *priv;
|
||||||
|
|
||||||
|
rect_sel_tool = GIMP_RECT_SELECT_TOOL (rectangle);
|
||||||
|
priv = GIMP_RECT_SELECT_TOOL_GET_PRIVATE(rect_sel_tool);
|
||||||
|
|
||||||
if (w == 0 && h == 0)
|
if (w == 0 && h == 0)
|
||||||
{
|
{
|
||||||
GimpImage *image = GIMP_TOOL (rectangle)->display->image;
|
GimpImage *image = GIMP_TOOL (rectangle)->display->image;
|
||||||
|
@ -717,7 +733,8 @@ gimp_rect_select_tool_execute (GimpRectangleTool *rectangle,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
gimp_rectangle_tool_get_press_coords (rectangle, &pressx, &pressy);
|
pressx = ROUND (priv->press_x);
|
||||||
|
pressy = ROUND (priv->press_y);
|
||||||
|
|
||||||
/* if the click was inside the marching ants */
|
/* if the click was inside the marching ants */
|
||||||
if (gimp_pickable_get_opacity_at (GIMP_PICKABLE (selection),
|
if (gimp_pickable_get_opacity_at (GIMP_PICKABLE (selection),
|
||||||
|
@ -754,7 +771,7 @@ gimp_rect_select_tool_execute (GimpRectangleTool *rectangle,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gimp_rect_select_tool_update_option_defaults (GIMP_RECT_SELECT_TOOL (rectangle),
|
gimp_rect_select_tool_update_option_defaults (rect_sel_tool,
|
||||||
FALSE);
|
FALSE);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -100,12 +100,6 @@ struct _GimpRectangleToolPrivate
|
||||||
* during gimp_rectangle_tool_button_press and then only read.
|
* during gimp_rectangle_tool_button_press and then only read.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Holds coordinate where button was pressed when rectangle adjustment was
|
|
||||||
* initiated.
|
|
||||||
*/
|
|
||||||
gint pressx;
|
|
||||||
gint pressy;
|
|
||||||
|
|
||||||
/* Holds the coordinate that should be used as the "other side" when
|
/* Holds the coordinate that should be used as the "other side" when
|
||||||
* fixed-center is turned off.
|
* fixed-center is turned off.
|
||||||
*/
|
*/
|
||||||
|
@ -474,19 +468,6 @@ gimp_rectangle_tool_get_constraint (GimpRectangleTool *tool)
|
||||||
return private->constraint;
|
return private->constraint;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
gimp_rectangle_tool_get_press_coords (GimpRectangleTool *rect_tool,
|
|
||||||
gint *pressx_ptr,
|
|
||||||
gint *pressy_ptr)
|
|
||||||
{
|
|
||||||
GimpRectangleToolPrivate *private;
|
|
||||||
|
|
||||||
private = GIMP_RECTANGLE_TOOL_GET_PRIVATE (rect_tool);
|
|
||||||
|
|
||||||
*pressx_ptr = private->pressx;
|
|
||||||
*pressy_ptr = private->pressy;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gimp_rectangle_tool_pending_size_set:
|
* gimp_rectangle_tool_pending_size_set:
|
||||||
* @width_property: Option property to set to pending rectangle width.
|
* @width_property: Option property to set to pending rectangle width.
|
||||||
|
@ -852,9 +833,6 @@ gimp_rectangle_tool_button_press (GimpTool *tool,
|
||||||
x += snap_x;
|
x += snap_x;
|
||||||
y += snap_y;
|
y += snap_y;
|
||||||
|
|
||||||
private->pressx = x;
|
|
||||||
private->pressy = y;
|
|
||||||
|
|
||||||
private->lastx = x;
|
private->lastx = x;
|
||||||
private->lasty = y;
|
private->lasty = y;
|
||||||
|
|
||||||
|
@ -864,8 +842,8 @@ gimp_rectangle_tool_button_press (GimpTool *tool,
|
||||||
*/
|
*/
|
||||||
if (private->function == RECT_CREATING)
|
if (private->function == RECT_CREATING)
|
||||||
{
|
{
|
||||||
private->center_x_on_fixed_center = private->pressx;
|
private->center_x_on_fixed_center = x;
|
||||||
private->center_y_on_fixed_center = private->pressy;
|
private->center_y_on_fixed_center = y;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -880,8 +858,8 @@ gimp_rectangle_tool_button_press (GimpTool *tool,
|
||||||
*/
|
*/
|
||||||
if (private->function == RECT_CREATING)
|
if (private->function == RECT_CREATING)
|
||||||
{
|
{
|
||||||
private->other_side_x = private->pressx;
|
private->other_side_x = x;
|
||||||
private->other_side_y = private->pressy;
|
private->other_side_y = y;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -129,9 +129,6 @@ GimpRectangleConstraint gimp_rectangle_tool_get_constraint
|
||||||
GimpRectangleFunction gimp_rectangle_tool_get_function (GimpRectangleTool *rectangle);
|
GimpRectangleFunction gimp_rectangle_tool_get_function (GimpRectangleTool *rectangle);
|
||||||
void gimp_rectangle_tool_set_function (GimpRectangleTool *rectangle,
|
void gimp_rectangle_tool_set_function (GimpRectangleTool *rectangle,
|
||||||
GimpRectangleFunction function);
|
GimpRectangleFunction function);
|
||||||
void gimp_rectangle_tool_get_press_coords (GimpRectangleTool *rectangle,
|
|
||||||
gint *pressx_ptr,
|
|
||||||
gint *pressy_ptr);
|
|
||||||
void gimp_rectangle_tool_pending_size_set (GimpRectangleTool *rectangle,
|
void gimp_rectangle_tool_pending_size_set (GimpRectangleTool *rectangle,
|
||||||
GObject *object,
|
GObject *object,
|
||||||
const gchar *width_property,
|
const gchar *width_property,
|
||||||
|
|
Loading…
Reference in New Issue