summaryrefslogtreecommitdiff
path: root/src/ui/theme.c
diff options
context:
space:
mode:
authorEgmont Koblinger <egmont@gmail.com>2018-03-01 17:08:41 +0100
committerFlorian Müllner <fmuellner@gnome.org>2018-03-02 16:45:46 +0100
commit7d3cf46839fa09c55baac67c5526dccd5bec3c4c (patch)
tree0f4c9bd9b1e50bd17dfae256b2e04943f9142df5 /src/ui/theme.c
parent6e125d9d0481c4dcb2cdc3a0fef9f84e4c046ecb (diff)
downloadmutter-7d3cf46839fa09c55baac67c5526dccd5bec3c4c.tar.gz
theme: Fix icon scaling23-fix-icon-scaling
When painting the titlebar, button icons that aren't available in the desired size need to be scaled. However the current code inverses the scale factor, with the result that the adjusted icons are much worse than the original icons, whoops. This went unnoticed for a long time given that most icons are availa- ble in the desired 16x16 size, and the most likely exceptions - window icons - are not shown by default. https://gitlab.gnome.org/GNOME/mutter/issues/23
Diffstat (limited to 'src/ui/theme.c')
-rw-r--r--src/ui/theme.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ui/theme.c b/src/ui/theme.c
index 2f527fb24..2b3cd5eaf 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -885,13 +885,13 @@ meta_frame_layout_draw_with_style (MetaFrameLayout *layout,
width = cairo_image_surface_get_width (surface) / scale;
height = cairo_image_surface_get_height (surface) / scale;
- x = button_rect.x + (button_rect.width - width) / 2;
- y = button_rect.y + (button_rect.height - height) / 2;
+ x = button_rect.x + (button_rect.width - layout->icon_size) / 2;
+ y = button_rect.y + (button_rect.height - layout->icon_size) / 2;
cairo_translate (cr, x, y);
cairo_scale (cr,
- width / layout->icon_size,
- height / layout->icon_size);
+ layout->icon_size / width,
+ layout->icon_size / height);
cairo_set_source_surface (cr, surface, 0, 0);
cairo_paint (cr);