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

Method error

src/main/java/trace/graphics/Tops.kt:219–244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

217 }
218
219 fun error(b: Box, text: String) {
220 if (b.properties.get(FLineDrawing.frameDrawing) == null) return
221 b.properties.putToMap(FLineDrawing.frameDrawing, "__tops_error__", java.util.function.Function<Box, FLine> {
222
223 val frame = it.properties.get(Box.frame)
224
225 var f = FLine()
226
227 val shim = 5
228
229 val O = Math.max(20.0, Math.min(frame.w, frame.h) / 3.0);
230 f.moveTo((frame.x + frame.w + shim).toDouble(), (frame.y + frame.h - O - shim).toDouble())
231 f.lineTo((frame.x + frame.w + shim).toDouble(), (frame.y + frame.h + shim).toDouble())
232 f.lineTo((frame.x + frame.w - O - shim).toDouble(), (frame.y + frame.h + shim).toDouble())
233 f.lineTo((frame.x + frame.w + shim).toDouble(), (frame.y + frame.h - O - shim).toDouble())
234
235 f.attributes += StandardFLineDrawing.filled to true
236 f.attributes += StandardFLineDrawing.stroked to true
237 f.attributes += StandardFLineDrawing.fillColor to Vec4(0.5, 0, 0, -0.75)
238 f.attributes += StandardFLineDrawing.strokeColor to Vec4(0.5, 0, 0, 0.75)
239
240 f
241 })
242
243 (b.asMap_get("label") as MutableMap<String, String>).put("s", text)
244 }
245
246 fun noError(b: Box) {
247 if (b.properties.get(FLineDrawing.frameDrawing) == null) return

Callers 15

preamble2.jsFile · 0.45
jshint.jsFile · 0.45
deprecatedFunction · 0.45
traceFunction · 0.45
instantiate.jsFile · 0.45
notifyFunction · 0.45
obFunction · 0.45
preamble.jsFile · 0.45
doRequestFunction · 0.45
def.jsFile · 0.45
run.jsFile · 0.45

Calls 10

FLineClass · 0.85
putToMapMethod · 0.80
getMethod · 0.65
asMap_getMethod · 0.65
Vec4Class · 0.50
putMethod · 0.45
maxMethod · 0.45
minMethod · 0.45
moveToMethod · 0.45
lineToMethod · 0.45

Tested by

no test coverage detected