From ab53147dd86867c5bde2c0445cb6abf7d21fff05 Mon Sep 17 00:00:00 2001 From: Eric Wertz Date: Mon, 20 Feb 2017 11:32:10 -0500 Subject: [PATCH] Fixed bug where scaling wasn't looking right --- main.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index ea7afc2..6f7d65f 100644 --- a/main.c +++ b/main.c @@ -8,6 +8,7 @@ #include #include +#include #include GtkWidget* window; @@ -134,7 +135,7 @@ void load_wallpaper_pixels(GdkPixbuf* pixbuf) float sw, sh; float targetheight = (float)width / aspect; float targetwidth = (float)height * aspect; - if( targetwidth >= screen_width ) + if( targetwidth >= screen_width && targetwidth <= height ) { //Scale width, crop height tx1 = 0.0f; @@ -378,7 +379,27 @@ int main( int argc, char* argv[] ) GSettingsSchema* gsettings_schema; gsettings_schema = g_settings_schema_source_lookup( g_settings_schema_source_get_default(), - "org.gnome.desktop.background", + + + + + + + + + + + + + + + + + + + + + "org.gnome.desktop.background", TRUE ); if( gsettings_schema ) { -- 2.47.0