aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2017-08-12 23:08:00 +0200
committerHanspeter Portner <dev@open-music-kontrollers.ch>2017-08-12 23:08:00 +0200
commit5afb7ffd0042f449e21a8016898c11a127547ab6 (patch)
treebf2c180dea082027f00a5d6ec42448e58a79b6bc
parentaa9d157484762a2c9dd9a062f577fe69b936a81e (diff)
downloadsherlock.lv2-5afb7ffd0042f449e21a8016898c11a127547ab6.tar.xz
Squashed 'nk_pugl/' changes from 2a37459..7709c91
7709c91 fix bug in initial scaling on high-DPI screens. git-subtree-dir: nk_pugl git-subtree-split: 7709c910945ba767efb5a6761f5671f7f9e232f7
-rw-r--r--nk_pugl.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/nk_pugl.h b/nk_pugl.h
index 9b119a0..eb6f041 100644
--- a/nk_pugl.h
+++ b/nk_pugl.h
@@ -454,7 +454,7 @@ _nk_pugl_resize(nk_pugl_window_t *win)
if(cfg->host_resize)
{
cfg->host_resize->ui_resize(cfg->host_resize->handle,
- cfg->width*win->scale, cfg->height*win->scale);
+ cfg->width, cfg->height);
}
}
@@ -469,7 +469,7 @@ _nk_pugl_reconfigure(nk_pugl_window_t *win)
puglLeaveContext(win->view, false);
#if 0
- if(!win->cfg->resizable)
+ if(win->cfg.resizable)
_nk_pugl_resize(win);
#endif
}
@@ -1005,11 +1005,16 @@ nk_pugl_init(nk_pugl_window_t *win)
win->scale = 0.5;
win->has_left = true;
+ cfg->width *= win->scale;
+ cfg->height *= win->scale;
+ cfg->min_width *= win->scale;
+ cfg->min_height *= win->scale;
+
// init pugl
win->view = puglInit(NULL, NULL);
puglInitWindowClass(win->view, cfg->class ? cfg->class : "nuklear");
- puglInitWindowSize(win->view, cfg->width*win->scale, cfg->height*win->scale);
- puglInitWindowMinSize(win->view, cfg->min_width*win->scale, cfg->min_height*win->scale);
+ puglInitWindowSize(win->view, cfg->width, cfg->height);
+ puglInitWindowMinSize(win->view, cfg->min_width, cfg->min_height);
puglInitResizable(win->view, cfg->resizable);
if(cfg->fixed_aspect)
puglInitWindowAspectRatio(win->view, cfg->width, cfg->height, cfg->width, cfg->height);