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

Method abut

src/main/java/fieldbox/boxes/plugins/Alignment.java:140–151  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

138 }
139
140 protected void abut() {
141 List<Box> s = selected().sorted((a, b) -> Float.compare(a.properties.get(Box.frame).x, b.properties.get(Box.frame).x))
142 .collect(Collectors.toList());
143 float ax = s.get(0).properties.get(Box.frame).x + s.get(0).properties.get(Box.frame).w;
144 for (int i = 1; i < s.size(); i++) {
145 final float finalAx = ax;
146 set(s.get(i), z -> {
147 z.x = finalAx;
148 });
149 ax = s.get(i).properties.get(Box.frame).x + s.get(i).properties.get(Box.frame).w;
150 }
151 }
152
153 private void set(Box b, Consumer<Rect> r) {
154 Callbacks.frameModified(b, r);

Callers

nothing calls this directly

Calls 6

selectedMethod · 0.95
setMethod · 0.95
collectMethod · 0.80
getMethod · 0.65
compareMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected