diff --git a/Source/NSRulerView.m b/Source/NSRulerView.m index 426d549e6..9f4cf9228 100644 --- a/Source/NSRulerView.m +++ b/Source/NSRulerView.m @@ -244,7 +244,7 @@ static NSMutableDictionary *units = nil; unitToPointsConversionFactor: conversionFactor stepUpCycle: stepUpCycle stepDownCycle: stepDownCycle]; - [units setObject: u forKey: uName]; + [units setObject: u forKey: uName]; } - (void) setMeasurementUnits: (NSString *)uName @@ -268,11 +268,14 @@ static NSMutableDictionary *units = nil; - (void) setClientView: (NSView *)aView { + if (_clientView == aView) + return; + if (_clientView != nil && [_clientView respondsToSelector: @selector(rulerView:willSetClientView:)]) { - [_clientView rulerView: self willSetClientView: aView]; + [_clientView rulerView: self willSetClientView: aView]; } /* NB: We should not RETAIN the clientView. */ _clientView = aView; @@ -375,6 +378,16 @@ static NSMutableDictionary *units = nil; return NO; } +- (void) mouseDown: (NSEvent*)theEvent +{ + if (_clientView != nil + && [_clientView respondsToSelector: + @selector(rulerView:handleMouseDown:)]) + { + [_clientView rulerView: self handleMouseDown: theEvent]; + } +} + - (void) moveRulerlineFromLocation: (float)oldLoc toLocation: (float)newLoc { @@ -515,8 +528,7 @@ static NSMutableDictionary *units = nil; [self _verifyCachedValues]; - /* TODO: should be a user default */ - font = [NSFont systemFontOfSize: 8]; + font = [NSFont systemFontOfSize: [NSFont smallSystemFontSize]]; [font set]; [[NSColor blackColor] set];