[gnome-desktop/opensuse-moblin: 1/4] Allow rotation if the virtual size has the correct number of pixels
- From: Federico Mena Quintero <federico src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-desktop/opensuse-moblin: 1/4] Allow rotation if the virtual size has the correct number of pixels
- Date: Tue, 26 Jan 2010 22:54:31 +0000 (UTC)
commit 09740ad0e547f4a938774183d940105a4cf9e214
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]