From c83e0ca68d04c5934ef488b5e9ab6ca297b16263 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sat, 2 Dec 2017 22:18:43 -0800 Subject: [PATCH] Do quite a bit less work on resizing the timeline. Fix #175. --- Evergreen/MainWindow/Timeline/Cell/TimelineCellLayout.swift | 3 ++- .../MainWindow/Timeline/Cell/TimelineTableCellView.swift | 1 - Frameworks/RSTextDrawing/RSTextDrawing/RSSingleLineView.m | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Evergreen/MainWindow/Timeline/Cell/TimelineCellLayout.swift b/Evergreen/MainWindow/Timeline/Cell/TimelineCellLayout.swift index a981589ef..50f4dfac0 100644 --- a/Evergreen/MainWindow/Timeline/Cell/TimelineCellLayout.swift +++ b/Evergreen/MainWindow/Timeline/Cell/TimelineCellLayout.swift @@ -62,7 +62,8 @@ private func rectForDate(_ cellData: TimelineCellData, _ width: CGFloat, _ appea r.origin.y = NSMaxY(titleRect) + appearance.titleBottomMargin r.origin.x = appearance.boxLeftMargin - r.size.width = max(width - (r.origin.x + appearance.cellPadding.right), 0.0) + r.size.width = min(width - (r.origin.x + appearance.cellPadding.right), r.size.width) + r.size.width = max(r.size.width, 0.0) return r } diff --git a/Evergreen/MainWindow/Timeline/Cell/TimelineTableCellView.swift b/Evergreen/MainWindow/Timeline/Cell/TimelineTableCellView.swift index dd37e3ae1..969c8c04d 100644 --- a/Evergreen/MainWindow/Timeline/Cell/TimelineTableCellView.swift +++ b/Evergreen/MainWindow/Timeline/Cell/TimelineTableCellView.swift @@ -96,7 +96,6 @@ class TimelineTableCellView: NSTableCellView { } super.setFrameSize(newSize) - updateSubviews() needsLayout = true } diff --git a/Frameworks/RSTextDrawing/RSTextDrawing/RSSingleLineView.m b/Frameworks/RSTextDrawing/RSTextDrawing/RSSingleLineView.m index ef08de438..af7d442ce 100644 --- a/Frameworks/RSTextDrawing/RSTextDrawing/RSSingleLineView.m +++ b/Frameworks/RSTextDrawing/RSTextDrawing/RSSingleLineView.m @@ -53,7 +53,10 @@ static NSAttributedString *emptyAttributedString = nil; - (void)setRenderer:(RSSingleLineRenderer *)renderer { - + + if (_renderer == renderer) { + return; + } _renderer = renderer; [self invalidateIntrinsicContentSize]; self.needsDisplay = YES;