From cd80d7701c6fe2805f96ba76e89315dbd42bb0fe Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sun, 10 Feb 2013 14:49:31 +0000 Subject: [PATCH] Support scaled UI again. --- ptap/ptapui.cpp | 13 +++++-------- pui/lv2pui.cpp | 4 ++-- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/ptap/ptapui.cpp b/ptap/ptapui.cpp index 0ffa841..ec836d6 100644 --- a/ptap/ptapui.cpp +++ b/ptap/ptapui.cpp @@ -19,26 +19,23 @@ #include "ptap.h" struct PTapUI : LV2PUi { - int width; - int height; - /* virtual */ void InitWidgets(); }; void PTapUI::InitWidgets() { - this->width = 250 + 50 * (NUM_TAPS + NUM_CHANNELS + 1); - this->height = 660; + int width = 250 + 50 * (NUM_TAPS + NUM_CHANNELS + 1); + int height = 660; char tmp[128]; - scale = 1.0f; + this->scale = 1.0f; widget = new Container(); widget->back = 1; widget->colour = Colour(1, 1, 1, 1); - widget->w = this->width * scale; - widget->h = this->height * scale; + widget->w = width; + widget->h = height; int padding = 4; diff --git a/pui/lv2pui.cpp b/pui/lv2pui.cpp index 85f8ead..c1a2ff3 100644 --- a/pui/lv2pui.cpp +++ b/pui/lv2pui.cpp @@ -37,8 +37,8 @@ void LV2PUi::Instantiate( this->InitWidgets(); - int w = this->widget->w; - int h = this->widget->h; + int w = this->widget->w / this->scale; + int h = this->widget->h / this->scale; this->view = puglCreate(parent, "Test", w, h, true); puglSetHandle(this->view, this);