Skip to content

Commit

Permalink
ShapingView: scroll to top when switching to vertical
Browse files Browse the repository at this point in the history
  • Loading branch information
frinkr committed Aug 22, 2017
1 parent 6f188e9 commit f1e546e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion font-tool/ShapingWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,17 @@ - (void)reload {
[self calculateSize];
[self setupTooltips];
[self setNeedsDisplay:YES];
if (_isVertical)
[self scroolToTop];

}

- (void)scroolToTop {
NSScrollView * sv = self.enclosingScrollView;
NSPoint pt = NSMakePoint(0.0, [[sv documentView] bounds].size.height);
[[sv documentView] scrollPoint:pt];
}

- (void)windowDidResize {
[self calculateSize];
[self setupTooltips];
Expand Down Expand Up @@ -354,7 +362,7 @@ - (void)drawRect:(NSRect)rect
CGPoint baselineOrigin = [self baselineOrigin];
if (_options & ShapingViewShowMetricsLines) {
if (_isVertical)
[self lineFrom:baselineOrigin
[self lineFrom:NSMakePoint(baselineOrigin.x, maxY)
to:NSMakePoint(baselineOrigin.x, 0)
dash:NO
color:[NSColor greenColor]];
Expand Down

0 comments on commit f1e546e

Please sign in to comment.