(Canvas canvas, String text, Rect outer, Font font, Paint paint)
| 43 | } |
| 44 | |
| 45 | public static void drawStringLeft(Canvas canvas, String text, Rect outer, Font font, Paint paint) { |
| 46 | Rect inner = font.measureText(text, paint); |
| 47 | FontMetrics metrics = font.getMetrics(); |
| 48 | float innerHeight = metrics.getDescent() - metrics.getAscent(); |
| 49 | |
| 50 | canvas.drawString(text, |
| 51 | outer.getLeft(), |
| 52 | outer.getTop() + (outer.getHeight() - innerHeight) / 2f - metrics.getAscent(), |
| 53 | font, paint); |
| 54 | } |
| 55 | |
| 56 | public static float phase() { |
| 57 | var angle = (System.currentTimeMillis() % 5000) / 5000.0 * Math.PI * 2.0; |
no test coverage detected