[gimp] app: improve drawing of sample points so they are always visible



commit 01e5a6b1334f9ed22f52a738d027f2ef56c90a0c
Author: Michael Natterer <mitch gimp org>
Date:   Thu Apr 19 16:20:41 2018 +0200

    app: improve drawing of sample points so they are always visible
    
    Draw them a bit brighter and larger, and with a dark shadow like tool
    lines so they are visible on all backgrounds.

 app/display/gimpcanvas-style.c      |    4 ++--
 app/display/gimpcanvassamplepoint.c |   13 ++++++++-----
 2 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/app/display/gimpcanvas-style.c b/app/display/gimpcanvas-style.c
index b902f5e..de19f21 100644
--- a/app/display/gimpcanvas-style.c
+++ b/app/display/gimpcanvas-style.c
@@ -36,7 +36,7 @@
 
 /* Styles for common and custom guides. */
 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_normal_bg         = { 0.0, 0.8, 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 };
 
@@ -56,7 +56,7 @@ static const GimpRGB guide_split_active_fg   = { 1.0, 0.0, 1.0, 1.0 };
 static const GimpRGB guide_split_active_bg   = { 1.0, 0.0, 0.0, 1.0 };
 
 /* Styles for other canvas items. */
-static const GimpRGB sample_point_normal = { 0.0, 0.5, 1.0, 1.0 };
+static const GimpRGB sample_point_normal = { 0.0, 0.8, 1.0, 1.0 };
 static const GimpRGB sample_point_active = { 1.0, 0.0, 0.0, 1.0 };
 
 static const GimpRGB layer_fg            = { 0.0, 0.0, 0.0, 1.0 };
diff --git a/app/display/gimpcanvassamplepoint.c b/app/display/gimpcanvassamplepoint.c
index f900ccb..fa314bb 100644
--- a/app/display/gimpcanvassamplepoint.c
+++ b/app/display/gimpcanvassamplepoint.c
@@ -34,7 +34,7 @@
 #include "gimpdisplayshell.h"
 
 
-#define GIMP_SAMPLE_POINT_DRAW_SIZE 10
+#define GIMP_SAMPLE_POINT_DRAW_SIZE 14
 
 
 enum
@@ -245,10 +245,10 @@ gimp_canvas_sample_point_draw (GimpCanvasItem *item,
   layout = gimp_canvas_get_layout (GIMP_CANVAS (canvas),
                                    "%d", private->index);
 
-  cairo_move_to (cr, x + 2.5, y + 2.5);
+  cairo_move_to (cr, x + 3, y + 3);
   pango_cairo_show_layout (cr, layout);
 
-  _gimp_canvas_item_fill (item, cr);
+  _gimp_canvas_item_stroke (item, cr);
 }
 
 static cairo_region_t *
@@ -274,8 +274,8 @@ gimp_canvas_sample_point_get_extents (GimpCanvasItem *item)
 
   pango_layout_get_extents (layout, &ink, NULL);
 
-  x2 = MAX (x2, 2.5 + ink.width);
-  y2 = MAX (y2, 2.5 + ink.height);
+  x2 = MAX (x2, 3 + ink.width);
+  y2 = MAX (y2, 3 + ink.height);
 
   rectangle.x      = x1 - 1.5;
   rectangle.y      = y1 - 1.5;
@@ -293,6 +293,9 @@ gimp_canvas_sample_point_stroke (GimpCanvasItem *item,
 
   if (private->sample_point_style)
     {
+      gimp_canvas_set_tool_bg_style (gimp_canvas_item_get_canvas (item), cr);
+      cairo_stroke_preserve (cr);
+
       gimp_canvas_set_sample_point_style (gimp_canvas_item_get_canvas (item), cr,
                                           gimp_canvas_item_get_highlight (item));
       cairo_stroke (cr);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]