mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-28 16:20:50 +00:00
Timeline: Limit the vertical separator min/max position (fix #2436)
This commit is contained in:
parent
5a24a7c6b4
commit
7170762f08
@ -1064,7 +1064,7 @@ bool Timeline::onProcessMessage(Message* msg)
|
|||||||
// we shouldn't change the hot (so the separator can be
|
// we shouldn't change the hot (so the separator can be
|
||||||
// tracked to the mouse's released).
|
// tracked to the mouse's released).
|
||||||
if (m_clk.part == PART_SEPARATOR) {
|
if (m_clk.part == PART_SEPARATOR) {
|
||||||
m_separator_x = std::max(0, mousePos.x);
|
setSeparatorX(mousePos.x);
|
||||||
layout();
|
layout();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -1532,6 +1532,7 @@ void Timeline::onResize(ui::ResizeEvent& ev)
|
|||||||
std::min(sz.w, m_separator_x),
|
std::min(sz.w, m_separator_x),
|
||||||
oneTagHeight()));
|
oneTagHeight()));
|
||||||
|
|
||||||
|
setSeparatorX(m_separator_x);
|
||||||
updateScrollBars();
|
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
|
} // namespace app
|
||||||
|
@ -357,6 +357,8 @@ namespace app {
|
|||||||
void setLayerContinuousFlag(const layer_t layer, const bool state);
|
void setLayerContinuousFlag(const layer_t layer, const bool state);
|
||||||
void setLayerCollapsedFlag(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_hbar;
|
||||||
ui::ScrollBar m_vbar;
|
ui::ScrollBar m_vbar;
|
||||||
gfx::Rect m_viewportArea;
|
gfx::Rect m_viewportArea;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user