~hp/vm.lv2

13caea2fbbd7787875acef1d011f3e6f451006a5 — Hanspeter Portner 3 years ago bf109d0
nk: use new scale API.
2 files changed, 9 insertions(+), 9 deletions(-)

M VERSION
M vm_ui.c
M VERSION => VERSION +1 -1
@@ 1,1 1,1 @@
0.13.3
0.13.13

M vm_ui.c => vm_ui.c +8 -8
@@ 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;