@@ 194,27 194,6 @@ instantiate(const LV2UI_Descriptor *descriptor,
handle->controller = controller;
handle->writer = write_function;
- const float scale = nk_pugl_get_scale();
-
- nk_pugl_config_t *cfg = &handle->win.cfg;
- cfg->width = 640 * scale;
- cfg->height = 640 * scale;
- cfg->resizable = true;
- cfg->fixed_aspect = true;
- cfg->ignore = false;
- cfg->class = "channel_filter";
- cfg->title = "Channel Filter";
- cfg->parent = (intptr_t)parent;
- cfg->host_resize = host_resize;
- cfg->data = handle;
- cfg->expose = _expose;
-
- if(asprintf(&cfg->font.face, "%sCousine-Regular.ttf", bundle_path) == -1)
- cfg->font.face= NULL;
- cfg->font.size = 13 * scale;
-
- *(intptr_t *)widget = nk_pugl_init(&handle->win);
-
const LV2_URID ui_scaleFactor = handle->map->map(handle->map->handle,
LV2_UI__scaleFactor);
@@ 230,9 209,28 @@ instantiate(const LV2UI_Descriptor *descriptor,
if(handle->scale == 0.f)
{
- handle->scale = nk_pugl_get_scale(&handle->win);
+ handle->scale = nk_pugl_get_scale();
}
+ nk_pugl_config_t *cfg = &handle->win.cfg;
+ cfg->width = 640 * handle->scale;
+ cfg->height = 640 * handle->scale;
+ cfg->resizable = true;
+ cfg->fixed_aspect = true;
+ cfg->ignore = false;
+ cfg->class = "channel_filter";
+ cfg->title = "Channel Filter";
+ cfg->parent = (intptr_t)parent;
+ cfg->host_resize = host_resize;
+ cfg->data = handle;
+ cfg->expose = _expose;
+
+ if(asprintf(&cfg->font.face, "%sCousine-Regular.ttf", bundle_path) == -1)
+ cfg->font.face= NULL;
+ cfg->font.size = 13 * handle->scale;
+
+ *(intptr_t *)widget = nk_pugl_init(&handle->win);
+
nk_pugl_show(&handle->win);
nk_patcher_init(&handle->patch, 0.8f);