Fix text transparency in iced_tiny_skia
This commit is contained in:
parent
84cc9f130b
commit
7a572655c1
1 changed files with 10 additions and 1 deletions
|
|
@ -238,6 +238,12 @@ fn draw(
|
||||||
)
|
)
|
||||||
.expect("Create glyph pixel map");
|
.expect("Create glyph pixel map");
|
||||||
|
|
||||||
|
let opacity = color.a
|
||||||
|
* glyph
|
||||||
|
.color_opt
|
||||||
|
.map(|c| c.a() as f32 / 255.0)
|
||||||
|
.unwrap_or(1.0);
|
||||||
|
|
||||||
pixels.draw_pixmap(
|
pixels.draw_pixmap(
|
||||||
physical_glyph.x + placement.left,
|
physical_glyph.x + placement.left,
|
||||||
physical_glyph.y - placement.top
|
physical_glyph.y - placement.top
|
||||||
|
|
@ -246,7 +252,10 @@ fn draw(
|
||||||
* transformation.scale_factor())
|
* transformation.scale_factor())
|
||||||
.round() as i32,
|
.round() as i32,
|
||||||
pixmap,
|
pixmap,
|
||||||
&tiny_skia::PixmapPaint::default(),
|
&tiny_skia::PixmapPaint {
|
||||||
|
opacity,
|
||||||
|
..tiny_skia::PixmapPaint::default()
|
||||||
|
},
|
||||||
tiny_skia::Transform::identity(),
|
tiny_skia::Transform::identity(),
|
||||||
clip_mask,
|
clip_mask,
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue