mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-14 04:19:12 +00:00
Fix clipboard range feedback in Timeline when we copy layers/frames
kCels were already working, but the clipping was not correct when the clipboard range type was kLayers or kFrames.
This commit is contained in:
parent
fac3574d02
commit
bf0e5db391
@ -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) {
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user