ensure scrollable lists are centered in the visible viewport

develop
Myk Taylor 2023-02-06 12:54:05 -08:00
parent f602548540
commit 0b9b258224
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
2 changed files with 2 additions and 0 deletions

@ -38,6 +38,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences:
## Fixes
- ``Units::isFortControlled``: Account for agitated wildlife
- Fix right click sometimes closing both a DFHack window and a vanilla panel
- Fixed issue with scrollable lists having some data off-screen if they were scrolled before being made visible
## Misc Improvements
- `automelt`: is now more resistent to savegame corruption

@ -1634,6 +1634,7 @@ end
function List:postComputeFrame(body)
self.page_size = math.max(1, math.floor(body.height / self.row_height))
self.page_top = math.max(1, math.min(#self.choices - self.page_size + 1))
update_list_scrollbar(self)
end