MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / swiper

Method swiper

src/main/java/fieldbox/boxes/TimeSlider.java:71–87  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

69 this.properties.put(Boxes.dontSave, true);
70 this.properties.put(Box.name, "TimeSlider");
71
72 this.properties.computeIfAbsent(frameDrawing, this::defaultdrawsLines);
73 this.properties.put(velocity, 0d);
74 }
75
76 protected boolean swiper() {
77 if (was == null) {
78 this.properties.put(velocity, 0d);
79 was = this.properties.get(frame).duplicate();
80 } else {
81 Rect now = this.properties.get(frame);
82 if (now.x == was.x) {
83 this.properties.put(velocity, 0d);
84 } else {
85 this.properties.put(velocity, (double) (now.x - was.x));
86 perform(was, now);
87 }
88 was = now.duplicate();
89 }
90

Callers

nothing calls this directly

Calls 5

performMethod · 0.95
duplicateMethod · 0.95
duplicateMethod · 0.65
getMethod · 0.65
putMethod · 0.45

Tested by

no test coverage detected