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

Method showIncompleteDrag

src/main/java/fieldcef/plugins/Pads.java:146–169  ·  view source on GitHub ↗
(Box start, Vec2 to)

Source from the content-addressed store, hash-verified

144 protected void showIncompleteDrag(Box start, Vec2 to) {
145 this.properties.putToMap(frameDrawing, "__ongoingDrag__", (box) -> {
146
147 Rect f1 = frame(start);
148
149 FLine m = TopologyBox.thickenArc(TopologyBox.arc(f1, new Rect(to.x - 10, to.y - 10, 20, 20)), f1, new Rect(to.x - 10, to.y - 10, 20, 20));
150
151 boolean selected = false;
152
153 float o = -0.5f;
154
155 m.attributes.put(fillColor, selected ? new Vec4(1, 1, 1, 1.0f * o) : new Vec4(1, 1, 1, 0.5f * o));
156 m.attributes.put(strokeColor, selected ? new Vec4(1, 1, 1, 0.25f * o) : new Vec4(1, 1, 1, 0.1f * o));
157 m.attributes.put(thicken, new BasicStroke(selected ? 3 : 0.5f, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_MITER));
158
159 m.attributes.put(filled, true);
160 m.attributes.put(stroked, true);
161
162 m.rect(to.x - 10, to.y - 10, 20, 20);
163
164 return m;
165 });
166 Drawing.dirty(this);
167 }
168
169 protected float order(Rect r) {
170 return Math.abs(r.w) + Math.abs(r.h);
171 }
172

Callers 1

button0Method · 0.95

Calls 7

frameMethod · 0.95
thickenArcMethod · 0.95
arcMethod · 0.95
rectMethod · 0.95
dirtyMethod · 0.95
putToMapMethod · 0.80
putMethod · 0.45

Tested by

no test coverage detected