MCPcopy Create free account
hub / github.com/HumbleUI/Skija / drawMakes

Method drawMakes

examples/scenes/src/PathsScene.java:186–349  ·  view source on GitHub ↗
(Canvas canvas)

Source from the content-addressed store, hash-verified

184 }
185
186 private void drawMakes(Canvas canvas) {
187 canvas.save();
188 try (var paint = new Paint().setColor(0xFF437AA0).setMode(PaintMode.STROKE).setStrokeWidth(1f)) {
189
190 try (Path path = Path.makeFromSVGString("M4.886 3.21a1 1 0 0 1 .812-.19l7.698 1.56.338.076a7.67 7.67 0 0 1 5.806 7.266v.346l-.008.329 1.197 1.197a1 1 0 0 1 0 1.414l-5.523 5.522a1 1 0 0 1-1.413 0l-1.198-1.197-.328.008a7.67 7.67 0 0 1-7.612-5.806l-.077-.338L3.02 5.7a1 1 0 0 1 .274-.906l1.5-1.5zm.674 9.99a6.666 6.666 0 0 0 6.383 5.342h.3l.756-.018 1.5 1.5 5.523-5.522-1.5-1.5.018-.756a6.67 6.67 0 0 0-5.048-6.619l-.295-.066L5.5 4l-.396.397 5.16 5.16A3 3 0 0 1 12 9.001 3.001 3.001 0 0 1 12 15a3 3 0 0 1-2.444-4.737l-5.16-5.16L4 5.5zM12 10.001a2 2 0 0 0-2 2l.01.204a2 2 0 0 0 1.786 1.785L12 14a2 2 0 0 0 1.989-1.795l.01-.204a2 2 0 0 0-1.795-1.99z");) {
191 canvas.drawPath(path, paint);
192 canvas.translate(50, 0);
193 }
194
195 // makeRaw(points, verbs, conicWeights, fillMode) - triangle with line
196 try (Path path = Path.makeRaw(
197 new Point[] {
198 new Point(20, 5),
199 new Point(35, 35),
200 new Point(5, 35)
201 },
202 new PathVerb[] {
203 PathVerb.MOVE,
204 PathVerb.LINE,
205 PathVerb.LINE,
206 PathVerb.CLOSE
207 },
208 new float[] {},
209 PathFillMode.WINDING
210 )) {
211 canvas.drawPath(path, paint);
212 canvas.translate(50, 0);
213 }
214
215 // makeRaw(points, verbs, conicWeights, fillMode, isVolatile) - quad curve
216 try (Path path = Path.makeRaw(
217 new Point[] {
218 new Point(0, 20),
219 new Point(20, 0),
220 new Point(40, 20)
221 },
222 new PathVerb[] {
223 PathVerb.MOVE,
224 PathVerb.QUAD
225 },
226 new float[] {},
227 PathFillMode.WINDING,
228 true
229 )) {
230 canvas.drawPath(path, paint);
231 canvas.translate(50, 0);
232 }
233
234 // makeRect(rect)
235 try (Path path = Path.makeRect(Rect.makeLTRB(10, 10, 30, 30))) {
236 canvas.drawPath(path, paint);
237 canvas.translate(50, 0);
238 }
239
240 // makeRect(rect, dir)
241 try (Path path = Path.makeRect(Rect.makeLTRB(10, 10, 30, 30), PathDirection.CLOCKWISE)) {
242 canvas.drawPath(path, paint);
243 canvas.translate(50, 0);

Callers 1

drawMethod · 0.95

Calls 15

makeFromSVGStringMethod · 0.95
makeRawMethod · 0.95
makeRectMethod · 0.95
makeOvalMethod · 0.95
makeCircleMethod · 0.95
makeRRectMethod · 0.95
makePolygonMethod · 0.95
makeLineMethod · 0.95
saveMethod · 0.80
setStrokeWidthMethod · 0.80
setModeMethod · 0.80
restoreMethod · 0.80

Tested by

no test coverage detected