1// Copyright © SixtyFPS GmbH <info@slint.dev>
2// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial
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
11TestCase := 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