MCPcopy Create free account
hub / github.com/HumbleUI/JWM / paintImpl

Method paintImpl

examples/dashboard/java/PanelAnimation.java:14–30  ·  view source on GitHub ↗
(Canvas canvas, int width, int height, float scale)

Source from the content-addressed store, hash-verified

12 }
13
14 @Override
15 public void paintImpl(Canvas canvas, int width, int height, float scale) {
16 var radius = Math.max(0, Math.min(width / 2 - Example.PADDING, height / 2 - Example.PADDING));
17
18 try (var paint = new Paint()) {
19 canvas.save();
20 canvas.translate(width / 2, height / 2);
21 paint.setColor(0xFFFFFFFF);
22 canvas.drawCircle(0, 0, radius, paint);
23 canvas.rotate(angle);
24 paint.setColor(0xFF264653);
25 canvas.drawRect(Rect.makeXYWH(-7, -radius, 14, radius * 2), paint);
26 canvas.restore();
27 }
28
29 angle = (angle + 3) % 360;
30 }
31}

Callers

nothing calls this directly

Calls 3

drawRectMethod · 0.80
makeXYWHMethod · 0.80
restoreMethod · 0.45

Tested by

no test coverage detected