diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2019-05-08 12:25:48 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2019-05-08 12:25:48 +0200 |
| commit | 12dedc26cdd98458204cc65e302caf2378c40bcb (patch) | |
| tree | cae48441a8a99ba53a4c1b55ec50cb392f67de70 /src | |
| parent | d88ef8f039b7401a8159315700e99d95be1b580e (diff) | |
Adapt function fake_X_wm() to rescaled GUI.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_cocoa.mm | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index d11b9d0ac..5cfd547de 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -1901,10 +1901,11 @@ static int fake_X_wm(Fl_Window* w,int &X,int &Y, int &bt,int &bx, int &by) { yoff = by + bt; dx = 2*bx; dy = 2*by + bt; - X = w->x()-xoff; - Y = w->y()-yoff; - W = w->w()+dx; - H = w->h()+dy; + float s = Fl::screen_driver()->scale(0); + X = w->x()*s-xoff; + Y = w->y()*s-yoff; + W = w->w()*s+dx; + H = w->h()*s+dy; if (w->parent()) return 0; @@ -1989,6 +1990,8 @@ static int fake_X_wm(Fl_Window* w,int &X,int &Y, int &bt,int &bx, int &by) { // Return the client area's top left corner in (X,Y) X+=xoff; Y+=yoff; + X /= s; + Y /= s; return ret; } |
