forked from slint-ui/slint
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
swrenderer: Fix rendering of SVG when SLINT_SCALE_FACTOR is defined a…
…t compile time (slint-ui#5013) We call fit_to with the source size (which is not scaled by the scale factor) while the actual image is already scaled, so we need to adjust for the difference between the texture size and the original size. Also pass the scale_factor at compile time to the screenshot test
- Loading branch information
Showing
5 changed files
with
47 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
tests/screenshots/cases/software/basic/images-scale_factor.slint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright © SixtyFPS GmbH <info@slint.dev> | ||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial | ||
|
||
import { Slider } from "std-widgets.slint"; | ||
|
||
// SLINT_SCALE_FACTOR=3.2 | ||
|
||
export component TestCase inherits Window { | ||
width: 64phx; | ||
height: 64phx; | ||
background: darkgray; | ||
|
||
VerticalLayout { | ||
Image { | ||
source: @image-url("../../../../../logo/slint-logo-full-dark.svg"); | ||
Text { text: parent.source.width + "x" + parent.source.height; font-size: 4px; x: 0; y: 0; color: #123a;} | ||
} | ||
Image { | ||
source: @image-url("../../../../../logo/slint-logo-full-dark.png"); | ||
Text { text: parent.source.width + "x" + parent.source.height; font-size: 4px; x: 0; y: 0; color: #321a;} | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.59 KB
(160%)
tests/screenshots/references/software/basic/text-clipped.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.