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

Method drawOtherTransform

examples/scenes/src/GeometryScene.java:218–256  ·  view source on GitHub ↗
(Canvas canvas)

Source from the content-addressed store, hash-verified

216 }
217
218 public void drawOtherTransform(Canvas canvas) {
219 Paint paint = new Paint().setColor(0xFFFFCC66);
220
221 canvas.save();
222
223 canvas.save();
224 canvas.skew(0.3F, 0);
225 canvas.drawRect(Rect.makeXYWH(0, 0, 65, 40), paint);
226 canvas.restore();
227 canvas.translate(90, 0);
228
229 canvas.save();
230 canvas.skew(0F, 0.1F);
231 canvas.drawRect(Rect.makeXYWH(0, 0, 65, 40), paint);
232 canvas.restore();
233 canvas.translate(80, 0);
234
235 canvas.save();
236 canvas.skew(-0.2F, 0F);
237 canvas.drawOval(Rect.makeXYWH(0, 0, 65, 40), paint);
238 canvas.restore();
239 canvas.translate(75, 0);
240
241 canvas.save();
242 float cos45 = (float) Math.cos(Math.PI / 4);
243 Matrix44 rotateX45 = new Matrix44(
244 1, 0, 0, 0,
245 0, cos45, -cos45, 0,
246 0, cos45, cos45, 0,
247 0, 0, 0, 1
248 );
249 canvas.concat(rotateX45);
250 canvas.drawOval(Rect.makeXYWH(0, 0, 65, 40), paint);
251 canvas.restore();
252 canvas.translate(75, 0);
253
254 canvas.restore();
255 canvas.translate(0, 60);
256 }
257
258 public void drawArcs(Canvas canvas) {
259 var stroke1px = new Paint().setMode(PaintMode.STROKE).setStrokeWidth(1f);

Callers 1

drawMethod · 0.95

Calls 8

saveMethod · 0.80
skewMethod · 0.80
drawRectMethod · 0.80
restoreMethod · 0.80
concatMethod · 0.80
setColorMethod · 0.45
translateMethod · 0.45
drawOvalMethod · 0.45

Tested by

no test coverage detected