DocumentContainer constrains its scroll position on resize

This commit is contained in:
Sasha Koshka 2023-03-11 20:04:08 -05:00
parent b7a7800370
commit 5afbc0e713

View File

@ -186,6 +186,12 @@ func (element *DocumentContainer) redoAll () {
// do a layout
element.doLayout()
maxScrollHeight := element.maxScrollHeight()
if element.scroll.Y > maxScrollHeight {
element.scroll.Y = maxScrollHeight
element.doLayout()
}
// draw a background
rocks := make([]image.Rectangle, len(element.children))