Support scaled UI again.

master
Peter Nelson 2013-02-10 14:49:31 +00:00
parent 7f92ee1565
commit cd80d7701c
2 changed files with 7 additions and 10 deletions

View File

@ -19,26 +19,23 @@
#include "ptap.h" #include "ptap.h"
struct PTapUI : LV2PUi { struct PTapUI : LV2PUi {
int width;
int height;
/* virtual */ void InitWidgets(); /* virtual */ void InitWidgets();
}; };
void PTapUI::InitWidgets() void PTapUI::InitWidgets()
{ {
this->width = 250 + 50 * (NUM_TAPS + NUM_CHANNELS + 1); int width = 250 + 50 * (NUM_TAPS + NUM_CHANNELS + 1);
this->height = 660; int height = 660;
char tmp[128]; char tmp[128];
scale = 1.0f; this->scale = 1.0f;
widget = new Container(); widget = new Container();
widget->back = 1; widget->back = 1;
widget->colour = Colour(1, 1, 1, 1); widget->colour = Colour(1, 1, 1, 1);
widget->w = this->width * scale; widget->w = width;
widget->h = this->height * scale; widget->h = height;
int padding = 4; int padding = 4;

View File

@ -37,8 +37,8 @@ void LV2PUi::Instantiate(
this->InitWidgets(); this->InitWidgets();
int w = this->widget->w; int w = this->widget->w / this->scale;
int h = this->widget->h; int h = this->widget->h / this->scale;
this->view = puglCreate(parent, "Test", w, h, true); this->view = puglCreate(parent, "Test", w, h, true);
puglSetHandle(this->view, this); puglSetHandle(this->view, this);