From b414cbea446a860f02f2f650955ff251a70d14cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Tue, 15 Apr 2014 18:45:15 -0400 Subject: [PATCH] automatically derive fb dimensions --- include/llmr/map/map.hpp | 1 + src/map/map.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/include/llmr/map/map.hpp b/include/llmr/map/map.hpp index fef367386..abf17ff3c 100644 --- a/include/llmr/map/map.hpp +++ b/include/llmr/map/map.hpp @@ -28,6 +28,7 @@ public: void setup(); void loadStyle(const uint8_t *const data, uint32_t bytes); void loadSettings(); + void resize(uint16_t width, uint16_t height, float ratio = 1); void resize(uint16_t width, uint16_t height, float ratio, uint16_t fb_width, uint16_t fb_height); /* callback */ diff --git a/src/map/map.cpp b/src/map/map.cpp index 48d3df041..f378cd37e 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -70,6 +70,10 @@ void Map::loadSettings() { update(); } +void Map::resize(uint16_t width, uint16_t height, float ratio) { + resize(width, height, ratio, width * ratio, height * ratio); +} + void Map::resize(uint16_t width, uint16_t height, float ratio, uint16_t fb_width, uint16_t fb_height) { transform.resize(width, height, ratio, fb_width, fb_height); painter.resize();