[gnome-games] savestate-listbox-row: Simplify hidpi drawing



commit b38c611d4e6ca29f447a6cd8679ace873d035c9b
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Sat Aug 17 15:23:33 2019 +0500

    savestate-listbox-row: Simplify hidpi drawing
    
    Just a cleanup.

 src/ui/savestate-listbox-row.vala | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/ui/savestate-listbox-row.vala b/src/ui/savestate-listbox-row.vala
index 8605326e..2c6822d0 100644
--- a/src/ui/savestate-listbox-row.vala
+++ b/src/ui/savestate-listbox-row.vala
@@ -135,20 +135,20 @@ private class Games.SavestateListBoxRow : Gtk.ListBoxRow {
 
        // TODO: Share this with GameThumbnail
        private Cairo.Surface get_mask () {
-               var scale = scale_factor;
                var width = image.get_allocated_width ();
                var height = image.get_allocated_height ();
 
-               var mask = new Cairo.ImageSurface (Cairo.Format.A8, width * scale, height * scale);
+               var mask = new Cairo.ImageSurface (Cairo.Format.A8, width * scale_factor, height * 
scale_factor);
 
                var style = image.get_style_context ();
                var flags = image.get_state_flags ();
-               var border_radius = (int) style.get_property (Gtk.STYLE_PROPERTY_BORDER_RADIUS, flags) * 
scale;
-               border_radius = border_radius.clamp (0, int.max (width * scale / 2, height * scale / 2));
+               var border_radius = (int) style.get_property (Gtk.STYLE_PROPERTY_BORDER_RADIUS, flags);
+               border_radius = border_radius.clamp (0, int.max (width / 2, height / 2));
 
                var cr = new Cairo.Context (mask);
+               cr.scale (scale_factor, scale_factor);
                cr.set_source_rgb (0, 0, 0);
-               rounded_rectangle (cr, 0.5 * scale, 0.5 * scale, (width - 1) * scale, (height - 1) * scale, 
border_radius);
+               rounded_rectangle (cr, 0.5, 0.5, width - 1, height - 1, border_radius);
                cr.fill ();
 
                return mask;


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