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

Method bound

src/main/java/fieldbox/boxes/MarkingMenus.java:549–563  ·  view source on GitHub ↗
(Vec2 center, FLine fo)

Source from the content-addressed store, hash-verified

547 }
548
549 private FLine bound(Vec2 center, FLine fo) {
550
551 Drawing d = find(Drawing.drawing, both()).findFirst().get();
552 Rect b = d.getCurrentViewBounds(this).inset(10);
553
554 Shape s1 = FLinesAndJavaShapes.flineToJavaShape(fo);
555 Shape s2 = FLinesAndJavaShapes.flineToJavaShape(new FLine().circle(center.x, center.y, Math.min(b.w, b.h) / 2));
556
557 Area a1 = new Area(s1);
558 Area a2 = new Area(s2);
559
560 a1.intersect(a2);
561
562 return FLinesAndJavaShapes.javaShapeToFLine(a1);
563 }
564
565 public void hide() {
566 this.properties.remove(frameDrawing);

Callers 1

showMethod · 0.95

Calls 10

getCurrentViewBoundsMethod · 0.95
flineToJavaShapeMethod · 0.95
javaShapeToFLineMethod · 0.95
getMethod · 0.65
findMethod · 0.45
bothMethod · 0.45
insetMethod · 0.45
circleMethod · 0.45
minMethod · 0.45
intersectMethod · 0.45

Tested by

no test coverage detected