mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-04 06:40:07 +00:00
Keep editor scroll when the timeline is hidden/shown
This is not complete yet, there is a little flicker.
This commit is contained in:
parent
5010d01356
commit
a77300f96a
@ -87,10 +87,19 @@ void EditorView::onPaint(PaintEvent& ev)
|
|||||||
|
|
||||||
void EditorView::onResize(ResizeEvent& ev)
|
void EditorView::onResize(ResizeEvent& ev)
|
||||||
{
|
{
|
||||||
// This avoid the displacement of the widgets in the viewport
|
Editor* editor = this->editor();
|
||||||
|
gfx::Point oldPos;
|
||||||
|
if (editor)
|
||||||
|
oldPos = editor->editorToScreen(gfx::Point(0, 0));
|
||||||
|
|
||||||
setBoundsQuietly(ev.getBounds());
|
View::onResize(ev);
|
||||||
updateView();
|
|
||||||
|
if (editor) {
|
||||||
|
// This keeps the same scroll position for the editor
|
||||||
|
gfx::Point newPos = editor->editorToScreen(gfx::Point(0, 0));
|
||||||
|
gfx::Point oldScroll = getViewScroll();
|
||||||
|
editor->setEditorScroll(oldScroll + newPos - oldPos, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditorView::onScrollChange()
|
void EditorView::onScrollChange()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user