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