mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-03 17:21:11 +00:00
themingengine: move code to make switch-case more clear
Code is more readable with the default case as the last one in the switch block.
This commit is contained in:
parent
03217c2019
commit
41b56d87e7
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user