Skip to content

Commit da4dbaf

Browse files
committed
Keep aspect ratio
1 parent e21498d commit da4dbaf

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

background/Background.vala

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ public interface Gala.Background.Background : Object, Gdk.Paintable {
8888
return info;
8989
}
9090

91+
public override double get_intrinsic_aspect_ratio () {
92+
return texture.get_intrinsic_aspect_ratio ();
93+
}
94+
9195
public void snapshot (Gdk.Snapshot gdk_snapshot, double width, double height) {
9296
if (!(gdk_snapshot is Gtk.Snapshot)) {
9397
critical ("No Gtk Snapshot provided can't render brightness changed");
@@ -125,8 +129,12 @@ public interface Gala.Background.Background : Object, Gdk.Paintable {
125129
return Utils.get_background_color_information (texture, height);
126130
}
127131

132+
public override double get_intrinsic_aspect_ratio () {
133+
return texture.get_intrinsic_aspect_ratio ();
134+
}
135+
128136
public void snapshot (Gdk.Snapshot gdk_snapshot, double width, double height) {
129-
texture.snapshot (gdk_snapshot, width, height);
137+
texture.snapshot (gdk_snapshot, render_width, render_height);
130138
}
131139
}
132140
}

0 commit comments

Comments
 (0)