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:
@ -391,36 +391,6 @@ gimp_display_shell_draw_pen (GimpDisplayShell *shell,
|
|||||||
cairo_stroke (cr);
|
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
|
void
|
||||||
gimp_display_shell_draw_sample_points (GimpDisplayShell *shell,
|
gimp_display_shell_draw_sample_points (GimpDisplayShell *shell,
|
||||||
cairo_t *cr)
|
cairo_t *cr)
|
||||||
@ -434,15 +404,38 @@ gimp_display_shell_draw_sample_points (GimpDisplayShell *shell,
|
|||||||
|
|
||||||
if (image && gimp_display_shell_get_show_sample_points (shell))
|
if (image && gimp_display_shell_get_show_sample_points (shell))
|
||||||
{
|
{
|
||||||
|
GimpCanvasItem *item;
|
||||||
GList *list;
|
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);
|
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, 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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -38,10 +38,6 @@ void gimp_display_shell_draw_pen (GimpDisplayShell *shell,
|
|||||||
GimpContext *context,
|
GimpContext *context,
|
||||||
GimpActiveColor color,
|
GimpActiveColor color,
|
||||||
gint width);
|
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,
|
void gimp_display_shell_draw_sample_points (GimpDisplayShell *shell,
|
||||||
cairo_t *cr);
|
cairo_t *cr);
|
||||||
void gimp_display_shell_draw_layer_boundary (GimpDisplayShell *shell,
|
void gimp_display_shell_draw_layer_boundary (GimpDisplayShell *shell,
|
||||||
|
Reference in New Issue
Block a user