summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2020-11-27 17:49:35 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2020-11-27 17:49:49 +0100
commit4291e9497bb5b0e83abd4e8ea4a15febaef0616a (patch)
treec05a66c61ff309ea255a183536071ca417144550 /src
parentd851106f47314680fb619fb94f97878a7d5fbed6 (diff)
Fix for issue #123 - macOS platform
Diffstat (limited to 'src')
-rw-r--r--src/Fl_cocoa.mm12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index 6fe035cfc..e67e9646a 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -1892,8 +1892,8 @@ static int fake_X_wm(Fl_Window* w,int &X,int &Y, int &bt,int &bx, int &by) {
dx = 2*bx;
dy = 2*by + bt;
float s = Fl::screen_driver()->scale(0);
- X = w->x()*s-xoff;
- Y = w->y()*s-yoff;
+ X = round(w->x()*s)-xoff;
+ Y = round(w->y()*s)-yoff;
W = w->w()*s+dx;
H = w->h()*s+dy;
@@ -3007,8 +3007,8 @@ Fl_X* Fl_Cocoa_Window_Driver::makeWindow()
winlevel = NSStatusWindowLevel;
}
float s = Fl::screen_driver()->scale(0);
- crect.origin.x = int(s * w->x()); // correct origin set later for subwindows
- crect.origin.y = main_screen_height - int(s * (w->y() + w->h()));
+ crect.origin.x = round(s * w->x()); // correct origin set later for subwindows
+ crect.origin.y = main_screen_height - round(s * (w->y() + w->h()));
crect.size.width = int(s * w->w());
crect.size.height = int(s * w->h());
FLWindow *cw = [[FLWindow alloc] initWithFl_W:w
@@ -3076,8 +3076,8 @@ Fl_X* Fl_Cocoa_Window_Driver::makeWindow()
delta = [cw cascadeTopLeftFromPoint:delta];
}
crect = [cw frame]; // synchronize FLTK's and the system's window coordinates
- this->x(int(crect.origin.x/s));
- this->y( main_screen_height/s - (crect.origin.y/s + w->h()) );
+ this->x(round(crect.origin.x/s));
+ this->y( round((main_screen_height - crect.origin.y)/s) - w->h() );
}
if(w->menu_window()) { // make menu windows slightly transparent
[cw setAlphaValue:0.97];