]> Pileus Git - ~andy/gtk/commitdiff
themingengine: move code to make switch-case more clear
authorCosimo Cecchi <cosimoc@gnome.org>
Mon, 28 Nov 2011 22:33:19 +0000 (17:33 -0500)
committerCosimo Cecchi <cosimoc@gnome.org>
Tue, 29 Nov 2011 15:52:02 +0000 (10:52 -0500)
Code is more readable with the default case as the last one in the
switch block.

gtk/gtkthemingengine.c

index 27740515c65a3ce2e548b5d3752cb3dee2ac057e..b861f91a78302ff56c802c2e75815a4e695cbd83 100644 (file)
@@ -1478,6 +1478,12 @@ render_background_internal (GtkThemingEngine *engine,
     bg_width = width;
     bg_height = height;
     break;
+  case GTK_CSS_AREA_CONTENT_BOX:
+    bg_x = border.left + padding.left;
+    bg_y = border.top + padding.top;
+    bg_width = width - border.left - border.right - padding.left - padding.right;
+    bg_height = height - border.top - border.bottom - padding.top - padding.bottom;
+    break;
   case GTK_CSS_AREA_PADDING_BOX:
   default:
     bg_x = border.left;
@@ -1485,12 +1491,6 @@ render_background_internal (GtkThemingEngine *engine,
     bg_width = width - border.left - border.left;
     bg_height = height - border.top - border.bottom;
     break;
-  case GTK_CSS_AREA_CONTENT_BOX:
-    bg_x = border.left + padding.left;
-    bg_y = border.top + padding.top;
-    bg_width = width - border.left - border.right - padding.left - padding.right;
-    bg_height = height - border.top - border.bottom - padding.top - padding.bottom;
-    break;
   }
 
   context.width = bg_width;