# HG changeset patch # User Sam Lantinga # Date 1271395670 25200 # Node ID d3c193100522f96ab45a9a3e5c5940be5c7e9bc5 # Parent e953700da4ca653a793c641ea706db93bff3c0c8 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 diff -r e953700da4ca -r d3c193100522 src/video/cocoa/SDL_cocoakeyboard.m --- a/src/video/cocoa/SDL_cocoakeyboard.m Thu Apr 15 22:27:01 2010 -0700 +++ b/src/video/cocoa/SDL_cocoakeyboard.m Thu Apr 15 22:27:50 2010 -0700 @@ -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);