From 7c4c9b55c0ce4ffe6bf4f5111e0f99ad7d36a152 Mon Sep 17 00:00:00 2001 From: Bernhard Bonigl Date: Thu, 11 Sep 2014 17:24:30 +0200 Subject: [PATCH] Fix smeltery gui scrolling --- .../java/tconstruct/smeltery/inventory/SmelteryContainer.java | 2 +- .../tconstruct/smeltery/inventory/SmelteryContainerOld.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/tconstruct/smeltery/inventory/SmelteryContainer.java b/src/main/java/tconstruct/smeltery/inventory/SmelteryContainer.java index 7d0c2f77..9a25dae2 100644 --- a/src/main/java/tconstruct/smeltery/inventory/SmelteryContainer.java +++ b/src/main/java/tconstruct/smeltery/inventory/SmelteryContainer.java @@ -80,7 +80,7 @@ public class SmelteryContainer extends ActiveContainer public int scrollTo (float scrollPos) { float total = (logic.getSizeInventory() - 24) / 3; - int rowPos = (int) (total * scrollPos); + int rowPos = Math.round(total * scrollPos); return updateRows(rowPos); } diff --git a/src/main/java/tconstruct/smeltery/inventory/SmelteryContainerOld.java b/src/main/java/tconstruct/smeltery/inventory/SmelteryContainerOld.java index cb995d81..8dba87f2 100644 --- a/src/main/java/tconstruct/smeltery/inventory/SmelteryContainerOld.java +++ b/src/main/java/tconstruct/smeltery/inventory/SmelteryContainerOld.java @@ -74,7 +74,7 @@ public class SmelteryContainerOld extends ActiveContainer public int scrollTo (float scrollPos) { float total = (logic.getSizeInventory() - 24) / 3; - int rowPos = (int) (total * scrollPos); + int rowPos = Math.round(total * scrollPos); return updateRows(rowPos); }