(MeshBuilder m, Curry.Function3<MeshAcceptor, Node, MoveTo, Node> moveTo, Curry.Function3<MeshAcceptor, Node, LineTo, Node> lineTo, Curry.Function3<MeshAcceptor,
Node, CubicTo, Node> cubicTo)
| 1118 | |
| 1119 | return m.skipTo(c.start, c.end, mod, () -> { |
| 1120 | |
| 1121 | MeshBuilder_tesselationSupport ts = m.getTessSupport(); |
| 1122 | flattenAuxProperties(); |
| 1123 | |
| 1124 | boolean noContours = attributes.isTrue(StandardFLineDrawing.noContours, false); |
| 1125 | |
| 1126 | m.open(); |
| 1127 | try { |
| 1128 | MeshBuilder.Bookmark start = null; |
| 1129 | |
| 1130 | Node a = null; |
| 1131 | if (!noContours) |
| 1132 | ts.begin(); |
| 1133 | |
| 1134 | for (int i = 0; i < nodes.size(); i++) { |
| 1135 | Node b = nodes.get(i); |
| 1136 | |
| 1137 | if (b instanceof MoveTo) { |
| 1138 | |
| 1139 | if (start != null) { |
| 1140 | if (!noContours) |
| 1141 | ts.endContour(); |
| 1142 | else ts.end(); |
| 1143 | } |
| 1144 | if (!noContours) |
| 1145 | ts.beginContour(); |
| 1146 | else ts.begin(); |
| 1147 | |
| 1148 | |
| 1149 | a = moveTo.apply(ts, a, (MoveTo) b); |
| 1150 | start = m.bookmark(); |
| 1151 | } else { |
| 1152 | if (b instanceof LineTo) a = lineTo.apply(ts, a, (LineTo) b); |
| 1153 | else if (b instanceof CubicTo) a = cubicTo.apply(ts, a, (CubicTo) b); |
| 1154 | else throw new IllegalArgumentException(" unknown subclass "); |
| 1155 | if (start == null) { |
| 1156 | start = m.bookmark(); |
| 1157 | if (!noContours) |
| 1158 | ts.beginContour(); |
| 1159 | else ts.begin(); |
| 1160 | } |
| 1161 | |
| 1162 | } |
| 1163 | } |
| 1164 | |
| 1165 | MeshBuilder.Bookmark end = m.bookmark(); |
| 1166 | |
| 1167 | if (start != null && start.at() != end.at()) { |
| 1168 | if (!noContours) |
| 1169 | ts.endContour(); |
| 1170 | else ts.end(); |
| 1171 | } |
| 1172 | if (!noContours) |
| 1173 | ts.end(); |
| 1174 | } finally { |
| 1175 | m.close(); |
| 1176 | } |
| 1177 | }); |
no test coverage detected