From: Mjolnir Date: Wed, 9 Sep 2015 09:07:55 +0000 (+0200) Subject: simplify screen rotation X-Git-Url: https://git.thomaspietrzak.com/?a=commitdiff_plain;h=b38ce884c5b5736119a0f3192af491edce1936a8;p=livingdesktop.git simplify screen rotation --- diff --git a/Library/LivingScreen.cpp b/Library/LivingScreen.cpp index 8676503..3eb8b66 100644 --- a/Library/LivingScreen.cpp +++ b/Library/LivingScreen.cpp @@ -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) diff --git a/Library/LivingScreen.h b/Library/LivingScreen.h index c74ca2b..abe82d9 100644 --- a/Library/LivingScreen.h +++ b/Library/LivingScreen.h @@ -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 index 0000000..e6225f7 --- /dev/null +++ b/LivingDemos/ScreenRotate.cpp @@ -0,0 +1,5 @@ +#include "ScreenRotate.h" + +ScreenRotate::ScreenRotate() +{ +} diff --git a/LivingDemos/ScreenRotate.h b/LivingDemos/ScreenRotate.h new file mode 100644 index 0000000..1f3a13f --- /dev/null +++ b/LivingDemos/ScreenRotate.h @@ -0,0 +1,10 @@ +#ifndef SCREENROTATE_H +#define SCREENROTATE_H + +class ScreenRotate +{ + public: + ScreenRotate(); +}; + +#endif // SCREENROTATE_H