[glabels] Tweak rendering of color swatches and font samples.



commit 1990055cc0190e23fc0796ff04c00678b68faba3
Author: Jim Evins <evins snaught com>
Date:   Sat May 29 17:27:46 2010 -0400

    Tweak rendering of color swatches and font samples.

 src/color-swatch.c |    2 +-
 src/font-sample.c  |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/color-swatch.c b/src/color-swatch.c
index b068e6c..19f4ed6 100644
--- a/src/color-swatch.c
+++ b/src/color-swatch.c
@@ -251,7 +251,7 @@ draw_swatch (glColorSwatch *this,
                 line_color = gl_color_from_gdk_color (&style->fg[GTK_STATE_INSENSITIVE]);
         }
 
-        cairo_rectangle( cr, 0, 0, w-1, h-1 );
+        cairo_rectangle( cr, 1, 1, w-2, h-2 );
 
         cairo_set_source_rgba (cr, GL_COLOR_RGBA_ARGS (fill_color));
         cairo_fill_preserve( cr );
diff --git a/src/font-sample.c b/src/font-sample.c
index 4302064..ea1f5b7 100644
--- a/src/font-sample.c
+++ b/src/font-sample.c
@@ -246,7 +246,7 @@ draw_sample (glFontSample *this,
 
         cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE);
 
-        cairo_rectangle( cr, 0, 0, w-1, h-1 );
+        cairo_rectangle( cr, 1, 1, w-2, h-2 );
 
         cairo_set_source_rgba (cr, GL_COLOR_RGBA_ARGS (fill_color));
         cairo_fill_preserve( cr );
@@ -265,7 +265,7 @@ draw_sample (glFontSample *this,
         pango_font_description_set_family (desc, this->priv->font_family);
         pango_font_description_set_weight (desc, PANGO_WEIGHT_NORMAL);
         pango_font_description_set_style  (desc, PANGO_STYLE_NORMAL);
-        pango_font_description_set_size   (desc, 0.6 * h * PANGO_SCALE);
+        pango_font_description_set_size   (desc, 0.6 * (h-1) * PANGO_SCALE);
         
         pango_layout_set_font_description (layout, desc);
         pango_font_description_free       (desc);



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