diff --git a/src/app/ui/timeline/timeline.cpp b/src/app/ui/timeline/timeline.cpp index 11f6f73b1..201b15a32 100644 --- a/src/app/ui/timeline/timeline.cpp +++ b/src/app/ui/timeline/timeline.cpp @@ -1791,7 +1791,7 @@ void Timeline::drawClipboardRange(ui::Graphics* g) if (!m_clipboard_timer.isRunning()) m_clipboard_timer.start(); - IntersectClip clip(g, getCelsBounds()); + IntersectClip clip(g, getRangeClipBounds(clipboard_range)); if (clip) { CheckedDrawMode checked(g, m_offset_count, gfx::rgba(0, 0, 0, 255), @@ -2346,13 +2346,7 @@ void Timeline::drawRangeOutline(ui::Graphics* g) { auto& styles = skinTheme()->styles; - gfx::Rect clipBounds; - switch (m_range.type()) { - case Range::kCels: clipBounds = getCelsBounds(); break; - case Range::kFrames: clipBounds = getFrameHeadersBounds(); break; - case Range::kLayers: clipBounds = getLayerHeadersBounds(); break; - } - IntersectClip clip(g, clipBounds.enlarge(outlineWidth())); + IntersectClip clip(g, getRangeClipBounds(m_range).enlarge(outlineWidth())); if (!clip) return; @@ -2703,6 +2697,17 @@ gfx::Rect Timeline::getRangeBounds(const Range& range) const return rc; } +gfx::Rect Timeline::getRangeClipBounds(const Range& range) const +{ + gfx::Rect clipBounds; + switch (range.type()) { + case Range::kCels: clipBounds = getCelsBounds(); break; + case Range::kFrames: clipBounds = getFrameHeadersBounds(); break; + case Range::kLayers: clipBounds = getLayerHeadersBounds(); break; + } + return clipBounds; +} + void Timeline::invalidateHit(const Hit& hit) { if (hit.band >= 0) { diff --git a/src/app/ui/timeline/timeline.h b/src/app/ui/timeline/timeline.h index ef612683a..71b325902 100644 --- a/src/app/ui/timeline/timeline.h +++ b/src/app/ui/timeline/timeline.h @@ -261,6 +261,7 @@ namespace app { gfx::Rect getCelsBounds() const; gfx::Rect getPartBounds(const Hit& hit) const; gfx::Rect getRangeBounds(const Range& range) const; + gfx::Rect getRangeClipBounds(const Range& range) const; void invalidateHit(const Hit& hit); void invalidateLayer(const Layer* layer); void invalidateFrame(const frame_t frame);