mirror of https://github.com/GNOME/gimp.git
app: remove gimp_display_shell_draw_sample_point()
and draw all sample points in gimp_display_shell_draw_sample_points().
This commit is contained in:
parent
f5750647c1
commit
cbd1d8cd51
|
@ -391,36 +391,6 @@ gimp_display_shell_draw_pen (GimpDisplayShell *shell,
|
|||
cairo_stroke (cr);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_display_shell_draw_sample_point (GimpDisplayShell *shell,
|
||||
cairo_t *cr,
|
||||
GimpSamplePoint *sample_point,
|
||||
gboolean active)
|
||||
{
|
||||
GimpCanvasItem *item;
|
||||
GimpImage *image;
|
||||
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
g_return_if_fail (cr != NULL);
|
||||
g_return_if_fail (sample_point != NULL);
|
||||
|
||||
if (sample_point->x < 0)
|
||||
return;
|
||||
|
||||
image = gimp_display_get_image (shell->display);
|
||||
|
||||
item = gimp_canvas_sample_point_new (sample_point->x,
|
||||
sample_point->y,
|
||||
g_list_index (gimp_image_get_sample_points (image),
|
||||
sample_point) + 1);
|
||||
g_object_set (item, "sample-point-style", TRUE, NULL);
|
||||
gimp_canvas_item_set_highlight (item, active);
|
||||
|
||||
gimp_canvas_item_draw (item, shell, cr);
|
||||
|
||||
g_object_unref (item);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_display_shell_draw_sample_points (GimpDisplayShell *shell,
|
||||
cairo_t *cr)
|
||||
|
@ -434,14 +404,37 @@ gimp_display_shell_draw_sample_points (GimpDisplayShell *shell,
|
|||
|
||||
if (image && gimp_display_shell_get_show_sample_points (shell))
|
||||
{
|
||||
GList *list;
|
||||
GimpCanvasItem *item;
|
||||
GList *list;
|
||||
|
||||
item = gimp_canvas_sample_point_new (0, 0, 0);
|
||||
g_object_set (item, "sample-point-style", TRUE, NULL);
|
||||
|
||||
for (list = gimp_image_get_sample_points (image);
|
||||
list;
|
||||
list = g_list_next (list))
|
||||
{
|
||||
gimp_display_shell_draw_sample_point (shell, cr, list->data, FALSE);
|
||||
GimpSamplePoint *sample_point = list->data;
|
||||
|
||||
if (sample_point->x >= 0 &&
|
||||
sample_point->y >= 0)
|
||||
{
|
||||
gint index;
|
||||
|
||||
index = g_list_index (gimp_image_get_sample_points (image),
|
||||
sample_point) + 1;
|
||||
|
||||
g_object_set (item,
|
||||
"x", sample_point->x,
|
||||
"y", sample_point->y,
|
||||
"index", index,
|
||||
NULL);
|
||||
|
||||
gimp_canvas_item_draw (item, shell, cr);
|
||||
}
|
||||
}
|
||||
|
||||
g_object_unref (item);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -38,10 +38,6 @@ void gimp_display_shell_draw_pen (GimpDisplayShell *shell,
|
|||
GimpContext *context,
|
||||
GimpActiveColor color,
|
||||
gint width);
|
||||
void gimp_display_shell_draw_sample_point (GimpDisplayShell *shell,
|
||||
cairo_t *cr,
|
||||
GimpSamplePoint *sample_point,
|
||||
gboolean active);
|
||||
void gimp_display_shell_draw_sample_points (GimpDisplayShell *shell,
|
||||
cairo_t *cr);
|
||||
void gimp_display_shell_draw_layer_boundary (GimpDisplayShell *shell,
|
||||
|
|
Loading…
Reference in New Issue