File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -135,16 +135,21 @@ public interface Gala.Background.Background : Object, Gdk.Paintable {
135135
136136 switch (style) {
137137 case ZOOM :
138- var x_scale = (float ) width / texture. get_width () ;
139- var y_scale = (float ) height / texture. get_height () ;
138+ var x_scale = (float ) width / texture. width ;
139+ var y_scale = (float ) height / texture. height ;
140140 if (x_scale > y_scale) {
141- snapshot. translate ({0 , (float ) (height - texture. get_height () * x_scale) / 2 });
141+ snapshot. translate ({0 , (float ) (height - texture. width * x_scale) / 2 });
142142 snapshot. scale (x_scale, x_scale);
143143 } else {
144- snapshot. translate ({(float ) (width - (texture. get_width () * y_scale)) / 2 , 0 });
144+ snapshot. translate ({(float ) (width - (texture. width * y_scale)) / 2 , 0 });
145145 snapshot. scale (y_scale, y_scale);
146146 }
147- texture. snapshot (snapshot, texture. get_width (), texture. get_height ());
147+ texture. snapshot (snapshot, texture. width, texture. height);
148+ break ;
149+
150+ case CENTERED :
151+ snapshot. translate ({(float ) (width - texture. width) / 2 , (float ) (height - texture. height) / 2 });
152+ texture. snapshot (snapshot, texture. width, texture. height);
148153 break ;
149154
150155 default:
You can’t perform that action at this time.
0 commit comments