aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2021-04-14 09:58:31 +0200
committerHanspeter Portner <dev@open-music-kontrollers.ch>2021-04-14 09:58:31 +0200
commit13caea2fbbd7787875acef1d011f3e6f451006a5 (patch)
tree54c79a0e5e303bd39cee63c66241a41dec899b44
parentbf109d042440d13bfa9cf217374ad5e1f404e381 (diff)
downloadvm.lv2-13caea2fbbd7787875acef1d011f3e6f451006a5.tar.xz
nk: use new scale API.
-rw-r--r--VERSION2
-rw-r--r--vm_ui.c16
2 files changed, 9 insertions, 9 deletions
diff --git a/VERSION b/VERSION
index 288adf5..dddf7f8 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.13.3
+0.13.13
diff --git a/vm_ui.c b/vm_ui.c
index 73ad68c..5693720 100644
--- a/vm_ui.c
+++ b/vm_ui.c
@@ -1182,6 +1182,11 @@ instantiate(const LV2UI_Descriptor *descriptor, const char *plugin_uri,
handle->sample_rate = 48000.f; // fall-back
}
+ if(handle->scale == 0.f)
+ {
+ handle->scale = nk_pugl_get_scale();
+ }
+
vm_api_init(handle->api, handle->map);
const int nprops = handle->vm_plug == VM_PLUG_MIDI
@@ -1218,8 +1223,8 @@ instantiate(const LV2UI_Descriptor *descriptor, const char *plugin_uri,
handle->writer = write_function;
nk_pugl_config_t *cfg = &handle->win.cfg;
- cfg->width = 1280;
- cfg->height = 720;
+ cfg->width = 1280 * handle->scale;
+ cfg->height = 720 * handle->scale;
cfg->resizable = true;
cfg->ignore = false;
cfg->class = "vm";
@@ -1231,15 +1236,10 @@ instantiate(const LV2UI_Descriptor *descriptor, const char *plugin_uri,
if(asprintf(&cfg->font.face, "%sCousine-Regular.ttf", bundle_path) == -1)
cfg->font.face = NULL;
- cfg->font.size = 13;
+ cfg->font.size = 13 * handle->scale;
*(intptr_t *)widget = nk_pugl_init(&handle->win);
- if(handle->scale == 0.f)
- {
- handle->scale = nk_pugl_get_scale(&handle->win);
- }
-
nk_pugl_show(&handle->win);
char *icon_path;