mirror of
https://github.com/glfw/glfw.git
synced 2025-06-14 19:52:14 +00:00
macOS: Apply preeditCursor to position of candidate window
This commit is contained in:
parent
2e976c01ed
commit
c2923ac577
@ -772,8 +772,17 @@ static const NSRange kEmptyRange = { NSNotFound, 0 };
|
|||||||
- (NSRect)firstRectForCharacterRange:(NSRange)range
|
- (NSRect)firstRectForCharacterRange:(NSRange)range
|
||||||
actualRange:(NSRangePointer)actualRange
|
actualRange:(NSRangePointer)actualRange
|
||||||
{
|
{
|
||||||
const NSRect frame = [window->ns.view frame];
|
int x = window->preeditCursorPosX;
|
||||||
return NSMakeRect(frame.origin.x, frame.origin.y, 0.0, 0.0);
|
int y = window->preeditCursorPosY;
|
||||||
|
int h = window->preeditCursorHeight;
|
||||||
|
|
||||||
|
const NSRect frame =
|
||||||
|
[window->ns.object contentRectForFrameRect:[window->ns.object frame]];
|
||||||
|
|
||||||
|
return NSMakeRect(frame.origin.x + x,
|
||||||
|
frame.origin.y + frame.size.height - y,
|
||||||
|
0.0,
|
||||||
|
h);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)insertText:(id)string replacementRange:(NSRange)replacementRange
|
- (void)insertText:(id)string replacementRange:(NSRange)replacementRange
|
||||||
|
Loading…
Reference in New Issue
Block a user