[gnome-settings-daemon] orientation: Make orientation calculation work
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] orientation: Make orientation calculation work
- Date: Thu, 2 Jun 2011 17:18:33 +0000 (UTC)
commit 1becad37908e7c8f119fee2ed0220eb4c4558164
Author: Bastien Nocera <hadess hadess net>
Date: Thu Jun 2 18:17:50 2011 +0100
orientation: Make orientation calculation work
So that it passes our tests.
plugins/orientation/gsd-orientation-calc.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/plugins/orientation/gsd-orientation-calc.c b/plugins/orientation/gsd-orientation-calc.c
index 978103c..726a943 100644
--- a/plugins/orientation/gsd-orientation-calc.c
+++ b/plugins/orientation/gsd-orientation-calc.c
@@ -69,7 +69,7 @@ OrientationUp gsd_orientation_calc (OrientationUp prev,
rotation = round (atan ((double) x / sqrt (y * y + z * z)) * RADIANS_TO_DEGREES);
if (abs (rotation) > THRESHOLD_PORTRAIT) {
- ret = (rotation >= 0) ? ORIENTATION_LEFT_UP : ORIENTATION_RIGHT_UP;
+ ret = (rotation < 0) ? ORIENTATION_LEFT_UP : ORIENTATION_RIGHT_UP;
/* Some threshold to switching between portrait modes */
if (prev == ORIENTATION_LEFT_UP || prev == ORIENTATION_RIGHT_UP) {
@@ -83,7 +83,7 @@ OrientationUp gsd_orientation_calc (OrientationUp prev,
rotation = round (atan ((double) y / sqrt (x * x + z * z)) * RADIANS_TO_DEGREES);
if (abs (rotation) > THRESHOLD_LANDSCAPE) {
- ret = (rotation >= 0) ? ORIENTATION_BOTTOM_UP : ORIENTATION_NORMAL;
+ ret = (rotation < 0) ? ORIENTATION_BOTTOM_UP : ORIENTATION_NORMAL;
/* Some threshold to switching between landscape modes */
if (prev == ORIENTATION_BOTTOM_UP || prev == ORIENTATION_NORMAL) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]