Skip to content

Commit 649be9a

Browse files
author
codeHusky
committed
Fixed scaling
1 parent b1c5d30 commit 649be9a

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

  • src/main/java/com/codehusky/huskyui/states

src/main/java/com/codehusky/huskyui/states/Page.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -316,15 +316,7 @@ public Inventory getPageView() {
316316
int num = 0;
317317
for (final Inventory slot : inventory.slots()) {
318318
if (this.autoPaging) {
319-
if (this.elements.size() > num) {
320-
/*if (this.centered && (num >= ((this.rows - 1) * 9))) {
321-
if (this.elements.size() %2 == 1) {
322-
// TODO: This seems to be unused?
323-
// Yes it is. Indev stuff.
324-
int width = this.elements.size() % 9;
325-
}
326-
}*/
327-
319+
if (this.elements.containsKey(num)) {
328320
slot.set(ItemStack.builder()
329321
.fromContainer(this.elements.get(num).getItem()
330322
.toContainer()
@@ -668,7 +660,7 @@ public PageBuilder setInterrupt(final Runnable interrupt){
668660
* @return a new Page
669661
*/
670662
public Page build(@Nonnull final String id) {
671-
final int rows = (int) Math.ceil(((double) this.elements.size()) / 9d);
663+
final int rows = (this.inventoryDimension == null) ? Math.min(5,(int) Math.ceil(((double) this.elements.size()) / 9d)) : this.inventoryDimension.getRows()-1;
672664
InventoryDimension real = (this.inventoryDimension == null ?
673665
(this.autoPaging) ?
674666
InventoryDimension.of(9, rows + 1) :

0 commit comments

Comments
 (0)