diff options
| author | nyamatongwe <nyamatongwe@gmail.com> | 2012-10-06 11:32:39 +1000 | 
|---|---|---|
| committer | nyamatongwe <nyamatongwe@gmail.com> | 2012-10-06 11:32:39 +1000 | 
| commit | 3e8f9ae5d6a52381fda6fc8b370eeecbe5f8289a (patch) | |
| tree | 7900044e96e36818331c9cabff1d3f7f84e19610 | |
| parent | 3eec0de2a0bf3cfef102d22bce347422d2689325 (diff) | |
| download | scintilla-mirror-3e8f9ae5d6a52381fda6fc8b370eeecbe5f8289a.tar.gz | |
Fix problem with find indicator showing upside down at wrong y-position when
applications built for 10.8.
| -rw-r--r-- | cocoa/ScintillaCocoa.mm | 20 | 
1 files changed, 13 insertions, 7 deletions
diff --git a/cocoa/ScintillaCocoa.mm b/cocoa/ScintillaCocoa.mm index a19b62216..fb584b9c5 100644 --- a/cocoa/ScintillaCocoa.mm +++ b/cocoa/ScintillaCocoa.mm @@ -241,13 +241,15 @@ const CGFloat paddingHighlightY = 2;  	CGFloat width = self.widthText + paddingHighlightX * 2;  	CGFloat height = self.heightLine + paddingHighlightY * 2; +	CGFloat flipper = self.geometryFlipped ? -1.0 : 1.0; +  	// Adjust for padding  	ptText.x -= paddingHighlightX; -	ptText.y += paddingHighlightY; +	ptText.y += flipper * paddingHighlightY;  	// Shift point to centre as expanding about centre  	ptText.x += width / 2.0; -	ptText.y -= height / 2.0; +	ptText.y -= flipper * height / 2.0;  	[CATransaction begin];  	[CATransaction setValue:[NSNumber numberWithFloat:0.0] forKey:kCATransactionAnimationDuration]; @@ -2050,6 +2052,7 @@ void ScintillaCocoa::ShowFindIndicatorForRange(NSRange charRange, BOOL retaining    {      layerFindIndicator = [[FindHighlightLayer alloc] init];      [content setWantsLayer: YES]; +    layerFindIndicator.geometryFlipped = content.layer.geometryFlipped;      [[content layer] addSublayer:layerFindIndicator];    }    [layerFindIndicator removeAnimationForKey:@"animateFound"]; @@ -2093,11 +2096,14 @@ void ScintillaCocoa::MoveFindIndicatorWithBounce(BOOL bounce)  #if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5    if (layerFindIndicator)    { -    NSView *content = ContentView(); -    NSRect rcBounds = [content bounds]; -    CGPoint ptText; -    ptText.x = WndProc(SCI_POINTXFROMPOSITION, 0, layerFindIndicator.positionFind); -    ptText.y = rcBounds.size.height - WndProc(SCI_POINTYFROMPOSITION, 0, layerFindIndicator.positionFind); +    CGPoint ptText = CGPointMake( +      WndProc(SCI_POINTXFROMPOSITION, 0, layerFindIndicator.positionFind), +      WndProc(SCI_POINTYFROMPOSITION, 0, layerFindIndicator.positionFind)); +    if (!layerFindIndicator.geometryFlipped) +    { +      NSView *content = ContentView(); +      ptText.y = content.bounds.size.height - ptText.y; +    }      [layerFindIndicator animateMatch:ptText bounce:bounce];    }  #endif  | 
