diff options
author | Hanspeter Portner <dev@open-music-kontrollers.ch> | 2021-04-14 00:04:29 +0200 |
---|---|---|
committer | Hanspeter Portner <dev@open-music-kontrollers.ch> | 2021-04-14 00:04:29 +0200 |
commit | 73413fe1c39534e3cc4e0d1ef1b8b86a593e4eac (patch) | |
tree | fb48f10d7097f6804950c35316743f7c6f9e8447 | |
parent | be7e0b2b59b2b89ba31f5bb97e4d3b44e354199d (diff) | |
download | midi_matrix.lv2-73413fe1c39534e3cc4e0d1ef1b8b86a593e4eac.tar.xz |
nk: fix last commit.
-rw-r--r-- | VERSION | 2 | ||||
-rw-r--r-- | midi_matrix_channel_filter_nk.c | 42 |
2 files changed, 21 insertions, 23 deletions
@@ -1 +1 @@ -0.29.9 +0.29.11 diff --git a/midi_matrix_channel_filter_nk.c b/midi_matrix_channel_filter_nk.c index 2967d25..2099bba 100644 --- a/midi_matrix_channel_filter_nk.c +++ b/midi_matrix_channel_filter_nk.c @@ -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); |