[Fix] Panels only work when placed in origin

This commit is contained in:
Frank 2022-08-16 22:28:46 +02:00
parent 24a284c95b
commit 883a7100a5

View file

@ -97,7 +97,10 @@ public class Panel implements ComponentWithBounds, RelativeContainerEventHandler
@Override
public void render(PoseStack poseStack, int mouseX, int mouseY, float deltaTicks) {
if (child != null) {
poseStack.pushPose();
poseStack.translate(bounds.left, bounds.top, 0);
child.render(poseStack, mouseX - bounds.left, mouseY - bounds.top, deltaTicks, bounds, bounds);
poseStack.popPose();
}
}