(MeshBuilder m, Curry.Function3<MeshAcceptor, Node, MoveTo, Node> moveTo, Curry.Function3<MeshAcceptor, Node, LineTo, Node> lineTo, Curry.Function3<MeshAcceptor,
Node, CubicTo, Node> cubicTo)
| 1051 | |
| 1052 | Log.log("drawing.trace", () -> "should skip ? " + mod); |
| 1053 | |
| 1054 | return m.skipTo(c.start, c.end, mod, () -> { |
| 1055 | |
| 1056 | flattenAuxProperties(); |
| 1057 | m.open(); |
| 1058 | try { |
| 1059 | MeshBuilder.Bookmark start = null; |
| 1060 | // todo: AUX! |
| 1061 | |
| 1062 | Log.log("drawing.trace", () -> "ACTUALLY DRAWING"); |
| 1063 | |
| 1064 | Node a = null; |
| 1065 | for (int i = 0; i < nodes.size(); i++) { |
| 1066 | Node b = nodes.get(i); |
| 1067 | |
| 1068 | if (b instanceof MoveTo) { |
| 1069 | if (start != null) m.line(start.at() + 1); |
| 1070 | a = moveTo.apply(m, a, (MoveTo) b); |
| 1071 | start = m.bookmark(); |
| 1072 | } else { |
| 1073 | if (b instanceof LineTo) a = lineTo.apply(m, a, (LineTo) b); |
| 1074 | else if (b instanceof CubicTo) a = cubicTo.apply(m, a, (CubicTo) b); |
| 1075 | else throw new IllegalArgumentException(" unknown subclass "); |
| 1076 | if (start == null) start = m.bookmark(); |
| 1077 | |
| 1078 | } |
| 1079 | } |
| 1080 | |
| 1081 | MeshBuilder.Bookmark end = m.bookmark(); |
| 1082 | |
| 1083 | if (start != null && start.at() != end.at()) { |
| 1084 | m.line(start.at() + 1); |
| 1085 | } |
| 1086 | } finally { |
| 1087 | m.close(); |
| 1088 | } |
| 1089 | }); |
| 1090 | } |
| 1091 | |
| 1092 | @HiddenInAutocomplete |
| 1093 | public boolean renderToLine(MeshBuilder m, int fixedSizeForCubic) { |
| 1094 | Log.log("drawing.trace", () -> "renderToLine"); |
| 1095 | return renderToLine(m, this::renderMoveTo, this::renderLineTo, renderCubicTo(fixedSizeForCubic)); |
| 1096 | } |
| 1097 | |
| 1098 | @HiddenInAutocomplete |
| 1099 | public boolean renderLineToMeshByStroking(MeshBuilder m, int fixedSizeForCubic, BasicStroke stroke) { |
| 1100 | BookmarkCache c = cache_thickening.computeIfAbsent(m, (k) -> new BookmarkCache(m)); |
no test coverage detected