Fix duplicated images when building with embedded images

For embedded images the path is empty but we unconditionally used it to create a TextureCacheKey,
which clashes.

Instead, preserve and store the ImageCacheKey in the ImageInner variants.
This commit is contained in:
Simon Hausmann 2022-07-19 17:18:59 +02:00 committed by Simon Hausmann
parent 71d6717b68
commit 34dc0a80e7
5 changed files with 69 additions and 42 deletions

View file

@ -173,6 +173,7 @@ fn gen_corelib(
"SharedString",
"SharedVector",
"ImageInner",
"ImageCacheKey",
"Image",
"Color",
"PathData",
@ -259,6 +260,7 @@ fn gen_corelib(
vec![
"ImageInner",
"Image",
"ImageCacheKey",
"Size",
"slint_image_size",
"slint_image_path",
@ -354,6 +356,7 @@ fn gen_corelib(
.with_src(crate_dir.join("graphics/path.rs"))
.with_src(crate_dir.join("graphics/brush.rs"))
.with_src(crate_dir.join("graphics/image.rs"))
.with_src(crate_dir.join("graphics/image/cache.rs"))
.with_src(crate_dir.join("animations.rs"))
// .with_src(crate_dir.join("input.rs"))
.with_src(crate_dir.join("item_rendering.rs"))