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

Method showCompleteDrag

src/main/java/fieldcef/plugins/Pads.java:185–208  ·  view source on GitHub ↗
(Box start, Box end)

Source from the content-addressed store, hash-verified

183 protected void showCompleteDrag(Box start, Box end) {
184 this.properties.putToMap(frameDrawing, "__ongoingDrag__", (box) -> {
185
186 Rect f1 = frame(start);
187 Rect f2 = frame(end);
188
189
190 FLine m = TopologyBox.thickenArc(TopologyBox.arc(f1, f2), f1, f2);
191
192 boolean selected = true;
193
194 float o = -0.5f;
195
196 m.attributes.put(fillColor, selected ? new Vec4(1, 1, 1, 1.0f * o) : new Vec4(1, 1, 1, 0.75f * o));
197 m.attributes.put(strokeColor, selected ? new Vec4(1, 1, 1, 0.5f * o) : new Vec4(1, 1, 1, 0.25f * o));
198 m.attributes.put(thicken, new BasicStroke(selected ? 3 : 0.5f, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_MITER));
199
200 m.attributes.put(filled, true);
201 m.attributes.put(stroked, true);
202
203 return m;
204 });
205 Drawing.dirty(this);
206 }
207
208 protected Rect frame(Box hitBox) {
209 return hitBox.properties.get(frame);
210 }
211

Callers 1

button0Method · 0.95

Calls 6

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

Tested by

no test coverage detected