SliderComponent: Remove default super.render and replace with drag logic

This commit is contained in:
noil 2021-01-07 14:18:17 -05:00
parent 8f1e73d275
commit 8884cfed2d
1 changed files with 8 additions and 1 deletions

View File

@ -216,7 +216,14 @@ public final class SliderComponent extends HudComponent {
@Override
public void render(int mouseX, int mouseY, float partialTicks) {
super.render(mouseX, mouseY, partialTicks);
//super.render(mouseX, mouseY, partialTicks);
if (this.isDragging()) {
this.setX(mouseX - this.getDeltaX());
this.setY(mouseY - this.getDeltaY());
this.clamp();
} else if (this.isMouseInside(mouseX, mouseY)) {
RenderUtil.drawRect(this.getX(), this.getY(), this.getX() + this.getW(), this.getY() + this.getH(), 0x45FFFFFF);
}
this.clampSlider();