[gimp] libgimpwidgets: draw GimpColorArea's border on top of the oog indicator
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] libgimpwidgets: draw GimpColorArea's border on top of the oog indicator
- Date: Fri, 19 May 2017 09:56:41 +0000 (UTC)
commit 331fc27f11048c8f44ff1fc6f5fa829962c0188b
Author: Michael Natterer <mitch gimp org>
Date: Fri May 19 11:54:59 2017 +0200
libgimpwidgets: draw GimpColorArea's border on top of the oog indicator
and reduce the indicator to 2/3 of the area's shorter side.
libgimpwidgets/gimpcolorarea.c | 33 +++++++++++++++------------------
1 files changed, 15 insertions(+), 18 deletions(-)
---
diff --git a/libgimpwidgets/gimpcolorarea.c b/libgimpwidgets/gimpcolorarea.c
index a1adae8..63fd8f8 100644
--- a/libgimpwidgets/gimpcolorarea.c
+++ b/libgimpwidgets/gimpcolorarea.c
@@ -436,37 +436,34 @@ gimp_color_area_expose (GtkWidget *widget,
cairo_set_source_surface (cr, buffer, 0.0, 0.0);
cairo_surface_destroy (buffer);
-
cairo_paint (cr);
- if (area->draw_border)
- {
- cairo_set_line_width (cr, 1.0);
- gdk_cairo_set_source_color (cr,
- &style->fg[gtk_widget_get_state (widget)]);
-
- cairo_rectangle (cr, 0.5, 0.5, area->width - 1, area->height - 1);
-
- cairo_stroke (cr);
- }
-
if (priv->config &&
(area->color.r < 0.0 || area->color.r > 1.0 ||
area->color.g < 0.0 || area->color.g > 1.0 ||
area->color.b < 0.0 || area->color.b > 1.0))
{
+ gint side = MIN (area->width, area->height) * 2 / 3;
+
cairo_move_to (cr, area->width, 0);
- cairo_line_to (cr, area->width - MIN (area->width, area->height), 0);
- cairo_line_to (cr, area->width, MIN (area->width, area->height));
+ cairo_line_to (cr, area->width - side, 0);
+ cairo_line_to (cr, area->width, side);
cairo_line_to (cr, area->width, 0);
- cairo_set_source_rgb (cr,
- priv->config->out_of_gamut_color.r,
- priv->config->out_of_gamut_color.g,
- priv->config->out_of_gamut_color.b);
+ gimp_cairo_set_source_rgb (cr, &priv->config->out_of_gamut_color);
cairo_fill (cr);
}
+ if (area->draw_border)
+ {
+ cairo_set_line_width (cr, 1.0);
+ gdk_cairo_set_source_color (cr,
+ &style->fg[gtk_widget_get_state (widget)]);
+
+ cairo_rectangle (cr, 0.5, 0.5, area->width - 1, area->height - 1);
+ cairo_stroke (cr);
+ }
+
cairo_destroy (cr);
return FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]