mirror of https://github.com/GNOME/gimp.git
Only install the tool cursor if we are inside a selected region.
--Sven
This commit is contained in:
parent
52f8d96885
commit
93452ea4d6
|
@ -1,3 +1,8 @@
|
||||||
|
Tue Jun 8 01:12:31 MEST 1999 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* app/flip_tool.c: Only install the tool cursor if we are inside a
|
||||||
|
selected region.
|
||||||
|
|
||||||
Tue Jun 8 00:30:57 MEST 1999 Sven Neumann <sven@gimp.org>
|
Tue Jun 8 00:30:57 MEST 1999 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
* app/bucket_fill.c
|
* app/bucket_fill.c
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include "drawable.h"
|
#include "drawable.h"
|
||||||
#include "flip_tool.h"
|
#include "flip_tool.h"
|
||||||
#include "gdisplay.h"
|
#include "gdisplay.h"
|
||||||
|
#include "gimage_mask.h"
|
||||||
#include "temp_buf.h"
|
#include "temp_buf.h"
|
||||||
#include "tool_options_ui.h"
|
#include "tool_options_ui.h"
|
||||||
#include "transform_core.h"
|
#include "transform_core.h"
|
||||||
|
@ -154,15 +155,34 @@ flip_cursor_update (Tool *tool,
|
||||||
gpointer gdisp_ptr)
|
gpointer gdisp_ptr)
|
||||||
{
|
{
|
||||||
GDisplay *gdisp;
|
GDisplay *gdisp;
|
||||||
|
Layer *layer;
|
||||||
GdkCursorType ctype = GDK_TOP_LEFT_ARROW;
|
GdkCursorType ctype = GDK_TOP_LEFT_ARROW;
|
||||||
|
|
||||||
gdisp = (GDisplay *) gdisp_ptr;
|
gdisp = (GDisplay *) gdisp_ptr;
|
||||||
|
|
||||||
if (flip_options->type == FLIP_HORZ)
|
if ((layer = gimage_get_active_layer (gdisp->gimage)))
|
||||||
ctype = GDK_SB_H_DOUBLE_ARROW;
|
{
|
||||||
else
|
int x, y, off_x, off_y;
|
||||||
ctype = GDK_SB_V_DOUBLE_ARROW;
|
|
||||||
|
|
||||||
|
drawable_offsets (GIMP_DRAWABLE(layer), &off_x, &off_y);
|
||||||
|
gdisplay_untransform_coords (gdisp, (double) mevent->x,
|
||||||
|
(double) mevent->y,
|
||||||
|
&x, &y, TRUE, FALSE);
|
||||||
|
|
||||||
|
if (x >= off_x && y >= off_y &&
|
||||||
|
x < (off_x + drawable_width (GIMP_DRAWABLE(layer))) &&
|
||||||
|
y < (off_y + drawable_height (GIMP_DRAWABLE(layer))))
|
||||||
|
{
|
||||||
|
/* Is there a selected region? If so, is cursor inside? */
|
||||||
|
if (gimage_mask_is_empty (gdisp->gimage) || gimage_mask_value (gdisp->gimage, x, y))
|
||||||
|
{
|
||||||
|
if (flip_options->type == FLIP_HORZ)
|
||||||
|
ctype = GDK_SB_H_DOUBLE_ARROW;
|
||||||
|
else
|
||||||
|
ctype = GDK_SB_V_DOUBLE_ARROW;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
gdisplay_install_tool_cursor (gdisp, ctype);
|
gdisplay_install_tool_cursor (gdisp, ctype);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include "drawable.h"
|
#include "drawable.h"
|
||||||
#include "flip_tool.h"
|
#include "flip_tool.h"
|
||||||
#include "gdisplay.h"
|
#include "gdisplay.h"
|
||||||
|
#include "gimage_mask.h"
|
||||||
#include "temp_buf.h"
|
#include "temp_buf.h"
|
||||||
#include "tool_options_ui.h"
|
#include "tool_options_ui.h"
|
||||||
#include "transform_core.h"
|
#include "transform_core.h"
|
||||||
|
@ -154,15 +155,34 @@ flip_cursor_update (Tool *tool,
|
||||||
gpointer gdisp_ptr)
|
gpointer gdisp_ptr)
|
||||||
{
|
{
|
||||||
GDisplay *gdisp;
|
GDisplay *gdisp;
|
||||||
|
Layer *layer;
|
||||||
GdkCursorType ctype = GDK_TOP_LEFT_ARROW;
|
GdkCursorType ctype = GDK_TOP_LEFT_ARROW;
|
||||||
|
|
||||||
gdisp = (GDisplay *) gdisp_ptr;
|
gdisp = (GDisplay *) gdisp_ptr;
|
||||||
|
|
||||||
if (flip_options->type == FLIP_HORZ)
|
if ((layer = gimage_get_active_layer (gdisp->gimage)))
|
||||||
ctype = GDK_SB_H_DOUBLE_ARROW;
|
{
|
||||||
else
|
int x, y, off_x, off_y;
|
||||||
ctype = GDK_SB_V_DOUBLE_ARROW;
|
|
||||||
|
|
||||||
|
drawable_offsets (GIMP_DRAWABLE(layer), &off_x, &off_y);
|
||||||
|
gdisplay_untransform_coords (gdisp, (double) mevent->x,
|
||||||
|
(double) mevent->y,
|
||||||
|
&x, &y, TRUE, FALSE);
|
||||||
|
|
||||||
|
if (x >= off_x && y >= off_y &&
|
||||||
|
x < (off_x + drawable_width (GIMP_DRAWABLE(layer))) &&
|
||||||
|
y < (off_y + drawable_height (GIMP_DRAWABLE(layer))))
|
||||||
|
{
|
||||||
|
/* Is there a selected region? If so, is cursor inside? */
|
||||||
|
if (gimage_mask_is_empty (gdisp->gimage) || gimage_mask_value (gdisp->gimage, x, y))
|
||||||
|
{
|
||||||
|
if (flip_options->type == FLIP_HORZ)
|
||||||
|
ctype = GDK_SB_H_DOUBLE_ARROW;
|
||||||
|
else
|
||||||
|
ctype = GDK_SB_V_DOUBLE_ARROW;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
gdisplay_install_tool_cursor (gdisp, ctype);
|
gdisplay_install_tool_cursor (gdisp, ctype);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include "drawable.h"
|
#include "drawable.h"
|
||||||
#include "flip_tool.h"
|
#include "flip_tool.h"
|
||||||
#include "gdisplay.h"
|
#include "gdisplay.h"
|
||||||
|
#include "gimage_mask.h"
|
||||||
#include "temp_buf.h"
|
#include "temp_buf.h"
|
||||||
#include "tool_options_ui.h"
|
#include "tool_options_ui.h"
|
||||||
#include "transform_core.h"
|
#include "transform_core.h"
|
||||||
|
@ -154,15 +155,34 @@ flip_cursor_update (Tool *tool,
|
||||||
gpointer gdisp_ptr)
|
gpointer gdisp_ptr)
|
||||||
{
|
{
|
||||||
GDisplay *gdisp;
|
GDisplay *gdisp;
|
||||||
|
Layer *layer;
|
||||||
GdkCursorType ctype = GDK_TOP_LEFT_ARROW;
|
GdkCursorType ctype = GDK_TOP_LEFT_ARROW;
|
||||||
|
|
||||||
gdisp = (GDisplay *) gdisp_ptr;
|
gdisp = (GDisplay *) gdisp_ptr;
|
||||||
|
|
||||||
if (flip_options->type == FLIP_HORZ)
|
if ((layer = gimage_get_active_layer (gdisp->gimage)))
|
||||||
ctype = GDK_SB_H_DOUBLE_ARROW;
|
{
|
||||||
else
|
int x, y, off_x, off_y;
|
||||||
ctype = GDK_SB_V_DOUBLE_ARROW;
|
|
||||||
|
|
||||||
|
drawable_offsets (GIMP_DRAWABLE(layer), &off_x, &off_y);
|
||||||
|
gdisplay_untransform_coords (gdisp, (double) mevent->x,
|
||||||
|
(double) mevent->y,
|
||||||
|
&x, &y, TRUE, FALSE);
|
||||||
|
|
||||||
|
if (x >= off_x && y >= off_y &&
|
||||||
|
x < (off_x + drawable_width (GIMP_DRAWABLE(layer))) &&
|
||||||
|
y < (off_y + drawable_height (GIMP_DRAWABLE(layer))))
|
||||||
|
{
|
||||||
|
/* Is there a selected region? If so, is cursor inside? */
|
||||||
|
if (gimage_mask_is_empty (gdisp->gimage) || gimage_mask_value (gdisp->gimage, x, y))
|
||||||
|
{
|
||||||
|
if (flip_options->type == FLIP_HORZ)
|
||||||
|
ctype = GDK_SB_H_DOUBLE_ARROW;
|
||||||
|
else
|
||||||
|
ctype = GDK_SB_V_DOUBLE_ARROW;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
gdisplay_install_tool_cursor (gdisp, ctype);
|
gdisplay_install_tool_cursor (gdisp, ctype);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue