Deselect timeline range in "auto select layer" mode if we just click the active layer

Fix: https://community.aseprite.org/t/8610
This commit is contained in:
David Capello 2021-04-08 15:21:11 -03:00
parent f91c07825b
commit f1b02a3347
2 changed files with 13 additions and 4 deletions

View File

@ -88,8 +88,6 @@ MovingCelState::MovingCelState(Editor* editor,
, m_celList(collect.celList())
, m_celOffset(0.0, 0.0)
, m_celScale(1.0, 1.0)
, m_hasReference(false)
, m_scaled(false)
, m_handle(handle)
, m_editor(editor)
{
@ -190,6 +188,13 @@ bool MovingCelState::onMouseUp(Editor* editor, MouseMessage* msg)
// like to update all the editors.
document->notifyGeneralUpdate();
}
// Just a click in the current layer
else if (!m_moved & !m_scaled) {
// Deselect the whole range if we are in "Auto Select Layer"
if (editor->isAutoSelectLayer()) {
App::instance()->timeline()->clearAndInvalidateRange();
}
}
// Restore the mask visibility.
if (m_maskVisible) {
@ -220,6 +225,8 @@ bool MovingCelState::onMouseMove(Editor* editor, MouseMessage* msg)
m_celOffset.y = 0;
}
}
if (!m_moved && intCelOffset() != gfx::Point(0, 0))
m_moved = true;
break;
case ScaleSEHandle: {
@ -248,6 +255,7 @@ bool MovingCelState::onMouseMove(Editor* editor, MouseMessage* msg)
if (cel->layer()->isReference()) {
celBounds.x += m_celOffset.x;
celBounds.y += m_celOffset.y;
m_moved = true;
if (m_scaled) {
celBounds.w *= m_celScale.w;
celBounds.h *= m_celScale.h;

View File

@ -68,8 +68,9 @@ namespace app {
gfx::SizeF m_celMainSize;
gfx::SizeF m_celScale;
bool m_maskVisible;
bool m_hasReference;
bool m_scaled;
bool m_hasReference = false;
bool m_moved = false;
bool m_scaled = false;
HandleType m_handle;
Editor* m_editor;