Fix transformation of canvas primitives in tiny_skia
This commit is contained in:
parent
88f3b00d96
commit
4020ad70b6
4 changed files with 781 additions and 524 deletions
1290
Cargo.lock
generated
1290
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -7,6 +7,6 @@ publish = false
|
|||
|
||||
[dependencies]
|
||||
iced.workspace = true
|
||||
iced.features = ["canvas", "tokio", "debug"]
|
||||
iced.features = ["canvas", "tokio", "debug", "winit", "wayland"]
|
||||
chrono = "0.4"
|
||||
tracing-subscriber = "0.3"
|
||||
|
|
|
|||
|
|
@ -277,8 +277,8 @@ impl Layer {
|
|||
.filter_map(|bounds| bounds.intersection(group_bounds))
|
||||
.collect()
|
||||
}
|
||||
Item::Cached(_, bounds, transformation) => {
|
||||
vec![*bounds * *transformation]
|
||||
Item::Cached(_primitives, bounds, _transformation) => {
|
||||
vec![*bounds]
|
||||
}
|
||||
},
|
||||
|primitive_a, primitive_b| match (primitive_a, primitive_b) {
|
||||
|
|
|
|||
|
|
@ -133,7 +133,6 @@ impl Renderer {
|
|||
|
||||
for group in &layer.primitives {
|
||||
let Some(group_bounds) = (group.clip_bounds()
|
||||
* group.transformation()
|
||||
* scale_factor)
|
||||
.intersection(&layer_bounds)
|
||||
else {
|
||||
|
|
@ -145,8 +144,8 @@ impl Renderer {
|
|||
for primitive in group.as_slice() {
|
||||
self.engine.draw_primitive(
|
||||
primitive,
|
||||
group.transformation()
|
||||
* Transformation::scale(scale_factor),
|
||||
Transformation::scale(scale_factor)
|
||||
* group.transformation(),
|
||||
pixels,
|
||||
clip_mask,
|
||||
group_bounds,
|
||||
|
|
@ -182,8 +181,8 @@ impl Renderer {
|
|||
for text in group.as_slice() {
|
||||
self.engine.draw_text(
|
||||
text,
|
||||
group.transformation()
|
||||
* Transformation::scale(scale_factor),
|
||||
Transformation::scale(scale_factor)
|
||||
* group.transformation(),
|
||||
pixels,
|
||||
clip_mask,
|
||||
layer_bounds,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue