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

Method boxScale

src/main/java/fieldbox/boxes/FLineDrawing.java:120–127  ·  view source on GitHub ↗
(Function<Box, FLine> wrap)

Source from the content-addressed store, hash-verified

118 }
119
120 static public Function<Box, FLine> boxScale(Function<Box, FLine> wrap) {
121 return new Cached<Box, Object, FLine>((box, previously) -> {
122 Rect frame = box.properties.get(Box.frame);
123 if (frame == null) return null;
124 return wrap.apply(box)
125 .byTransforming((pos) -> new Vec3(frame.x + pos.x * frame.w, frame.y + pos.y * frame.h, pos.z));
126 }, (box) -> new Pair<>(box.properties.get(frame), box.properties.isTrue(Mouse.isSelected, false)));
127 }
128
129 static public Supplier<FLine> boxScale(Supplier<FLine> wrap, Box inside) {
130 return new Cached<Box, Object, FLine>((box, previously) -> {

Callers 1

Calls 5

byTransformingMethod · 0.80
isTrueMethod · 0.80
toSupplierMethod · 0.80
getMethod · 0.65
applyMethod · 0.65

Tested by

no test coverage detected