[Xfce4-commits] <ristretto:master> Improve preview of wallpaper for zoomed, scaled and stretched view.
Stephan Arts
noreply at xfce.org
Mon Nov 14 00:14:01 CET 2011
Updating branch refs/heads/master
to 51052132ec4fe62e2f5b706dc3fb088f36d7b3c4 (commit)
from 30ae66b39617bf5b2628827a9598bdf35e746e5a (commit)
commit 51052132ec4fe62e2f5b706dc3fb088f36d7b3c4
Author: Stephan Arts <stephan at xfce.org>
Date: Mon Nov 14 00:11:47 2011 +0100
Improve preview of wallpaper for zoomed, scaled and stretched view.
src/monitor_chooser.c | 24 ++++++++++++++++--------
1 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/src/monitor_chooser.c b/src/monitor_chooser.c
index f8bb6d1..c01f3f1 100644
--- a/src/monitor_chooser.c
+++ b/src/monitor_chooser.c
@@ -412,8 +412,8 @@ paint_monitor ( cairo_t *cr,
switch (monitor->style)
{
case MONITOR_STYLE_STRETCHED:
- hscale = (width) / (gdk_pixbuf_get_width(monitor->pixbuf));
- vscale = (height) / (gdk_pixbuf_get_height(monitor->pixbuf));
+ hscale = (width-20) / (gdk_pixbuf_get_width(monitor->pixbuf));
+ vscale = (height-20) / (gdk_pixbuf_get_height(monitor->pixbuf));
cairo_scale (cr, hscale, vscale);
gdk_cairo_set_source_pixbuf (cr,
@@ -422,8 +422,8 @@ paint_monitor ( cairo_t *cr,
y/vscale+((height/vscale)-gdk_pixbuf_get_height(monitor->pixbuf))/2);
break;
case MONITOR_STYLE_SCALED:
- hscale = (width) / (gdk_pixbuf_get_width(monitor->pixbuf));
- vscale = (height) / (gdk_pixbuf_get_height(monitor->pixbuf));
+ hscale = (width-20) / (gdk_pixbuf_get_width(monitor->pixbuf));
+ vscale = (height-20) / (gdk_pixbuf_get_height(monitor->pixbuf));
if (hscale < vscale)
{
vscale = hscale;
@@ -441,8 +441,8 @@ paint_monitor ( cairo_t *cr,
break;
case MONITOR_STYLE_ZOOMED:
- hscale = (width) / (gdk_pixbuf_get_width(monitor->pixbuf));
- vscale = (height) / (gdk_pixbuf_get_height(monitor->pixbuf));
+ hscale = (width-20) / (gdk_pixbuf_get_width(monitor->pixbuf));
+ vscale = (height-20) / (gdk_pixbuf_get_height(monitor->pixbuf));
if (hscale > vscale)
{
vscale = hscale;
@@ -461,8 +461,16 @@ paint_monitor ( cairo_t *cr,
default:
dst_pixbuf = gdk_pixbuf_copy (monitor->pixbuf);
gdk_pixbuf_saturate_and_pixelate (monitor->pixbuf, dst_pixbuf, 0.0, TRUE);
- hscale = width / (gdk_pixbuf_get_width(monitor->pixbuf));
- vscale = hscale;
+ hscale = (width-20) / (gdk_pixbuf_get_width(monitor->pixbuf));
+ vscale = (height-20) / (gdk_pixbuf_get_height(monitor->pixbuf));
+ if (hscale < vscale)
+ {
+ vscale = hscale;
+ }
+ else
+ {
+ hscale = vscale;
+ }
cairo_scale (cr, hscale, vscale);
gdk_cairo_set_source_pixbuf (cr,
More information about the Xfce4-commits
mailing list