app: port GimpDisplayShell guide drawing to cairo
The cairo_t code in GimpMoveTool is still disgusting. This probably needs some GimpTool API that creates a cairo_t for tools.
This commit is contained in:
@ -402,8 +402,6 @@ gimp_canvas_gc_new (GimpCanvas *canvas,
|
|||||||
case GIMP_CANVAS_STYLE_SELECTION_OUT:
|
case GIMP_CANVAS_STYLE_SELECTION_OUT:
|
||||||
case GIMP_CANVAS_STYLE_LAYER_BOUNDARY:
|
case GIMP_CANVAS_STYLE_LAYER_BOUNDARY:
|
||||||
case GIMP_CANVAS_STYLE_LAYER_GROUP_BOUNDARY:
|
case GIMP_CANVAS_STYLE_LAYER_GROUP_BOUNDARY:
|
||||||
case GIMP_CANVAS_STYLE_GUIDE_NORMAL:
|
|
||||||
case GIMP_CANVAS_STYLE_GUIDE_ACTIVE:
|
|
||||||
case GIMP_CANVAS_STYLE_LAYER_MASK_ACTIVE:
|
case GIMP_CANVAS_STYLE_LAYER_MASK_ACTIVE:
|
||||||
mask |= GDK_GC_CAP_STYLE | GDK_GC_FILL | GDK_GC_STIPPLE;
|
mask |= GDK_GC_CAP_STYLE | GDK_GC_FILL | GDK_GC_STIPPLE;
|
||||||
values.cap_style = GDK_CAP_NOT_LAST;
|
values.cap_style = GDK_CAP_NOT_LAST;
|
||||||
@ -482,26 +480,6 @@ gimp_canvas_gc_new (GimpCanvas *canvas,
|
|||||||
bg.blue = 0xffff;
|
bg.blue = 0xffff;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GIMP_CANVAS_STYLE_GUIDE_NORMAL:
|
|
||||||
fg.red = 0x0;
|
|
||||||
fg.green = 0x0;
|
|
||||||
fg.blue = 0x0;
|
|
||||||
|
|
||||||
bg.red = 0x0;
|
|
||||||
bg.green = 0x7f7f;
|
|
||||||
bg.blue = 0xffff;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case GIMP_CANVAS_STYLE_GUIDE_ACTIVE:
|
|
||||||
fg.red = 0x0;
|
|
||||||
fg.green = 0x0;
|
|
||||||
fg.blue = 0x0;
|
|
||||||
|
|
||||||
bg.red = 0xffff;
|
|
||||||
bg.green = 0x0;
|
|
||||||
bg.blue = 0x0;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case GIMP_CANVAS_STYLE_LAYER_MASK_ACTIVE:
|
case GIMP_CANVAS_STYLE_LAYER_MASK_ACTIVE:
|
||||||
fg.red = 0x0;
|
fg.red = 0x0;
|
||||||
fg.green = 0x0;
|
fg.green = 0x0;
|
||||||
|
@ -34,8 +34,6 @@ typedef enum
|
|||||||
GIMP_CANVAS_STYLE_SELECTION_OUT,
|
GIMP_CANVAS_STYLE_SELECTION_OUT,
|
||||||
GIMP_CANVAS_STYLE_LAYER_BOUNDARY,
|
GIMP_CANVAS_STYLE_LAYER_BOUNDARY,
|
||||||
GIMP_CANVAS_STYLE_LAYER_GROUP_BOUNDARY,
|
GIMP_CANVAS_STYLE_LAYER_GROUP_BOUNDARY,
|
||||||
GIMP_CANVAS_STYLE_GUIDE_NORMAL,
|
|
||||||
GIMP_CANVAS_STYLE_GUIDE_ACTIVE,
|
|
||||||
GIMP_CANVAS_STYLE_SAMPLE_POINT_NORMAL,
|
GIMP_CANVAS_STYLE_SAMPLE_POINT_NORMAL,
|
||||||
GIMP_CANVAS_STYLE_SAMPLE_POINT_ACTIVE,
|
GIMP_CANVAS_STYLE_SAMPLE_POINT_ACTIVE,
|
||||||
GIMP_CANVAS_STYLE_LAYER_MASK_ACTIVE,
|
GIMP_CANVAS_STYLE_LAYER_MASK_ACTIVE,
|
||||||
|
@ -2297,7 +2297,9 @@ gimp_display_shell_canvas_expose_image (GimpDisplayShell *shell,
|
|||||||
cairo_restore (cr);
|
cairo_restore (cr);
|
||||||
|
|
||||||
/* draw the guides */
|
/* draw the guides */
|
||||||
gimp_display_shell_draw_guides (shell, eevent->region);
|
cairo_save (cr);
|
||||||
|
gimp_display_shell_draw_guides (shell, cr);
|
||||||
|
cairo_restore (cr);
|
||||||
|
|
||||||
/* draw the sample points */
|
/* draw the sample points */
|
||||||
gimp_display_shell_draw_sample_points (shell, eevent->region);
|
gimp_display_shell_draw_sample_points (shell, eevent->region);
|
||||||
|
@ -132,89 +132,80 @@ gimp_display_shell_draw_get_scaled_image_size_for_scale (GimpDisplayShell *shell
|
|||||||
|
|
||||||
void
|
void
|
||||||
gimp_display_shell_draw_guide (GimpDisplayShell *shell,
|
gimp_display_shell_draw_guide (GimpDisplayShell *shell,
|
||||||
|
cairo_t *cr,
|
||||||
GimpGuide *guide,
|
GimpGuide *guide,
|
||||||
const GdkRectangle *area,
|
|
||||||
gboolean active)
|
gboolean active)
|
||||||
{
|
{
|
||||||
gint position;
|
gint position;
|
||||||
|
gdouble dx1, dy1, dx2, dy2;
|
||||||
gint x1, y1, x2, y2;
|
gint x1, y1, x2, y2;
|
||||||
gint x, y;
|
gint x, y;
|
||||||
|
|
||||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||||
|
g_return_if_fail (cr != NULL);
|
||||||
g_return_if_fail (GIMP_IS_GUIDE (guide));
|
g_return_if_fail (GIMP_IS_GUIDE (guide));
|
||||||
|
|
||||||
position = gimp_guide_get_position (guide);
|
position = gimp_guide_get_position (guide);
|
||||||
|
|
||||||
if (position < 0)
|
if (position < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
x1 = 0;
|
cairo_clip_extents (cr, &dx1, &dy1, &dx2, &dy2);
|
||||||
y1 = 0;
|
|
||||||
|
|
||||||
gdk_drawable_get_size (gtk_widget_get_window (shell->canvas), &x2, &y2);
|
x1 = floor (dx1);
|
||||||
|
y1 = floor (dy1);
|
||||||
|
x2 = ceil (dx2);
|
||||||
|
y2 = ceil (dy2);
|
||||||
|
|
||||||
|
gimp_display_shell_set_guide_style (shell, cr, active);
|
||||||
|
|
||||||
switch (gimp_guide_get_orientation (guide))
|
switch (gimp_guide_get_orientation (guide))
|
||||||
{
|
{
|
||||||
case GIMP_ORIENTATION_HORIZONTAL:
|
case GIMP_ORIENTATION_HORIZONTAL:
|
||||||
gimp_display_shell_transform_xy (shell, 0, position, &x, &y, FALSE);
|
gimp_display_shell_transform_xy (shell, 0, position, &x, &y, FALSE);
|
||||||
if (area && (y < area->y || y >= area->y + area->height))
|
if (y >= y1 && y < y2)
|
||||||
return;
|
{
|
||||||
if (y < y1 || y >= y2)
|
cairo_move_to (cr, x1, y + 0.5);
|
||||||
return;
|
cairo_line_to (cr, x2, y + 0.5);
|
||||||
y1 = y2 = y;
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GIMP_ORIENTATION_VERTICAL:
|
case GIMP_ORIENTATION_VERTICAL:
|
||||||
gimp_display_shell_transform_xy (shell, position, 0, &x, &y, FALSE);
|
gimp_display_shell_transform_xy (shell, position, 0, &x, &y, FALSE);
|
||||||
if (area && (x < area->x || x >= area->x + area->width))
|
if (x >= x1 && x < x2)
|
||||||
return;
|
{
|
||||||
if (x < x1 || x >= x2)
|
cairo_move_to (cr, x + 0.5, y1);
|
||||||
return;
|
cairo_line_to (cr, x + 0.5, y2);
|
||||||
x1 = x2 = x;
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GIMP_ORIENTATION_UNKNOWN:
|
case GIMP_ORIENTATION_UNKNOWN:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
gimp_canvas_draw_line (GIMP_CANVAS (shell->canvas),
|
cairo_stroke (cr);
|
||||||
(active ?
|
|
||||||
GIMP_CANVAS_STYLE_GUIDE_ACTIVE :
|
|
||||||
GIMP_CANVAS_STYLE_GUIDE_NORMAL), x1, y1, x2, y2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gimp_display_shell_draw_guides (GimpDisplayShell *shell,
|
gimp_display_shell_draw_guides (GimpDisplayShell *shell,
|
||||||
const GdkRegion *region)
|
cairo_t *cr)
|
||||||
{
|
{
|
||||||
GimpImage *image;
|
GimpImage *image;
|
||||||
|
|
||||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||||
g_return_if_fail (region != NULL);
|
g_return_if_fail (cr != NULL);
|
||||||
|
|
||||||
image = gimp_display_get_image (shell->display);
|
image = gimp_display_get_image (shell->display);
|
||||||
|
|
||||||
if (image && gimp_display_shell_get_show_guides (shell))
|
if (image && gimp_display_shell_get_show_guides (shell))
|
||||||
{
|
{
|
||||||
GdkRectangle area;
|
|
||||||
GList *list;
|
GList *list;
|
||||||
|
|
||||||
gimp_canvas_set_clip_region (GIMP_CANVAS (shell->canvas),
|
|
||||||
GIMP_CANVAS_STYLE_GUIDE_NORMAL,
|
|
||||||
region);
|
|
||||||
gdk_region_get_clipbox (region, &area);
|
|
||||||
|
|
||||||
for (list = gimp_image_get_guides (image);
|
for (list = gimp_image_get_guides (image);
|
||||||
list;
|
list;
|
||||||
list = g_list_next (list))
|
list = g_list_next (list))
|
||||||
{
|
{
|
||||||
gimp_display_shell_draw_guide (shell, list->data,
|
gimp_display_shell_draw_guide (shell, cr, list->data, FALSE);
|
||||||
&area, FALSE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gimp_canvas_set_clip_region (GIMP_CANVAS (shell->canvas),
|
|
||||||
GIMP_CANVAS_STYLE_GUIDE_NORMAL,
|
|
||||||
NULL);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,11 +28,11 @@ void gimp_display_shell_draw_get_scaled_image_size_for_scale
|
|||||||
gint *w,
|
gint *w,
|
||||||
gint *h);
|
gint *h);
|
||||||
void gimp_display_shell_draw_guide (GimpDisplayShell *shell,
|
void gimp_display_shell_draw_guide (GimpDisplayShell *shell,
|
||||||
|
cairo_t *cr,
|
||||||
GimpGuide *guide,
|
GimpGuide *guide,
|
||||||
const GdkRectangle *area,
|
|
||||||
gboolean active);
|
gboolean active);
|
||||||
void gimp_display_shell_draw_guides (GimpDisplayShell *shell,
|
void gimp_display_shell_draw_guides (GimpDisplayShell *shell,
|
||||||
const GdkRegion *region);
|
cairo_t *cr);
|
||||||
void gimp_display_shell_draw_grid (GimpDisplayShell *shell,
|
void gimp_display_shell_draw_grid (GimpDisplayShell *shell,
|
||||||
cairo_t *cr);
|
cairo_t *cr);
|
||||||
void gimp_display_shell_draw_pen (GimpDisplayShell *shell,
|
void gimp_display_shell_draw_pen (GimpDisplayShell *shell,
|
||||||
|
@ -34,6 +34,41 @@
|
|||||||
#include "gimpdisplayshell-style.h"
|
#include "gimpdisplayshell-style.h"
|
||||||
|
|
||||||
|
|
||||||
|
static const GimpRGB guide_normal_fg = { 0.0, 0.0, 0.0, 1.0 };
|
||||||
|
static const GimpRGB guide_normal_bg = { 0.0, 0.5, 1.0, 1.0 };
|
||||||
|
static const GimpRGB guide_active_fg = { 0.0, 0.0, 0.0, 1.0 };
|
||||||
|
static const GimpRGB guide_active_bg = { 1.0, 0.0, 0.0, 1.0 };
|
||||||
|
|
||||||
|
|
||||||
|
/* local function prototypes */
|
||||||
|
|
||||||
|
static void gimp_display_shell_set_stipple_style (cairo_t *cr,
|
||||||
|
const GimpRGB *fg,
|
||||||
|
const GimpRGB *bg);
|
||||||
|
|
||||||
|
|
||||||
|
/* public functions */
|
||||||
|
|
||||||
|
void
|
||||||
|
gimp_display_shell_set_guide_style (GimpDisplayShell *shell,
|
||||||
|
cairo_t *cr,
|
||||||
|
gboolean active)
|
||||||
|
{
|
||||||
|
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||||
|
g_return_if_fail (cr != NULL);
|
||||||
|
|
||||||
|
cairo_set_line_width (cr, 1.0);
|
||||||
|
|
||||||
|
if (active)
|
||||||
|
gimp_display_shell_set_stipple_style (cr,
|
||||||
|
&guide_active_fg,
|
||||||
|
&guide_active_bg);
|
||||||
|
else
|
||||||
|
gimp_display_shell_set_stipple_style (cr,
|
||||||
|
&guide_normal_fg,
|
||||||
|
&guide_normal_bg);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gimp_display_shell_set_grid_style (GimpDisplayShell *shell,
|
gimp_display_shell_set_grid_style (GimpDisplayShell *shell,
|
||||||
cairo_t *cr,
|
cairo_t *cr,
|
||||||
@ -49,21 +84,52 @@ gimp_display_shell_set_grid_style (GimpDisplayShell *shell,
|
|||||||
{
|
{
|
||||||
case GIMP_GRID_ON_OFF_DASH:
|
case GIMP_GRID_ON_OFF_DASH:
|
||||||
case GIMP_GRID_DOUBLE_DASH:
|
case GIMP_GRID_DOUBLE_DASH:
|
||||||
|
if (grid->style == GIMP_GRID_DOUBLE_DASH)
|
||||||
{
|
{
|
||||||
|
gimp_display_shell_set_stipple_style (cr,
|
||||||
|
&grid->fgcolor,
|
||||||
|
&grid->bgcolor);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GimpRGB bg = { 0.0, 0.0, 0.0, 0.0 };
|
||||||
|
|
||||||
|
gimp_display_shell_set_stipple_style (cr,
|
||||||
|
&grid->fgcolor,
|
||||||
|
&bg);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case GIMP_GRID_DOTS:
|
||||||
|
case GIMP_GRID_INTERSECTIONS:
|
||||||
|
case GIMP_GRID_SOLID:
|
||||||
|
cairo_set_source_rgb (cr,
|
||||||
|
grid->fgcolor.r,
|
||||||
|
grid->fgcolor.g,
|
||||||
|
grid->fgcolor.b);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* private functions */
|
||||||
|
|
||||||
|
static cairo_user_data_key_t surface_data_key = { 0, };
|
||||||
|
|
||||||
|
static void
|
||||||
|
gimp_display_shell_set_stipple_style (cairo_t *cr,
|
||||||
|
const GimpRGB *fg,
|
||||||
|
const GimpRGB *bg)
|
||||||
|
{
|
||||||
|
cairo_surface_t *surface;
|
||||||
guchar *data = g_malloc0 (8 * 8 * 4);
|
guchar *data = g_malloc0 (8 * 8 * 4);
|
||||||
guchar fg_r, fg_g, fg_b, fg_a;
|
guchar fg_r, fg_g, fg_b, fg_a;
|
||||||
guchar bg_r, bg_g, bg_b, bg_a;
|
guchar bg_r, bg_g, bg_b, bg_a;
|
||||||
gint x, y;
|
gint x, y;
|
||||||
guchar *d;
|
guchar *d;
|
||||||
cairo_surface_t *surface;
|
|
||||||
static cairo_user_data_key_t data_key;
|
|
||||||
|
|
||||||
gimp_rgba_get_uchar (&grid->fgcolor, &fg_r, &fg_g, &fg_b, &fg_a);
|
gimp_rgba_get_uchar (fg, &fg_r, &fg_g, &fg_b, &fg_a);
|
||||||
|
gimp_rgba_get_uchar (bg, &bg_r, &bg_g, &bg_b, &bg_a);
|
||||||
if (grid->style == GIMP_GRID_DOUBLE_DASH)
|
|
||||||
gimp_rgba_get_uchar (&grid->bgcolor, &bg_r, &bg_g, &bg_b, &bg_a);
|
|
||||||
else
|
|
||||||
bg_r = bg_g = bg_b = bg_a = 0;
|
|
||||||
|
|
||||||
d = data;
|
d = data;
|
||||||
|
|
||||||
@ -83,24 +149,11 @@ gimp_display_shell_set_grid_style (GimpDisplayShell *shell,
|
|||||||
surface = cairo_image_surface_create_for_data (data,
|
surface = cairo_image_surface_create_for_data (data,
|
||||||
CAIRO_FORMAT_ARGB32,
|
CAIRO_FORMAT_ARGB32,
|
||||||
8, 8, 8 * 4);
|
8, 8, 8 * 4);
|
||||||
cairo_surface_set_user_data (surface, &data_key,
|
cairo_surface_set_user_data (surface, &surface_data_key,
|
||||||
data, (cairo_destroy_func_t) g_free);
|
data, (cairo_destroy_func_t) g_free);
|
||||||
|
|
||||||
cairo_set_source_surface (cr, surface, 0, 0);
|
cairo_set_source_surface (cr, surface, 0, 0);
|
||||||
cairo_surface_destroy (surface);
|
cairo_surface_destroy (surface);
|
||||||
|
|
||||||
cairo_pattern_set_extend (cairo_get_source (cr),
|
cairo_pattern_set_extend (cairo_get_source (cr), CAIRO_EXTEND_REPEAT);
|
||||||
CAIRO_EXTEND_REPEAT);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case GIMP_GRID_DOTS:
|
|
||||||
case GIMP_GRID_INTERSECTIONS:
|
|
||||||
case GIMP_GRID_SOLID:
|
|
||||||
cairo_set_source_rgb (cr,
|
|
||||||
grid->fgcolor.r,
|
|
||||||
grid->fgcolor.g,
|
|
||||||
grid->fgcolor.b);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,9 @@
|
|||||||
#define __GIMP_DISPLAY_SHELL_STYLE_H__
|
#define __GIMP_DISPLAY_SHELL_STYLE_H__
|
||||||
|
|
||||||
|
|
||||||
|
void gimp_display_shell_set_guide_style (GimpDisplayShell *shell,
|
||||||
|
cairo_t *cr,
|
||||||
|
gboolean active);
|
||||||
void gimp_display_shell_set_grid_style (GimpDisplayShell *shell,
|
void gimp_display_shell_set_grid_style (GimpDisplayShell *shell,
|
||||||
cairo_t *cr,
|
cairo_t *cr,
|
||||||
GimpGrid *grid);
|
GimpGrid *grid);
|
||||||
|
@ -190,12 +190,20 @@ gimp_move_tool_control (GimpTool *tool,
|
|||||||
|
|
||||||
case GIMP_TOOL_ACTION_RESUME:
|
case GIMP_TOOL_ACTION_RESUME:
|
||||||
if (move->guide && gimp_display_shell_get_show_guides (shell))
|
if (move->guide && gimp_display_shell_get_show_guides (shell))
|
||||||
gimp_display_shell_draw_guide (shell, move->guide, NULL, TRUE);
|
{
|
||||||
|
cairo_t *cr = gdk_cairo_create (gtk_widget_get_window (shell->canvas));
|
||||||
|
gimp_display_shell_draw_guide (shell, cr, move->guide, TRUE);
|
||||||
|
cairo_destroy (cr);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GIMP_TOOL_ACTION_HALT:
|
case GIMP_TOOL_ACTION_HALT:
|
||||||
if (move->guide && gimp_display_shell_get_show_guides (shell))
|
if (move->guide && gimp_display_shell_get_show_guides (shell))
|
||||||
gimp_display_shell_draw_guide (shell, move->guide, NULL, FALSE);
|
{
|
||||||
|
cairo_t *cr = gdk_cairo_create (gtk_widget_get_window (shell->canvas));
|
||||||
|
gimp_display_shell_draw_guide (shell, cr, move->guide, FALSE);
|
||||||
|
cairo_destroy (cr);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -446,7 +454,11 @@ gimp_move_tool_button_release (GimpTool *tool,
|
|||||||
gimp_image_flush (image);
|
gimp_image_flush (image);
|
||||||
|
|
||||||
if (move->guide)
|
if (move->guide)
|
||||||
gimp_display_shell_draw_guide (shell, move->guide, NULL, TRUE);
|
{
|
||||||
|
cairo_t *cr = gdk_cairo_create (gtk_widget_get_window (shell->canvas));
|
||||||
|
gimp_display_shell_draw_guide (shell, cr, move->guide, TRUE);
|
||||||
|
cairo_destroy (cr);
|
||||||
|
}
|
||||||
|
|
||||||
move->moving_guide = FALSE;
|
move->moving_guide = FALSE;
|
||||||
move->guide_position = -1;
|
move->guide_position = -1;
|
||||||
@ -667,12 +679,20 @@ gimp_move_tool_oper_update (GimpTool *tool,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (move->guide && move->guide != guide)
|
if (move->guide && move->guide != guide)
|
||||||
gimp_display_shell_draw_guide (shell, move->guide, NULL, FALSE);
|
{
|
||||||
|
cairo_t *cr = gdk_cairo_create (gtk_widget_get_window (shell->canvas));
|
||||||
|
gimp_display_shell_draw_guide (shell, cr, move->guide, FALSE);
|
||||||
|
cairo_destroy (cr);
|
||||||
|
}
|
||||||
|
|
||||||
move->guide = guide;
|
move->guide = guide;
|
||||||
|
|
||||||
if (move->guide)
|
if (move->guide)
|
||||||
gimp_display_shell_draw_guide (shell, move->guide, NULL, TRUE);
|
{
|
||||||
|
cairo_t *cr = gdk_cairo_create (gtk_widget_get_window (shell->canvas));
|
||||||
|
gimp_display_shell_draw_guide (shell, cr, move->guide, TRUE);
|
||||||
|
cairo_destroy (cr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -818,8 +838,12 @@ gimp_move_tool_start_guide (GimpMoveTool *move,
|
|||||||
gimp_tool_control_set_scroll_lock (tool->control, TRUE);
|
gimp_tool_control_set_scroll_lock (tool->control, TRUE);
|
||||||
|
|
||||||
if (move->guide)
|
if (move->guide)
|
||||||
gimp_display_shell_draw_guide (gimp_display_get_shell (display),
|
{
|
||||||
move->guide, NULL, FALSE);
|
GimpDisplayShell *shell = gimp_display_get_shell (display);
|
||||||
|
cairo_t *cr = gdk_cairo_create (gtk_widget_get_window (shell->canvas));
|
||||||
|
gimp_display_shell_draw_guide (shell, cr, move->guide, FALSE);
|
||||||
|
cairo_destroy (cr);
|
||||||
|
}
|
||||||
|
|
||||||
move->guide = NULL;
|
move->guide = NULL;
|
||||||
move->moving_guide = TRUE;
|
move->moving_guide = TRUE;
|
||||||
|
Reference in New Issue
Block a user