App 2.43.2: Halloween's teeth are triangles in the right colour
They hang from the grin's upper lip, each in the colour of the rib behind it: the right one was the darker orange on the lighter rib. Not tried on the car. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LhzAVaUyqcw5PkGjz4mWW6
This commit is contained in:
@@ -339,10 +339,9 @@ final class HalloweenView extends ClusterCanvasView {
|
||||
fill.setColor(burn);
|
||||
c.drawPath(path, fill);
|
||||
c.restore();
|
||||
// Two teeth at the grin's corners, clear of the digits.
|
||||
fill.setColor(PUMPKIN);
|
||||
tooth(c, cx - 120f * u, gt + 12f * u, 15f * u, 28f * u);
|
||||
tooth(c, cx + 120f * u, gt + 12f * u, 15f * u, 28f * u);
|
||||
// Two teeth at the grin's corners, clear of the digits, each the colour of the rib it hangs from.
|
||||
tooth(c, cx, -120f * u, gw, gt, 26f * u, 17f * u, gt + 40f * u, PUMPKIN, u);
|
||||
tooth(c, cx, 120f * u, gw, gt, 26f * u, 17f * u, gt + 40f * u, PUMPKIN_LIT, u);
|
||||
label(c, fmt(v.speedKmh, "%.0f", "—"), cx, gb - 18f * u, 92f * u, INK, serif, Paint.Align.CENTER);
|
||||
label(c, "KM/H", cx + 80f * u, cy + 64f * u, 16f * u, INK, face, Paint.Align.LEFT);
|
||||
// The power under the pumpkin, above the ridge.
|
||||
@@ -364,14 +363,27 @@ final class HalloweenView extends ClusterCanvasView {
|
||||
c.drawPath(path, line);
|
||||
}
|
||||
|
||||
private void tooth(Canvas c, float x, float y, float halfW, float tall) {
|
||||
/** A triangle hanging from the grin's upper lip (a curve sagging by {@code sag}) to {@code tipY}. */
|
||||
private void tooth(Canvas c, float cx, float dx, float gw, float gt, float sag, float halfW, float tipY, int colour, float u) {
|
||||
float left = lip(dx - halfW, gw, gt, sag), right = lip(dx + halfW, gw, gt, sag);
|
||||
path.reset();
|
||||
path.moveTo(x - halfW, y - tall * 0.3f);
|
||||
path.lineTo(x + halfW, y - tall * 0.3f);
|
||||
path.lineTo(x + halfW, y + tall * 0.7f);
|
||||
path.lineTo(x - halfW, y + tall * 0.7f);
|
||||
// A little above the lip, so none of its dark edge shows across the tooth's root.
|
||||
path.moveTo(cx + dx - halfW, left - 1.5f * u);
|
||||
path.lineTo(cx + dx + halfW, right - 1.5f * u);
|
||||
path.lineTo(cx + dx, tipY);
|
||||
path.close();
|
||||
fill.setColor(colour);
|
||||
c.drawPath(path, fill);
|
||||
line.setColor(0xFF4A1F04);
|
||||
line.setStrokeWidth(3f * u);
|
||||
c.drawLine(cx + dx - halfW, left + 2f * u, cx + dx, tipY, line);
|
||||
c.drawLine(cx + dx + halfW, right + 2f * u, cx + dx, tipY, line);
|
||||
}
|
||||
|
||||
/** The height of the grin's upper lip {@code dx} from the middle. */
|
||||
private static float lip(float dx, float gw, float gt, float sag) {
|
||||
float t = (gw - Math.abs(dx)) / (2f * gw);
|
||||
return gt + 2f * t * (1f - t) * sag;
|
||||
}
|
||||
|
||||
// ---------- Left: the sign under the cobweb ----------
|
||||
|
||||
Reference in New Issue
Block a user