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

Method fixDrawingSpace

src/main/java/fieldbox/boxes/Mouse.java:170–183  ·  view source on GitHub ↗
(Optional<Drawing> drawing, Window.MouseState after)

Source from the content-addressed store, hash-verified

168 }
169
170 private void fixDrawingSpace(Optional<Drawing> drawing, Window.MouseState after) {
171 Vec2 af = drawing.map(x -> x.windowSystemToDrawingSystem(new Vec2(after.x, after.y)))
172 .get();
173
174 after.mx = af.x;
175 after.my = af.y;
176
177 Vec2 daf = drawing.map(x -> x.windowSystemToDrawingSystemDelta(new Vec2(after.dx, after.dy)))
178 .get();
179
180 after.mdx = daf.x;
181 after.mdy = daf.y;
182
183 }
184
185 public interface Dragger {
186 boolean update(Window.Event<Window.MouseState> e, boolean termination);

Callers 1

dispatchMethod · 0.95

Calls 4

getMethod · 0.65
mapMethod · 0.45

Tested by

no test coverage detected