MacOS: account for GUI rescaling in support of text input methods.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12927 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2018-05-23 16:19:37 +00:00
parent ce71c4b679
commit 2576f57384
1 changed files with 5 additions and 1 deletions

View File

@ -2581,8 +2581,12 @@ static FLTextInputContext* fltextinputcontext_instance = nil;
win = win->window();
}
// Convert the rect to screen coordinates
glyphRect.origin.y = wfocus->h() - glyphRect.origin.y;
float s = Fl_Graphics_Driver::default_driver().scale();
glyphRect.origin.x *= s;
glyphRect.origin.y *= s;
glyphRect.origin.y = wfocus->h()*s - glyphRect.origin.y;
glyphRect.origin = [(FLWindow*)[self window] convertBaseToScreen:glyphRect.origin];
glyphRect.size.height *= s;
if (actualRange) *actualRange = aRange;
fl_unlock_function();
return glyphRect;