The chip window was 60 x 44 with the curl tumbling about its centre. The curl reaches 24.2 units from that pivot once the stroke is counted, so a half height of 22 clipped the top and bottom off it on every turn. The box is now 52 x 58 with the pivot at (26, 33), measured off the actual Bezier curve rather than its control points. The shadow sits at 15.1 below the pivot, which is where the curl comes to rest, so the chip lands on its own shadow instead of floating above it. The endless rotation is gone. Each bat now adds one or two whole turns in the direction it was hit and coasts to a stop, so the resting silhouette is always the same one, the one the shadow was placed under. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
20 lines
768 B
QML
20 lines
768 B
QML
pragma Singleton
|
|
import QtQuick
|
|
|
|
// Shared facts about the drawing, so every window sizes the cat the same way.
|
|
QtObject {
|
|
// Cat.qml draws in a 100 x 90 box inside a 120 x 106 window box. The slack
|
|
// holds the whiskers, the tail and the glyphs that float above the head.
|
|
readonly property real aspect: 106 / 120
|
|
|
|
// Chip.qml draws in a 52 x 58 box, large enough to hold the tumbling curl.
|
|
readonly property real chipAspect: 58 / 52
|
|
|
|
readonly property var moodNames: ["walking", "running", "sitting", "grooming", "stretching",
|
|
"sleeping", "loving", "alert", "chasing", "batting", "drinking"]
|
|
|
|
function mood(value) {
|
|
return moodNames[value] !== undefined ? moodNames[value] : "sitting"
|
|
}
|
|
}
|