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