From 8dce6fb0dfcccb61f3bbbec51e16585ed7c7c29a Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Wed, 6 Sep 2017 15:09:46 +0200 Subject: [PATCH] Fixed scrollbar not scrolling correctly when clicked with mouse when grid tabs are visible, fixes #1449 --- CHANGELOG.md | 1 + .../java/com/raoulvdberge/refinedstorage/gui/Scrollbar.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 250fe18fe..c3ea9c467 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - Fixed bug where when multiple Fortune Upgrades are inserted, it chooses the first Fortune Upgrade instead of the highest one (raoulvdberge) - Fixed some translations having too big "Craft" text (raoulvdberge) - Fixed crash with GUI when toggling the Grid size quickly (raoulvdberge) +- Fixed scrollbar not scrolling correctly when clicked with mouse when grid tabs are visible (raoulvdberge) - The Fortune Upgrade doesn't use NBT anymore to store the fortune level (raoulvdberge) - Pressing SHIFT over an item in the Grid will no longer display the full unformatted count, instead, use CTRL + SHIFT and it will be displayed in the tooltip (raoulvdberge) diff --git a/src/main/java/com/raoulvdberge/refinedstorage/gui/Scrollbar.java b/src/main/java/com/raoulvdberge/refinedstorage/gui/Scrollbar.java index dc2c8c1cc..fd191851c 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/gui/Scrollbar.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/gui/Scrollbar.java @@ -63,7 +63,7 @@ public class Scrollbar { wasClicking = down; if (isScrolling) { - setOffset((int) Math.floor((float) (mouseY - SCROLLER_HEIGHT) / (float) (height - SCROLLER_HEIGHT) * (float) maxOffset)); + setOffset((int) Math.floor((float) (mouseY - y) / (float) (height - SCROLLER_HEIGHT) * (float) maxOffset)); } } }