SliderComponent: Remove default super.render and replace with drag logic
This commit is contained in:
parent
8f1e73d275
commit
8884cfed2d
|
@ -216,7 +216,14 @@ public final class SliderComponent extends HudComponent {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(int mouseX, int mouseY, float partialTicks) {
|
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();
|
this.clampSlider();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue