[gimp/metadata-browser] gfig: draw rectangular grid on whole pixels, set correct defaults in combo boxes.



commit 059a74da824b01460f31ce83b47a951c71269c88
Author: Mikael Magnusson <mikachu src gnome org>
Date:   Wed Feb 15 20:23:35 2012 +0100

    gfig: draw rectangular grid on whole pixels, set correct defaults in combo boxes.

 plug-ins/gfig/gfig-dialog.c |    6 +++---
 plug-ins/gfig/gfig-grid.c   |   10 +++++-----
 2 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/plug-ins/gfig/gfig-dialog.c b/plug-ins/gfig/gfig-dialog.c
index 757cf68..6924f32 100644
--- a/plug-ins/gfig/gfig-dialog.c
+++ b/plug-ins/gfig/gfig-dialog.c
@@ -1323,7 +1323,7 @@ gfig_prefs_action_callback (GtkAction *widget,
                                              _("White"),       LAYER_WHITE_BG,
                                              _("Copy"),        LAYER_COPY_BG,
                                              NULL);
-      gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (page_menu_bg), 0);
+      gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (page_menu_bg), selvals.onlayerbg);
 
       g_signal_connect (page_menu_bg, "changed",
                         G_CALLBACK (paint_combo_callback),
@@ -1479,7 +1479,7 @@ gfig_grid_action_callback (GtkAction *action,
                                       _("Polar"),     POLAR_GRID,
                                       _("Isometric"), ISO_GRID,
                                       NULL);
-      gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (combo), 0);
+      gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (combo), selvals.opts.gridtype);
 
       g_signal_connect (combo, "changed",
                         G_CALLBACK (gridtype_combo_callback),
@@ -1501,7 +1501,7 @@ gfig_grid_action_callback (GtkAction *action,
                                       _("Lighter"),   GFIG_LIGHTER_GC,
                                       _("Very dark"), GFIG_VERY_DARK_GC,
                                       NULL);
-      gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (combo), 0);
+      gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (combo), grid_gc_type);
 
       g_signal_connect (combo, "changed",
                         G_CALLBACK (gridtype_combo_callback),
diff --git a/plug-ins/gfig/gfig-grid.c b/plug-ins/gfig/gfig-grid.c
index 8f9605c..a9ed1fb 100644
--- a/plug-ins/gfig/gfig-grid.c
+++ b/plug-ins/gfig/gfig-grid.c
@@ -41,7 +41,7 @@
 #define TAN_1o6PI_RAD 1 / SQRT3        /* Tangent 1/6 Pi Radians == SIN / COS */
 #define RECIP_TAN_1o6PI_RAD SQRT3      /* Reciprocal of Tangent 1/6 Pi Radians */
 
-gint           grid_gc_type           = GTK_STATE_NORMAL;
+gint           grid_gc_type           = GFIG_NORMAL_GC;
 
 static void    draw_grid_polar     (cairo_t  *drawgc);
 static void    draw_grid_sq        (cairo_t  *drawgc);
@@ -415,16 +415,16 @@ draw_grid_sq (cairo_t *cr)
 
   for (loop = 0 ; loop < preview_height ; loop += step)
     {
-      cairo_move_to (cr, 0, loop);
-      cairo_line_to (cr, preview_width, loop);
+      cairo_move_to (cr, 0 + .5, loop + .5);
+      cairo_line_to (cr, preview_width + .5, loop + .5);
     }
 
   /* Draw the vertical lines */
 
   for (loop = 0 ; loop < preview_width ; loop += step)
     {
-      cairo_move_to (cr, loop, 0);
-      cairo_line_to (cr, loop, preview_height);
+      cairo_move_to (cr, loop + .5, 0 + .5);
+      cairo_line_to (cr, loop + .5, preview_height + .5);
     }
   cairo_stroke (cr);
 }



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