From b38ce884c5b5736119a0f3192af491edce1936a8 Mon Sep 17 00:00:00 2001 From: Mjolnir Date: Wed, 9 Sep 2015 11:07:55 +0200 Subject: [PATCH] simplify screen rotation --- Library/LivingScreen.cpp | 7 ++----- Library/LivingScreen.h | 2 +- LivingDemos/ScreenRotate.cpp | 5 +++++ LivingDemos/ScreenRotate.h | 10 ++++++++++ 4 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 LivingDemos/ScreenRotate.cpp create mode 100644 LivingDemos/ScreenRotate.h 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 -- 2.30.2