[gnome-desktop] Allow rotation if the virtual size has the correct number of pixels



commit 8ba5e616ceb10ae8f1138eaa550ec65742195b78
Author: Federico Mena Quintero <federico novell com>
Date:   Sun Sep 20 08:29:46 2009 -0500

    Allow rotation if the virtual size has the correct number of pixels
    
    We checked for the rotated size actually fitting in the virtual size;
    now we just check for the virtual size having the required number of pixels.
    
    Signed-off-by: Federico Mena Quintero <federico novell com>

 libgnome-desktop/gnome-rr-config.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/libgnome-desktop/gnome-rr-config.c b/libgnome-desktop/gnome-rr-config.c
index 94fe6bc..6a8f8ae 100644
--- a/libgnome-desktop/gnome-rr-config.c
+++ b/libgnome-desktop/gnome-rr-config.c
@@ -1666,14 +1666,18 @@ crtc_assignment_new (GnomeRRScreen *screen, GnomeOutputInfo **outputs, GError **
     {
 	int width, height;
 	int min_width, max_width, min_height, max_height;
+	int required_pixels, min_pixels, max_pixels;
 
 	get_required_virtual_size (assignment, &width, &height);
 
 	gnome_rr_screen_get_ranges (
 	    screen, &min_width, &max_width, &min_height, &max_height);
-    
-	if (width < min_width || width > max_width ||
-	    height < min_height || height > max_height)
+
+	required_pixels = width * height;
+	min_pixels = min_width * min_height;
+	max_pixels = max_width * max_height;
+
+	if (required_pixels < min_pixels || required_pixels > max_pixels)
 	{
 	    g_set_error (error, GNOME_RR_ERROR, GNOME_RR_ERROR_BOUNDS_ERROR,
 			 /* Translators: the "requested", "minimum", and



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