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]
|
[dependencies]
|
||||||
iced.workspace = true
|
iced.workspace = true
|
||||||
iced.features = ["canvas", "tokio", "debug"]
|
iced.features = ["canvas", "tokio", "debug", "winit", "wayland"]
|
||||||
chrono = "0.4"
|
chrono = "0.4"
|
||||||
tracing-subscriber = "0.3"
|
tracing-subscriber = "0.3"
|
||||||
|
|
|
||||||
|
|
@ -277,8 +277,8 @@ impl Layer {
|
||||||
.filter_map(|bounds| bounds.intersection(group_bounds))
|
.filter_map(|bounds| bounds.intersection(group_bounds))
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
Item::Cached(_, bounds, transformation) => {
|
Item::Cached(_primitives, bounds, _transformation) => {
|
||||||
vec![*bounds * *transformation]
|
vec![*bounds]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|primitive_a, primitive_b| match (primitive_a, primitive_b) {
|
|primitive_a, primitive_b| match (primitive_a, primitive_b) {
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,6 @@ impl Renderer {
|
||||||
|
|
||||||
for group in &layer.primitives {
|
for group in &layer.primitives {
|
||||||
let Some(group_bounds) = (group.clip_bounds()
|
let Some(group_bounds) = (group.clip_bounds()
|
||||||
* group.transformation()
|
|
||||||
* scale_factor)
|
* scale_factor)
|
||||||
.intersection(&layer_bounds)
|
.intersection(&layer_bounds)
|
||||||
else {
|
else {
|
||||||
|
|
@ -145,8 +144,8 @@ impl Renderer {
|
||||||
for primitive in group.as_slice() {
|
for primitive in group.as_slice() {
|
||||||
self.engine.draw_primitive(
|
self.engine.draw_primitive(
|
||||||
primitive,
|
primitive,
|
||||||
group.transformation()
|
Transformation::scale(scale_factor)
|
||||||
* Transformation::scale(scale_factor),
|
* group.transformation(),
|
||||||
pixels,
|
pixels,
|
||||||
clip_mask,
|
clip_mask,
|
||||||
group_bounds,
|
group_bounds,
|
||||||
|
|
@ -182,8 +181,8 @@ impl Renderer {
|
||||||
for text in group.as_slice() {
|
for text in group.as_slice() {
|
||||||
self.engine.draw_text(
|
self.engine.draw_text(
|
||||||
text,
|
text,
|
||||||
group.transformation()
|
Transformation::scale(scale_factor)
|
||||||
* Transformation::scale(scale_factor),
|
* group.transformation(),
|
||||||
pixels,
|
pixels,
|
||||||
clip_mask,
|
clip_mask,
|
||||||
layer_bounds,
|
layer_bounds,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue