app: port GimpDisplayShell sample point drawing to cairo
Same disclaimer about tool uglyness applies here. Will be fixed.
This commit is contained in:
@ -371,8 +371,6 @@ gimp_canvas_gc_new (GimpCanvas *canvas,
|
|||||||
{
|
{
|
||||||
case GIMP_CANVAS_STYLE_BLACK:
|
case GIMP_CANVAS_STYLE_BLACK:
|
||||||
case GIMP_CANVAS_STYLE_WHITE:
|
case GIMP_CANVAS_STYLE_WHITE:
|
||||||
case GIMP_CANVAS_STYLE_SAMPLE_POINT_NORMAL:
|
|
||||||
case GIMP_CANVAS_STYLE_SAMPLE_POINT_ACTIVE:
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GIMP_CANVAS_STYLE_RENDER:
|
case GIMP_CANVAS_STYLE_RENDER:
|
||||||
@ -489,18 +487,6 @@ gimp_canvas_gc_new (GimpCanvas *canvas,
|
|||||||
bg.green = 0xffff;
|
bg.green = 0xffff;
|
||||||
bg.blue = 0x0;
|
bg.blue = 0x0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GIMP_CANVAS_STYLE_SAMPLE_POINT_NORMAL:
|
|
||||||
fg.red = 0x0;
|
|
||||||
fg.green = 0x7f7f;
|
|
||||||
fg.blue = 0xffff;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case GIMP_CANVAS_STYLE_SAMPLE_POINT_ACTIVE:
|
|
||||||
fg.red = 0xffff;
|
|
||||||
fg.green = 0x0;
|
|
||||||
fg.blue = 0x0;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gdk_gc_set_rgb_fg_color (gc, &fg);
|
gdk_gc_set_rgb_fg_color (gc, &fg);
|
||||||
@ -805,28 +791,24 @@ gimp_canvas_draw_segments (GimpCanvas *canvas,
|
|||||||
/**
|
/**
|
||||||
* gimp_canvas_draw_text:
|
* gimp_canvas_draw_text:
|
||||||
* @canvas: a #GimpCanvas widget
|
* @canvas: a #GimpCanvas widget
|
||||||
* @style: one of the enumerated #GimpCanvasStyle's.
|
|
||||||
* @x: X coordinate of the left of the layout.
|
|
||||||
* @y: Y coordinate of the top of the layout.
|
|
||||||
* @format: a standard printf() format string.
|
* @format: a standard printf() format string.
|
||||||
* @Varargs: the parameters to insert into the format string.
|
* @Varargs: the parameters to insert into the format string.
|
||||||
*
|
*
|
||||||
* Draws a layout, in the specified style.
|
* Returns a layout which can be used for
|
||||||
|
* pango_cairo_show_layout(). The layout belongs to the canvas and
|
||||||
|
* should not be freed, not should a pointer to it be kept around
|
||||||
|
* after drawing.
|
||||||
|
*
|
||||||
|
* Returns: a #PangoLayout owned by the canvas.
|
||||||
**/
|
**/
|
||||||
void
|
PangoLayout *
|
||||||
gimp_canvas_draw_text (GimpCanvas *canvas,
|
gimp_canvas_get_layout (GimpCanvas *canvas,
|
||||||
GimpCanvasStyle style,
|
|
||||||
gint x,
|
|
||||||
gint y,
|
|
||||||
const gchar *format,
|
const gchar *format,
|
||||||
...)
|
...)
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
gchar *text;
|
gchar *text;
|
||||||
|
|
||||||
if (! gimp_canvas_ensure_style (canvas, style))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (! canvas->layout)
|
if (! canvas->layout)
|
||||||
canvas->layout = gtk_widget_create_pango_layout (GTK_WIDGET (canvas),
|
canvas->layout = gtk_widget_create_pango_layout (GTK_WIDGET (canvas),
|
||||||
NULL);
|
NULL);
|
||||||
@ -838,9 +820,7 @@ gimp_canvas_draw_text (GimpCanvas *canvas,
|
|||||||
pango_layout_set_text (canvas->layout, text, -1);
|
pango_layout_set_text (canvas->layout, text, -1);
|
||||||
g_free (text);
|
g_free (text);
|
||||||
|
|
||||||
gdk_draw_layout (gtk_widget_get_window (GTK_WIDGET (canvas)),
|
return canvas->layout;
|
||||||
canvas->gc[style],
|
|
||||||
x, y, canvas->layout);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -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_SAMPLE_POINT_NORMAL,
|
|
||||||
GIMP_CANVAS_STYLE_SAMPLE_POINT_ACTIVE,
|
|
||||||
GIMP_CANVAS_STYLE_LAYER_MASK_ACTIVE,
|
GIMP_CANVAS_STYLE_LAYER_MASK_ACTIVE,
|
||||||
GIMP_CANVAS_STYLE_CUSTOM,
|
GIMP_CANVAS_STYLE_CUSTOM,
|
||||||
GIMP_CANVAS_NUM_STYLES
|
GIMP_CANVAS_NUM_STYLES
|
||||||
@ -134,12 +132,9 @@ void gimp_canvas_draw_segments (GimpCanvas *canvas,
|
|||||||
GimpCanvasStyle style,
|
GimpCanvasStyle style,
|
||||||
GdkSegment *segments,
|
GdkSegment *segments,
|
||||||
gint num_segments);
|
gint num_segments);
|
||||||
void gimp_canvas_draw_text (GimpCanvas *canvas,
|
PangoLayout *gimp_canvas_get_layout (GimpCanvas *canvas,
|
||||||
GimpCanvasStyle style,
|
|
||||||
gint x,
|
|
||||||
gint y,
|
|
||||||
const gchar *format,
|
const gchar *format,
|
||||||
...) G_GNUC_PRINTF (5, 6);
|
...) G_GNUC_PRINTF (2, 3);
|
||||||
void gimp_canvas_draw_rgb (GimpCanvas *canvas,
|
void gimp_canvas_draw_rgb (GimpCanvas *canvas,
|
||||||
GimpCanvasStyle style,
|
GimpCanvasStyle style,
|
||||||
gint x,
|
gint x,
|
||||||
|
@ -2302,7 +2302,9 @@ gimp_display_shell_canvas_expose_image (GimpDisplayShell *shell,
|
|||||||
cairo_restore (cr);
|
cairo_restore (cr);
|
||||||
|
|
||||||
/* draw the sample points */
|
/* draw the sample points */
|
||||||
gimp_display_shell_draw_sample_points (shell, eevent->region);
|
cairo_save (cr);
|
||||||
|
gimp_display_shell_draw_sample_points (shell, cr);
|
||||||
|
cairo_restore (cr);
|
||||||
|
|
||||||
/* and the cursor (if we have a software cursor) */
|
/* and the cursor (if we have a software cursor) */
|
||||||
gimp_display_shell_draw_cursor (shell);
|
gimp_display_shell_draw_cursor (shell);
|
||||||
|
@ -438,18 +438,19 @@ gimp_display_shell_draw_pen (GimpDisplayShell *shell,
|
|||||||
|
|
||||||
void
|
void
|
||||||
gimp_display_shell_draw_sample_point (GimpDisplayShell *shell,
|
gimp_display_shell_draw_sample_point (GimpDisplayShell *shell,
|
||||||
|
cairo_t *cr,
|
||||||
GimpSamplePoint *sample_point,
|
GimpSamplePoint *sample_point,
|
||||||
const GdkRectangle *area,
|
|
||||||
gboolean active)
|
gboolean active)
|
||||||
{
|
{
|
||||||
GimpImage *image;
|
GimpImage *image;
|
||||||
GimpCanvasStyle style;
|
gdouble dx1, dy1, dx2, dy2;
|
||||||
|
gint x1, x2, y1, y2;
|
||||||
|
gint sx1, sx2, sy1, sy2;
|
||||||
gdouble x, y;
|
gdouble x, y;
|
||||||
gint x1, x2;
|
PangoLayout *layout;
|
||||||
gint y1, y2;
|
|
||||||
gint w, h;
|
|
||||||
|
|
||||||
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 (sample_point != NULL);
|
g_return_if_fail (sample_point != NULL);
|
||||||
|
|
||||||
if (sample_point->x < 0)
|
if (sample_point->x < 0)
|
||||||
@ -457,93 +458,82 @@ gimp_display_shell_draw_sample_point (GimpDisplayShell *shell,
|
|||||||
|
|
||||||
image = gimp_display_get_image (shell->display);
|
image = gimp_display_get_image (shell->display);
|
||||||
|
|
||||||
|
cairo_clip_extents (cr, &dx1, &dy1, &dx2, &dy2);
|
||||||
|
|
||||||
|
x1 = floor (dx1);
|
||||||
|
y1 = floor (dy1);
|
||||||
|
x2 = ceil (dx2);
|
||||||
|
y2 = ceil (dy2);
|
||||||
|
|
||||||
gimp_display_shell_transform_xy_f (shell,
|
gimp_display_shell_transform_xy_f (shell,
|
||||||
sample_point->x + 0.5,
|
sample_point->x + 0.5,
|
||||||
sample_point->y + 0.5,
|
sample_point->y + 0.5,
|
||||||
&x, &y, FALSE);
|
&x, &y, FALSE);
|
||||||
|
|
||||||
x1 = floor (x - GIMP_SAMPLE_POINT_DRAW_SIZE);
|
sx1 = floor (x - GIMP_SAMPLE_POINT_DRAW_SIZE);
|
||||||
x2 = ceil (x + GIMP_SAMPLE_POINT_DRAW_SIZE);
|
sx2 = ceil (x + GIMP_SAMPLE_POINT_DRAW_SIZE);
|
||||||
y1 = floor (y - GIMP_SAMPLE_POINT_DRAW_SIZE);
|
sy1 = floor (y - GIMP_SAMPLE_POINT_DRAW_SIZE);
|
||||||
y2 = ceil (y + GIMP_SAMPLE_POINT_DRAW_SIZE);
|
sy2 = ceil (y + GIMP_SAMPLE_POINT_DRAW_SIZE);
|
||||||
|
|
||||||
gdk_drawable_get_size (gtk_widget_get_window (shell->canvas), &w, &h);
|
if (sx1 > x2 ||
|
||||||
|
sx2 < x1 ||
|
||||||
if (x < - GIMP_SAMPLE_POINT_DRAW_SIZE ||
|
sy1 > y2 ||
|
||||||
y < - GIMP_SAMPLE_POINT_DRAW_SIZE ||
|
sy2 < y1)
|
||||||
x > w + GIMP_SAMPLE_POINT_DRAW_SIZE ||
|
|
||||||
y > h + GIMP_SAMPLE_POINT_DRAW_SIZE)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (area && (x + GIMP_SAMPLE_POINT_DRAW_SIZE < area->x ||
|
gimp_display_shell_set_sample_point_style (shell, cr, active);
|
||||||
y + GIMP_SAMPLE_POINT_DRAW_SIZE < area->y ||
|
|
||||||
x - GIMP_SAMPLE_POINT_DRAW_SIZE >= area->x + area->width ||
|
|
||||||
y - GIMP_SAMPLE_POINT_DRAW_SIZE >= area->y + area->height))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (active)
|
|
||||||
style = GIMP_CANVAS_STYLE_SAMPLE_POINT_ACTIVE;
|
|
||||||
else
|
|
||||||
style = GIMP_CANVAS_STYLE_SAMPLE_POINT_NORMAL;
|
|
||||||
|
|
||||||
#define HALF_SIZE (GIMP_SAMPLE_POINT_DRAW_SIZE / 2)
|
#define HALF_SIZE (GIMP_SAMPLE_POINT_DRAW_SIZE / 2)
|
||||||
|
|
||||||
gimp_canvas_draw_line (GIMP_CANVAS (shell->canvas), style,
|
cairo_move_to (cr, x + 0.5, sy1);
|
||||||
x, y1, x, y1 + HALF_SIZE);
|
cairo_line_to (cr, x + 0.5, sy1 + HALF_SIZE);
|
||||||
gimp_canvas_draw_line (GIMP_CANVAS (shell->canvas), style,
|
|
||||||
x, y2 - HALF_SIZE, x, y2);
|
|
||||||
|
|
||||||
gimp_canvas_draw_line (GIMP_CANVAS (shell->canvas), style,
|
cairo_move_to (cr, x + 0.5, sy2);
|
||||||
x1, y, x1 + HALF_SIZE, y);
|
cairo_line_to (cr, x + 0.5, sy2 - HALF_SIZE);
|
||||||
gimp_canvas_draw_line (GIMP_CANVAS (shell->canvas), style,
|
|
||||||
x2 - HALF_SIZE, y, x2, y);
|
|
||||||
|
|
||||||
gimp_canvas_draw_arc (GIMP_CANVAS (shell->canvas), style,
|
cairo_move_to (cr, sx1, y + 0.5);
|
||||||
FALSE,
|
cairo_line_to (cr, sx1 + HALF_SIZE, y + 0.5);
|
||||||
x - HALF_SIZE, y - HALF_SIZE,
|
|
||||||
GIMP_SAMPLE_POINT_DRAW_SIZE,
|
|
||||||
GIMP_SAMPLE_POINT_DRAW_SIZE,
|
|
||||||
0, 64 * 270);
|
|
||||||
|
|
||||||
gimp_canvas_draw_text (GIMP_CANVAS (shell->canvas), style,
|
cairo_move_to (cr, sx2, y + 0.5);
|
||||||
x + 2, y + 2,
|
cairo_line_to (cr, sx2 - HALF_SIZE, y + 0.5);
|
||||||
|
|
||||||
|
cairo_arc_negative (cr, x + 0.5, y + 0.5, HALF_SIZE, 0.0, 0.5 * G_PI);
|
||||||
|
|
||||||
|
cairo_stroke (cr);
|
||||||
|
|
||||||
|
layout =
|
||||||
|
gimp_canvas_get_layout (GIMP_CANVAS (shell->canvas),
|
||||||
"%d",
|
"%d",
|
||||||
g_list_index (gimp_image_get_sample_points (image),
|
g_list_index (gimp_image_get_sample_points (image),
|
||||||
sample_point) + 1);
|
sample_point) + 1);
|
||||||
|
|
||||||
|
cairo_move_to (cr, x + 2, y + 2);
|
||||||
|
pango_cairo_show_layout (cr, layout);
|
||||||
|
|
||||||
|
cairo_fill (cr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gimp_display_shell_draw_sample_points (GimpDisplayShell *shell,
|
gimp_display_shell_draw_sample_points (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_sample_points (shell))
|
if (image && gimp_display_shell_get_show_sample_points (shell))
|
||||||
{
|
{
|
||||||
GdkRectangle area;
|
|
||||||
GList *list;
|
GList *list;
|
||||||
|
|
||||||
gimp_canvas_set_clip_region (GIMP_CANVAS (shell->canvas),
|
|
||||||
GIMP_CANVAS_STYLE_SAMPLE_POINT_NORMAL,
|
|
||||||
region);
|
|
||||||
gdk_region_get_clipbox (region, &area);
|
|
||||||
|
|
||||||
for (list = gimp_image_get_sample_points (image);
|
for (list = gimp_image_get_sample_points (image);
|
||||||
list;
|
list;
|
||||||
list = g_list_next (list))
|
list = g_list_next (list))
|
||||||
{
|
{
|
||||||
gimp_display_shell_draw_sample_point (shell, list->data,
|
gimp_display_shell_draw_sample_point (shell, cr, list->data, FALSE);
|
||||||
&area, FALSE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gimp_canvas_set_clip_region (GIMP_CANVAS (shell->canvas),
|
|
||||||
GIMP_CANVAS_STYLE_SAMPLE_POINT_NORMAL,
|
|
||||||
NULL);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,11 +42,11 @@ void gimp_display_shell_draw_pen (GimpDisplayShell *shell,
|
|||||||
GimpActiveColor color,
|
GimpActiveColor color,
|
||||||
gint width);
|
gint width);
|
||||||
void gimp_display_shell_draw_sample_point (GimpDisplayShell *shell,
|
void gimp_display_shell_draw_sample_point (GimpDisplayShell *shell,
|
||||||
|
cairo_t *cr,
|
||||||
GimpSamplePoint *sample_point,
|
GimpSamplePoint *sample_point,
|
||||||
const GdkRectangle *area,
|
|
||||||
gboolean active);
|
gboolean active);
|
||||||
void gimp_display_shell_draw_sample_points (GimpDisplayShell *shell,
|
void gimp_display_shell_draw_sample_points (GimpDisplayShell *shell,
|
||||||
const GdkRegion *region);
|
cairo_t *cr);
|
||||||
void gimp_display_shell_draw_vector (GimpDisplayShell *shell,
|
void gimp_display_shell_draw_vector (GimpDisplayShell *shell,
|
||||||
GimpVectors *vectors);
|
GimpVectors *vectors);
|
||||||
void gimp_display_shell_draw_vectors (GimpDisplayShell *shell);
|
void gimp_display_shell_draw_vectors (GimpDisplayShell *shell);
|
||||||
|
@ -39,6 +39,9 @@ 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_fg = { 0.0, 0.0, 0.0, 1.0 };
|
||||||
static const GimpRGB guide_active_bg = { 1.0, 0.0, 0.0, 1.0 };
|
static const GimpRGB guide_active_bg = { 1.0, 0.0, 0.0, 1.0 };
|
||||||
|
|
||||||
|
static const GimpRGB sample_point_normal = { 0.0, 0.5, 1.0, 1.0 };
|
||||||
|
static const GimpRGB sample_point_active = { 1.0, 0.0, 0.0, 1.0 };
|
||||||
|
|
||||||
|
|
||||||
/* local function prototypes */
|
/* local function prototypes */
|
||||||
|
|
||||||
@ -69,6 +72,28 @@ gimp_display_shell_set_guide_style (GimpDisplayShell *shell,
|
|||||||
&guide_normal_bg);
|
&guide_normal_bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gimp_display_shell_set_sample_point_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)
|
||||||
|
cairo_set_source_rgb (cr,
|
||||||
|
sample_point_active.r,
|
||||||
|
sample_point_active.g,
|
||||||
|
sample_point_active.b);
|
||||||
|
else
|
||||||
|
cairo_set_source_rgb (cr,
|
||||||
|
sample_point_normal.r,
|
||||||
|
sample_point_normal.g,
|
||||||
|
sample_point_normal.b);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gimp_display_shell_set_grid_style (GimpDisplayShell *shell,
|
gimp_display_shell_set_grid_style (GimpDisplayShell *shell,
|
||||||
cairo_t *cr,
|
cairo_t *cr,
|
||||||
|
@ -25,6 +25,9 @@
|
|||||||
void gimp_display_shell_set_guide_style (GimpDisplayShell *shell,
|
void gimp_display_shell_set_guide_style (GimpDisplayShell *shell,
|
||||||
cairo_t *cr,
|
cairo_t *cr,
|
||||||
gboolean active);
|
gboolean active);
|
||||||
|
void gimp_display_shell_set_sample_point_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);
|
||||||
|
@ -210,15 +210,23 @@ gimp_color_tool_control (GimpTool *tool,
|
|||||||
case GIMP_TOOL_ACTION_RESUME:
|
case GIMP_TOOL_ACTION_RESUME:
|
||||||
if (color_tool->sample_point &&
|
if (color_tool->sample_point &&
|
||||||
gimp_display_shell_get_show_sample_points (shell))
|
gimp_display_shell_get_show_sample_points (shell))
|
||||||
gimp_display_shell_draw_sample_point (shell, color_tool->sample_point,
|
{
|
||||||
NULL, TRUE);
|
cairo_t *cr = gdk_cairo_create (gtk_widget_get_window (shell->canvas));
|
||||||
|
gimp_display_shell_draw_sample_point (shell, cr,
|
||||||
|
color_tool->sample_point, TRUE);
|
||||||
|
cairo_destroy (cr);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GIMP_TOOL_ACTION_HALT:
|
case GIMP_TOOL_ACTION_HALT:
|
||||||
if (color_tool->sample_point &&
|
if (color_tool->sample_point &&
|
||||||
gimp_display_shell_get_show_sample_points (shell))
|
gimp_display_shell_get_show_sample_points (shell))
|
||||||
gimp_display_shell_draw_sample_point (shell, color_tool->sample_point,
|
{
|
||||||
NULL, FALSE);
|
cairo_t *cr = gdk_cairo_create (gtk_widget_get_window (shell->canvas));
|
||||||
|
gimp_display_shell_draw_sample_point (shell, cr,
|
||||||
|
color_tool->sample_point, FALSE);
|
||||||
|
cairo_destroy (cr);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -356,8 +364,12 @@ gimp_color_tool_button_release (GimpTool *tool,
|
|||||||
gimp_image_flush (image);
|
gimp_image_flush (image);
|
||||||
|
|
||||||
if (color_tool->sample_point)
|
if (color_tool->sample_point)
|
||||||
gimp_display_shell_draw_sample_point (shell, color_tool->sample_point,
|
{
|
||||||
NULL, TRUE);
|
cairo_t *cr = gdk_cairo_create (gtk_widget_get_window (shell->canvas));
|
||||||
|
gimp_display_shell_draw_sample_point (shell, cr,
|
||||||
|
color_tool->sample_point, TRUE);
|
||||||
|
cairo_destroy (cr);
|
||||||
|
}
|
||||||
|
|
||||||
color_tool->moving_sample_point = FALSE;
|
color_tool->moving_sample_point = FALSE;
|
||||||
color_tool->sample_point_x = -1;
|
color_tool->sample_point_x = -1;
|
||||||
@ -496,8 +508,12 @@ gimp_color_tool_oper_update (GimpTool *tool,
|
|||||||
color_tool->sample_point = sample_point;
|
color_tool->sample_point = sample_point;
|
||||||
|
|
||||||
if (color_tool->sample_point)
|
if (color_tool->sample_point)
|
||||||
gimp_display_shell_draw_sample_point (shell, color_tool->sample_point,
|
{
|
||||||
NULL, TRUE);
|
cairo_t *cr = gdk_cairo_create (gtk_widget_get_window (shell->canvas));
|
||||||
|
gimp_display_shell_draw_sample_point (shell, cr,
|
||||||
|
color_tool->sample_point, TRUE);
|
||||||
|
cairo_destroy (cr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -823,9 +839,13 @@ gimp_color_tool_start_sample_point (GimpTool *tool,
|
|||||||
gimp_tool_control_set_scroll_lock (tool->control, TRUE);
|
gimp_tool_control_set_scroll_lock (tool->control, TRUE);
|
||||||
|
|
||||||
if (color_tool->sample_point)
|
if (color_tool->sample_point)
|
||||||
gimp_display_shell_draw_sample_point (gimp_display_get_shell (display),
|
{
|
||||||
color_tool->sample_point,
|
GimpDisplayShell *shell = gimp_display_get_shell (display);
|
||||||
NULL, FALSE);
|
cairo_t *cr = gdk_cairo_create (gtk_widget_get_window (shell->canvas));
|
||||||
|
gimp_display_shell_draw_sample_point (shell, cr,
|
||||||
|
color_tool->sample_point, FALSE);
|
||||||
|
cairo_destroy (cr);
|
||||||
|
}
|
||||||
|
|
||||||
color_tool->sample_point = NULL;
|
color_tool->sample_point = NULL;
|
||||||
color_tool->moving_sample_point = TRUE;
|
color_tool->moving_sample_point = TRUE;
|
||||||
|
Reference in New Issue
Block a user