From b92284180f3c58361180f9e5fb1062ba5560466e Mon Sep 17 00:00:00 2001 From: shedaniel Date: Sat, 20 Nov 2021 15:15:43 +0800 Subject: Round Dispose here bounds --- .../shedaniel/rei/impl/client/gui/widget/FavoritesListWidget.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'runtime/src/main/java') diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/FavoritesListWidget.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/FavoritesListWidget.java index aec7a5950..95c050e76 100644 --- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/FavoritesListWidget.java +++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/FavoritesListWidget.java @@ -255,7 +255,7 @@ public class FavoritesListWidget extends WidgetWithBounds implements DraggableSt this.trashBoundsHeight.update(delta); double trashBoundsHeight = this.trashBoundsHeight.value(); - if (trashBoundsHeight > 0) { + if (Math.round(trashBoundsHeight) > 0) { double trashBoundsHeightTarget = Math.min(150D, fullBounds.height * 0.15D); double progress = Math.pow(Mth.clamp(trashBoundsHeight / trashBoundsHeightTarget, 0, 1), 7); int y = this.fullBounds.getMaxY() - 4 - favoritePanel.getBounds().height; @@ -289,9 +289,9 @@ public class FavoritesListWidget extends WidgetWithBounds implements DraggableSt systemHeight += 4; } if (favoritePanel.getBounds().height > 20) - region.getBounds().setBounds(this.fullBounds.x, this.fullBounds.y + systemHeight, this.fullBounds.width, this.fullBounds.height - systemHeight - (this.fullBounds.getMaxY() - this.favoritePanel.bounds.y) - 4 - (trashBoundsHeight <= 0 ? 0 : trashBoundsHeight)); + region.getBounds().setBounds(this.fullBounds.x, this.fullBounds.y + systemHeight, this.fullBounds.width, this.fullBounds.height - systemHeight - (this.fullBounds.getMaxY() - this.favoritePanel.bounds.y) - 4 - (Math.round(trashBoundsHeight) <= 0 ? 0 : trashBoundsHeight)); else - region.getBounds().setBounds(this.fullBounds.x, this.fullBounds.y + systemHeight, this.fullBounds.width, this.fullBounds.height - systemHeight - (trashBoundsHeight <= 0 ? 0 : trashBoundsHeight + 24)); + region.getBounds().setBounds(this.fullBounds.x, this.fullBounds.y + systemHeight, this.fullBounds.width, this.fullBounds.height - systemHeight - (Math.round(trashBoundsHeight) <= 0 ? 0 : trashBoundsHeight + 24)); systemRegion.render(matrices, mouseX, mouseY, delta); region.render(matrices, mouseX, mouseY, delta); renderAddFavorite(matrices, mouseX, mouseY, delta); -- cgit