Commit 93452ea4 authored by Sven Neumann's avatar Sven Neumann
Browse files

Only install the tool cursor if we are inside a selected region.


--Sven
parent 52f8d968
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>
* app/bucket_fill.c
......
......@@ -22,6 +22,7 @@
#include "drawable.h"
#include "flip_tool.h"
#include "gdisplay.h"
#include "gimage_mask.h"
#include "temp_buf.h"
#include "tool_options_ui.h"
#include "transform_core.h"
......@@ -154,15 +155,34 @@ flip_cursor_update (Tool *tool,
gpointer gdisp_ptr)
{
GDisplay *gdisp;
Layer *layer;
GdkCursorType ctype = GDK_TOP_LEFT_ARROW;
gdisp = (GDisplay *) gdisp_ptr;
if (flip_options->type == FLIP_HORZ)
ctype = GDK_SB_H_DOUBLE_ARROW;
else
ctype = GDK_SB_V_DOUBLE_ARROW;
if ((layer = gimage_get_active_layer (gdisp->gimage)))
{
int x, y, off_x, off_y;
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);
}
......
......@@ -22,6 +22,7 @@
#include "drawable.h"
#include "flip_tool.h"
#include "gdisplay.h"
#include "gimage_mask.h"
#include "temp_buf.h"
#include "tool_options_ui.h"
#include "transform_core.h"
......@@ -154,15 +155,34 @@ flip_cursor_update (Tool *tool,
gpointer gdisp_ptr)
{
GDisplay *gdisp;
Layer *layer;
GdkCursorType ctype = GDK_TOP_LEFT_ARROW;
gdisp = (GDisplay *) gdisp_ptr;
if (flip_options->type == FLIP_HORZ)
ctype = GDK_SB_H_DOUBLE_ARROW;
else
ctype = GDK_SB_V_DOUBLE_ARROW;
if ((layer = gimage_get_active_layer (gdisp->gimage)))
{
int x, y, off_x, off_y;
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);
}
......
......@@ -22,6 +22,7 @@
#include "drawable.h"
#include "flip_tool.h"
#include "gdisplay.h"
#include "gimage_mask.h"
#include "temp_buf.h"
#include "tool_options_ui.h"
#include "transform_core.h"
......@@ -154,15 +155,34 @@ flip_cursor_update (Tool *tool,
gpointer gdisp_ptr)
{
GDisplay *gdisp;
Layer *layer;
GdkCursorType ctype = GDK_TOP_LEFT_ARROW;
gdisp = (GDisplay *) gdisp_ptr;
if (flip_options->type == FLIP_HORZ)
ctype = GDK_SB_H_DOUBLE_ARROW;
else
ctype = GDK_SB_V_DOUBLE_ARROW;
if ((layer = gimage_get_active_layer (gdisp->gimage)))
{
int x, y, off_x, off_y;
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);
}
......
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