Code

init matrix variable, removes compiler warnings
[inkscape.git] / src / widgets / icon.cpp
index 61c6429895e49a938b328569fe993534a8a06617..cab03fa503890783235b81d0a94d76c724bef1b8 100644 (file)
@@ -370,8 +370,8 @@ static void injectCustomSize()
         gint width = 0;
         gint height = 0;
         if ( gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &width, &height ) ) {
-            gint newWidth = (width > 18) ? (width / 2) : ((width * 2) / 3);
-            gint newHeight = (height > 18) ? (height / 2) : ((height * 2) / 3);
+            gint newWidth = ((width * 3) / 4);
+            gint newHeight = ((height * 3) / 4);
             GtkIconSize newSizeEnum = gtk_icon_size_register( "inkscape-decoration", newWidth, newHeight );
             if ( newSizeEnum ) {
                 if ( dump ) {
@@ -415,7 +415,8 @@ static int sp_icon_get_phys_size(int size)
                 GTK_ICON_SIZE_MENU
         };
         for (unsigned i = 0; i < G_N_ELEMENTS(gtkSizes) && init; ++i) {
-            unsigned const val_ix(gtkSizes[i]);
+            guint const val_ix = (gtkSizes[i] <= GTK_ICON_SIZE_DIALOG) ? (guint)gtkSizes[i] : (guint)Inkscape::ICON_SIZE_DECORATION;
+
             g_assert( val_ix < G_N_ELEMENTS(vals) );
 
             gint width = 0;
@@ -459,7 +460,8 @@ static int sp_icon_get_phys_size(int size)
         GtkWidget *icon = (GtkWidget *)g_object_new(SP_TYPE_ICON, NULL);
 
         for (unsigned i = 0; i < G_N_ELEMENTS(gtkSizes); ++i) {
-            unsigned const val_ix(gtkSizes[i]);
+            guint const val_ix = (gtkSizes[i] <= GTK_ICON_SIZE_DIALOG) ? (guint)gtkSizes[i] : (guint)Inkscape::ICON_SIZE_DECORATION;
+
             g_assert( val_ix < G_N_ELEMENTS(vals) );
 
             gint width = 0;