From 5e40e8441f3f56ebc3104e96c4a8b5766a14be6c Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 15 Apr 2010 22:27:50 -0700 Subject: [PATCH] changeset: 4434:4e5dd7dc58cd tag: tip user: Jjgod Jiang date: Fri Apr 16 13:20:33 2010 +0800 summary: Fix window height calculation for text input rect --- src/video/cocoa/SDL_cocoakeyboard.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/video/cocoa/SDL_cocoakeyboard.m b/src/video/cocoa/SDL_cocoakeyboard.m index 0fb391158..e6266c9e4 100644 --- a/src/video/cocoa/SDL_cocoakeyboard.m +++ b/src/video/cocoa/SDL_cocoakeyboard.m @@ -155,7 +155,9 @@ - (NSRect) firstRectForCharacterRange: (NSRange) theRange { - float windowHeight = [[self window] frame].size.height; + NSWindow *window = [self window]; + NSRect contentRect = [window contentRectForFrameRect: [window frame]]; + float windowHeight = contentRect.size.height; NSRect rect = NSMakeRect(_inputRect.x, windowHeight - _inputRect.y - _inputRect.h, _inputRect.w, _inputRect.h);