macOS: Apply preeditCursor to position of candidate window

This commit is contained in:
Daijiro Fukuda 2022-04-27 13:59:43 +09:00
parent 2e976c01ed
commit c2923ac577

View File

@ -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