From 651759ddc39086e028c40460be60d09587b98419 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Mon, 6 Mar 2023 15:18:04 +0700 Subject: [PATCH] Actual scroll position remember in pattern screen --- .../otm/client/screen/matter/MatterPanelScreen.kt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/matter/MatterPanelScreen.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/matter/MatterPanelScreen.kt index f5c9b847f..54d007f49 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/matter/MatterPanelScreen.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/matter/MatterPanelScreen.kt @@ -62,13 +62,16 @@ class MatterPanelScreen( val scrollBar = DiscreteScrollBarPanel(this, frame, { if (isPatternView) { - scrollPatterns = integerDivisionDown(menu.patterns.size, GRID_WIDTH) - scrollPatterns + integerDivisionDown(menu.patterns.size, GRID_WIDTH) } else { - scrollTasks = integerDivisionDown(menu.tasks.size, GRID_WIDTH) - scrollTasks + integerDivisionDown(menu.tasks.size, GRID_WIDTH) } - }, { _, _, _ -> }) + }, { _, _, new -> + if (isPatternView) + scrollPatterns = new + else + scrollTasks = new + }) scrollBar.dock = Dock.RIGHT