aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTooltip.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2011-01-19 20:19:29 +0000
committerBibiko <bibiko@eva.mpg.de>2011-01-19 20:19:29 +0000
commit06c03ea6543b7d38d1b17d5ac8f8416814708eb5 (patch)
tree2fbaecf4637f0ef1f62115686d1bd46150875246 /Source/SPTooltip.m
parentc27e06e95d403f6100b4386487a83a466cf696bc (diff)
downloadsequelpro-06c03ea6543b7d38d1b17d5ac8f8416814708eb5.tar.gz
sequelpro-06c03ea6543b7d38d1b17d5ac8f8416814708eb5.tar.bz2
sequelpro-06c03ea6543b7d38d1b17d5ac8f8416814708eb5.zip
• improved caret positioning for ordering out any kind of tooltip windows esp. for first word after soft-wrapping
• fixed tooltip positioning for SPTextView - do not take the mouse location instead take the caret position
Diffstat (limited to 'Source/SPTooltip.m')
-rw-r--r--Source/SPTooltip.m4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/SPTooltip.m b/Source/SPTooltip.m
index 09929fc2..b0344d52 100644
--- a/Source/SPTooltip.m
+++ b/Source/SPTooltip.m
@@ -257,8 +257,8 @@ static CGFloat slow_in_out (CGFloat t)
id fr = [[NSApp keyWindow] firstResponder];
//If first responder is a textview return the caret position
- if([fr respondsToSelector:@selector(getRangeForCurrentWord)] && [fr alignment] == NSLeftTextAlignment) {
- NSRange range = NSMakeRange([fr selectedRange].location,0);
+ if(([fr isMemberOfClass:[NSTextView class]] && [fr alignment] == NSLeftTextAlignment) || [[[fr class] description] isEqualToString:@"SPTextView"]) {
+ NSRange range = NSMakeRange([fr selectedRange].location,1);
NSRange glyphRange = [[fr layoutManager] glyphRangeForCharacterRange:range actualCharacterRange:NULL];
NSRect boundingRect = [[fr layoutManager] boundingRectForGlyphRange:glyphRange inTextContainer:[fr textContainer]];
boundingRect = [fr convertRect: boundingRect toView:NULL];