1
0
mirror of https://github.com/aseprite/aseprite.git synced 2025-03-25 10:43:46 +00:00

Timeline: Limit the vertical separator min/max position (fix )

This commit is contained in:
David Capello 2020-06-11 15:30:06 -03:00
parent 5a24a7c6b4
commit 7170762f08
2 changed files with 9 additions and 1 deletions
src/app/ui/timeline

@ -1064,7 +1064,7 @@ bool Timeline::onProcessMessage(Message* msg)
// we shouldn't change the hot (so the separator can be
// tracked to the mouse's released).
if (m_clk.part == PART_SEPARATOR) {
m_separator_x = std::max(0, mousePos.x);
setSeparatorX(mousePos.x);
layout();
return true;
}
@ -1532,6 +1532,7 @@ void Timeline::onResize(ui::ResizeEvent& ev)
std::min(sz.w, m_separator_x),
oneTagHeight()));
setSeparatorX(m_separator_x);
updateScrollBars();
}
@ -4215,4 +4216,9 @@ void Timeline::setLayerCollapsedFlag(const layer_t l, const bool state)
}
}
void Timeline::setSeparatorX(int newValue)
{
m_separator_x = base::clamp(newValue, headerBoxWidth(), bounds().w-guiscale());
}
} // namespace app

@ -357,6 +357,8 @@ namespace app {
void setLayerContinuousFlag(const layer_t layer, const bool state);
void setLayerCollapsedFlag(const layer_t layer, const bool state);
void setSeparatorX(int newValue);
ui::ScrollBar m_hbar;
ui::ScrollBar m_vbar;
gfx::Rect m_viewportArea;