[gimp] app: base the line width defaults for strokes on the screen resolution.



commit 4beff2fa6098f10fcbac630bde72b0824010878a
Author: Jehan <jehan girinstud io>
Date:   Thu Mar 23 01:43:49 2017 +0100

    app: base the line width defaults for strokes on the screen resolution.
    
    This value could be based on either the x or y resolution, or maybe some
    kind of mean values. It could also be based off the print resolution of
    any image (if the user sets a physical dimension, the actual pixel width
    will vary depending on the print resolution). There is no actual "good"
    answer here. But any of these values will be better than a default 96.0.

 app/dialogs/preferences-dialog.c |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)
---
diff --git a/app/dialogs/preferences-dialog.c b/app/dialogs/preferences-dialog.c
index 105ceba..dd1e3e1 100644
--- a/app/dialogs/preferences-dialog.c
+++ b/app/dialogs/preferences-dialog.c
@@ -978,6 +978,8 @@ prefs_dialog_new (Gimp       *gimp,
   GtkWidget         *calibrate_button;
   GSList            *group;
   GtkWidget         *editor;
+  gdouble            xres;
+  gdouble            yres;
   gint               i;
 
   GObject           *object;
@@ -991,6 +993,10 @@ prefs_dialog_new (Gimp       *gimp,
   core_config    = GIMP_CORE_CONFIG (config);
   display_config = GIMP_DISPLAY_CONFIG (config);
 
+  gimp_get_monitor_resolution (gdk_screen_get_default (), /* FIXME monitor */
+                               0, /* FIXME monitor */
+                               &xres, &yres);
+
   dialog = gimp_dialog_new (_("Preferences"), "gimp-preferences",
                             NULL, 0,
                             prefs_help_func,
@@ -2114,8 +2120,12 @@ prefs_dialog_new (Gimp       *gimp,
   vbox2 = prefs_frame_new (_("Stroke Selection & Stroke Path Dialogs"),
                            GTK_CONTAINER (vbox), FALSE);
 
+  /* The stroke line width physical values could be based on either the
+   * x or y resolution, some average, or whatever which makes a bit of
+   * sense. There is no perfect answer. So let's just use whatever.
+   */
   table = gimp_stroke_editor_new (GIMP_DIALOG_CONFIG (object)->stroke_options,
-                                  96.0 /* FIXME */, FALSE);
+                                  yres, FALSE);
   gtk_box_pack_start (GTK_BOX (vbox2), table, FALSE, FALSE, 0);
   gtk_widget_show (table);
 
@@ -2287,13 +2297,8 @@ prefs_dialog_new (Gimp       *gimp,
   group = NULL;
 
   {
-    gdouble  xres, yres;
     gchar   *str;
 
-    gimp_get_monitor_resolution (gdk_screen_get_default (), /* FIXME monitor */
-                                 0, /* FIXME monitor */
-                                 &xres, &yres);
-
     str = g_strdup_printf (_("_Detect automatically (currently %d × %d ppi)"),
                            ROUND (xres), ROUND (yres));
 


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