simplify screen rotation
authorMjolnir <thomas.pietrzak@inria.fr>
Wed, 9 Sep 2015 09:07:55 +0000 (11:07 +0200)
committerMjolnir <thomas.pietrzak@inria.fr>
Wed, 9 Sep 2015 09:07:55 +0000 (11:07 +0200)
Library/LivingScreen.cpp
Library/LivingScreen.h
LivingDemos/ScreenRotate.cpp [new file with mode: 0644]
LivingDemos/ScreenRotate.h [new file with mode: 0644]

index 867650308169f93ab0c1e449581ca4e9568e2154..3eb8b66c719277c4e8c7b59c8c3710d188904c1b 100644 (file)
@@ -14,12 +14,9 @@ LivingScreen::~LivingScreen()
 {
 }
 
-void LivingScreen::rotation(LivingScreen::direction t, unsigned int angle)
+void LivingScreen::rotation(unsigned int angle)
 {
-    int a = angle;
-    if (t == LEFT)
-        a *= -1;
-    sendCommand('R', a);
+    sendCommand('R', angle);
 }
 
 void LivingScreen::translation(LivingScreen::direction d, unsigned int distance)
index c74ca2b9b443870171490d8651fc470a2053db8b..abe82d9dde94ad32a4b5b2acd25e5e8f474aee8d 100644 (file)
@@ -12,7 +12,7 @@ class LIVINGDESKTOPLIBRARYSHARED_EXPORT LivingScreen : public LivingDevice
 
         enum direction{LEFT, RIGHT};
 
-        void rotation(direction t, unsigned int angle);
+        void rotation(unsigned int angle);
         void translation(direction d, unsigned int distance);
         void moveto(unsigned int pos);
 
diff --git a/LivingDemos/ScreenRotate.cpp b/LivingDemos/ScreenRotate.cpp
new file mode 100644 (file)
index 0000000..e6225f7
--- /dev/null
@@ -0,0 +1,5 @@
+#include "ScreenRotate.h"
+
+ScreenRotate::ScreenRotate()
+{
+}
diff --git a/LivingDemos/ScreenRotate.h b/LivingDemos/ScreenRotate.h
new file mode 100644 (file)
index 0000000..1f3a13f
--- /dev/null
@@ -0,0 +1,10 @@
+#ifndef SCREENROTATE_H
+#define SCREENROTATE_H
+
+class ScreenRotate
+{
+    public:
+        ScreenRotate();
+};
+
+#endif // SCREENROTATE_H