MCPcopy Create free account
hub / github.com/5zig/The-5zig-Mod / mouseClicked

Method mouseClicked

Minecraft-Utils/1.10.2/src/Slider.java:88–104  ·  view source on GitHub ↗
(int x, int y)

Source from the content-addressed store, hash-verified

86 }
87
88 @Override
89 public boolean mouseClicked(int x, int y) {
90 if (super.mouseClicked(x, y)) {
91 this.value = (x - (this.h + 4)) / (float) (this.f - 8);
92 if (this.value < 0.0F) {
93 this.value = 0.0F;
94 }
95 if (this.value > 1.0F) {
96 this.value = 1.0F;
97 }
98
99 setLabel(this.str + getValue());
100 this.dragging = true;
101 return true;
102 }
103 return false;
104 }
105
106 private String getValue() {
107 String customValue = sliderItem.getCustomValue(value);

Callers

nothing calls this directly

Calls 3

setLabelMethod · 0.95
getValueMethod · 0.95
mouseClickedMethod · 0.65

Tested by

no test coverage detected