adjust scrolling

This commit is contained in:
Skiftcha committed 2020-11-24 09:10:48 +03:00
1 parent 3ae2128564
commit 587afa8e1d
2 files changed
+3 -9

No files matched your search

@@ -78,8 +78,8 @@ public class GuiScrollbar {
if (x > displayX && x <= displayX + width) {
if (y > displayY && y <= displayY + scrollHeight) {
int currentScroll = (y - displayY);
currentScroll = Math.round(1.0f * currentScroll / scrollHeight) * getMaxScroll();
int currentScroll = (y - displayY - height / 2);
currentScroll = Math.round(1.0f * currentScroll * getMaxScroll() / (scrollHeight - height));
setCurrentScroll(applyRange(currentScroll));
}
}
@@ -141,13 +141,7 @@ public class InventoryChiselSelection implements IInventory {
if (!((IChiselItem) chisel.getItem()).canChisel(container.playerInventory.player.worldObj, chisel, General.getVariation(chiseledItem)))
return;
List<ItemStack> list2 = container.carving.getItemsForChiseling(chiseledItem);
// DEBUG! REMOVE:
List<ItemStack> list = new ArrayList<>(list2);
list.addAll(list2);
if (list.size() > 61) {
list = list.subList(0, 61);
}
List<ItemStack> list = container.carving.getItemsForChiseling(chiseledItem);
maxScroll = list.size();
int activeVariations = 0;
while (activeVariations < normalSlots && activeVariations + currentScroll < list.size()) {