comparison src/video/cocoa/SDL_cocoakeyboard.m @ 4436:d3c193100522

changeset: 4434:4e5dd7dc58cd tag: tip user: Jjgod Jiang <gzjjgod@gmail.com> date: Fri Apr 16 13:20:33 2010 +0800 summary: Fix window height calculation for text input rect
author Sam Lantinga <slouken@libsdl.org>
date Thu, 15 Apr 2010 22:27:50 -0700
parents e953700da4ca
children 3e69e077cb95
comparison
equal deleted inserted replaced
4435:e953700da4ca 4436:d3c193100522
153 _markedText = nil; 153 _markedText = nil;
154 } 154 }
155 155
156 - (NSRect) firstRectForCharacterRange: (NSRange) theRange 156 - (NSRect) firstRectForCharacterRange: (NSRange) theRange
157 { 157 {
158 float windowHeight = [[self window] frame].size.height; 158 NSWindow *window = [self window];
159 NSRect contentRect = [window contentRectForFrameRect: [window frame]];
160 float windowHeight = contentRect.size.height;
159 NSRect rect = NSMakeRect(_inputRect.x, windowHeight - _inputRect.y - _inputRect.h, 161 NSRect rect = NSMakeRect(_inputRect.x, windowHeight - _inputRect.y - _inputRect.h,
160 _inputRect.w, _inputRect.h); 162 _inputRect.w, _inputRect.h);
161 163
162 DEBUG_IME(@"firstRectForCharacterRange: (%d, %d): windowHeight = %g, rect = %@", 164 DEBUG_IME(@"firstRectForCharacterRange: (%d, %d): windowHeight = %g, rect = %@",
163 theRange.location, theRange.length, windowHeight, 165 theRange.location, theRange.length, windowHeight,