mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 06:11:16 +00:00
Add API to sixtyfps::Image in Rust and C++ to access the optional path
This commit is contained in:
parent
bbe178aadf
commit
4eef8c7688
5 changed files with 39 additions and 0 deletions
|
@ -86,6 +86,9 @@ TEST_CASE("Image")
|
|||
REQUIRE(size.width == 0.);
|
||||
REQUIRE(size.height == 0.);
|
||||
}
|
||||
{
|
||||
REQUIRE(!img.path().has_value());
|
||||
}
|
||||
|
||||
img = Image::load_from_path(SOURCE_DIR "/../../vscode_extension/extension-logo.png");
|
||||
{
|
||||
|
@ -93,6 +96,11 @@ TEST_CASE("Image")
|
|||
REQUIRE(size.width == 128.);
|
||||
REQUIRE(size.height == 128.);
|
||||
}
|
||||
{
|
||||
auto actual_path = img.path();
|
||||
REQUIRE(actual_path.has_value());
|
||||
REQUIRE(*actual_path == SOURCE_DIR "/../../vscode_extension/extension-logo.png");
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("SharedVector")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue