diff options
author | Finlay Davidson <finlay.davidson@coderclass.nl> | 2022-05-09 17:16:08 +0200 |
---|---|---|
committer | Riku Isokoski <riksu9000@gmail.com> | 2022-06-05 09:15:46 +0300 |
commit | 7f45538eb53235ab4015fcf13533796c8759c7bc (patch) | |
tree | 79d9a2f60e8fb13cb5356bcc5c6e93259449530b /src/displayapp/screens/WatchFaceAnalog.cpp | |
parent | 718fbdab98ae80923a548ac03b7843f5d618a4f6 (diff) |
Apply clang-format to all C++ files
Diffstat (limited to 'src/displayapp/screens/WatchFaceAnalog.cpp')
-rw-r--r-- | src/displayapp/screens/WatchFaceAnalog.cpp | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/src/displayapp/screens/WatchFaceAnalog.cpp b/src/displayapp/screens/WatchFaceAnalog.cpp index dd5b2929..251a560f 100644 --- a/src/displayapp/screens/WatchFaceAnalog.cpp +++ b/src/displayapp/screens/WatchFaceAnalog.cpp @@ -12,35 +12,33 @@ LV_IMG_DECLARE(bg_clock); using namespace Pinetime::Applications::Screens; namespace { -constexpr int16_t HourLength = 70; -constexpr int16_t MinuteLength = 90; -constexpr int16_t SecondLength = 110; + constexpr int16_t HourLength = 70; + constexpr int16_t MinuteLength = 90; + constexpr int16_t SecondLength = 110; -// sin(90) = 1 so the value of _lv_trigo_sin(90) is the scaling factor -const auto LV_TRIG_SCALE = _lv_trigo_sin(90); + // sin(90) = 1 so the value of _lv_trigo_sin(90) is the scaling factor + const auto LV_TRIG_SCALE = _lv_trigo_sin(90); -int16_t Cosine(int16_t angle) { - return _lv_trigo_sin(angle + 90); -} + int16_t Cosine(int16_t angle) { + return _lv_trigo_sin(angle + 90); + } -int16_t Sine(int16_t angle) { - return _lv_trigo_sin(angle); -} + int16_t Sine(int16_t angle) { + return _lv_trigo_sin(angle); + } -int16_t CoordinateXRelocate(int16_t x) { - return (x + LV_HOR_RES / 2); -} + int16_t CoordinateXRelocate(int16_t x) { + return (x + LV_HOR_RES / 2); + } -int16_t CoordinateYRelocate(int16_t y) { - return std::abs(y - LV_HOR_RES / 2); -} + int16_t CoordinateYRelocate(int16_t y) { + return std::abs(y - LV_HOR_RES / 2); + } -lv_point_t CoordinateRelocate(int16_t radius, int16_t angle) { - return lv_point_t{ - .x = CoordinateXRelocate(radius * static_cast<int32_t>(Sine(angle)) / LV_TRIG_SCALE), - .y = CoordinateYRelocate(radius * static_cast<int32_t>(Cosine(angle)) / LV_TRIG_SCALE) - }; -} + lv_point_t CoordinateRelocate(int16_t radius, int16_t angle) { + return lv_point_t {.x = CoordinateXRelocate(radius * static_cast<int32_t>(Sine(angle)) / LV_TRIG_SCALE), + .y = CoordinateYRelocate(radius * static_cast<int32_t>(Cosine(angle)) / LV_TRIG_SCALE)}; + } } |