aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2021-04-14 09:43:35 +0200
committerHanspeter Portner <dev@open-music-kontrollers.ch>2021-04-14 09:43:35 +0200
commit4d279769663dce13506ee527ea592d271e3787c2 (patch)
tree7472786d891585cbb4c01e6bebe5e21e80192054
parentd25619d360ccd7d9c5ce6806238e3205a9b9271b (diff)
downloadpatchmatrix-4d279769663dce13506ee527ea592d271e3787c2.tar.xz
nk: use new scale API.
-rw-r--r--VERSION2
-rw-r--r--patchmatrix_nk.c9
2 files changed, 6 insertions, 5 deletions
diff --git a/VERSION b/VERSION
index 2157409..174f076 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.22.0
+0.23.9
diff --git a/patchmatrix_nk.c b/patchmatrix_nk.c
index 0886d1a..23683d4 100644
--- a/patchmatrix_nk.c
+++ b/patchmatrix_nk.c
@@ -1045,7 +1045,6 @@ _expose(struct nk_context *ctx, struct nk_rect wbounds, void *data)
app->animating = false;
- app->scale = nk_pugl_get_scale(&app->win);
app->dy = 20.f * app->scale;
const struct nk_input *in = &ctx->input;
@@ -1265,10 +1264,12 @@ _icon_unload(app_t *app, struct nk_image img)
int
_ui_init(app_t *app)
{
+ app->scale = nk_pugl_get_scale();
+
// UI
nk_pugl_config_t *cfg = &app->win.cfg;
- cfg->width = 1280;
- cfg->height = 720;
+ cfg->width = 1280 * app->scale;
+ cfg->height = 720 * app->scale;
cfg->resizable = true;
cfg->ignore = false;
cfg->class = "PatchMatrix";
@@ -1278,7 +1279,7 @@ _ui_init(app_t *app)
cfg->data = app;
cfg->expose = _expose;
cfg->font.face = PATCHMATRIX_DATA_DIR"/Cousine-Regular.ttf";
- cfg->font.size = 13;
+ cfg->font.size = 13 * app->scale;
app->type = TYPE_AUDIO;
app->designation = DESIGNATION_NONE;