| 1 | // Copyright © SixtyFPS GmbH <info@slint.dev> |
| 2 | // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0 |
| 3 | |
| 4 | // Test for manual visual verification of rotation |
| 5 | // |
| 6 | // The green rectangle should be 45 degree rotated inside the black rectangle |
| 7 | // |
| 8 | // The rectangle with the linear gradient should be rotated by 315 degrees |
| 9 | // inside the other black rectangle |
| 10 | |
| 11 | TestCase := Window { |
| 12 | width: 800px; |
| 13 | height: 600px; |
| 14 | |
| 15 | // "box" to act as translation |
| 16 | Rectangle { |
| 17 | x: 50px; |
| 18 | y: 50px; |
| 19 | |
| 20 | Image { |
| 21 | rotation-angle: 45deg; |
| 22 | x: 50px; |
| 23 | y: 50px; |
| 24 | rotation-origin-x: 0; |
| 25 | rotation-origin-y: 0; |
| 26 | width: 50px; |
| 27 | height: 50px; |
| 28 | source: @image-url("../../../logo/slint-logo-square-light-128x128.png" ); |
| 29 | } |
| 30 | |
| 31 | Rectangle { |
| 32 | x: 50px; |
| 33 | y: 50px; |
| 34 | width: 50px; |
| 35 | height: 50px; |
| 36 | border-width: 1px; |
| 37 | border-color: black; |
| 38 | } |
| 39 | |
| 40 | } |
| 41 | |
| 42 | // ------- |
| 43 | |
| 44 | // "box" to act as translation |
| 45 | Rectangle { |
| 46 | x: 200px; |
| 47 | y: 50px; |
| 48 | border-width: 1px; |
| 49 | border-color: black; |
| 50 | width: i2.width; |
| 51 | height: i2.height; |
| 52 | |
| 53 | i2 := Image { |
| 54 | rotation-angle: 315deg; |
| 55 | source: @image-url("../../../logo/slint-logo-square-light-128x128.png" ); |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | Text { |
| 60 | x: 150px; |
| 61 | y: 200px; |
| 62 | text: "Hello World" ; |
| 63 | rotation-angle: 360deg * animation-tick() / 3s; |
| 64 | } |
| 65 | } |
| 66 | |