Merge pull request #2977 from DKolter/issue_2934
Fix tiny skia primitive rendering
This commit is contained in:
commit
b3e1be5def
3 changed files with 29 additions and 41 deletions
|
|
@ -36,15 +36,6 @@ impl Engine {
|
|||
clip_mask: &mut tiny_skia::Mask,
|
||||
clip_bounds: Rectangle,
|
||||
) {
|
||||
debug_assert!(
|
||||
quad.bounds.width.is_normal(),
|
||||
"Quad with non-normal width!"
|
||||
);
|
||||
debug_assert!(
|
||||
quad.bounds.height.is_normal(),
|
||||
"Quad with non-normal height!"
|
||||
);
|
||||
|
||||
let physical_bounds = quad.bounds * transformation;
|
||||
|
||||
if !clip_bounds.intersects(&physical_bounds) {
|
||||
|
|
@ -497,7 +488,7 @@ impl Engine {
|
|||
transformation: Transformation,
|
||||
pixels: &mut tiny_skia::PixmapMut<'_>,
|
||||
clip_mask: &mut tiny_skia::Mask,
|
||||
layer_bounds: Rectangle,
|
||||
clip_bounds: Rectangle,
|
||||
) {
|
||||
match primitive {
|
||||
Primitive::Fill { path, paint, rule } => {
|
||||
|
|
@ -512,14 +503,12 @@ impl Engine {
|
|||
} * transformation
|
||||
};
|
||||
|
||||
let Some(clip_bounds) =
|
||||
layer_bounds.intersection(&physical_bounds)
|
||||
else {
|
||||
if !clip_bounds.intersects(&physical_bounds) {
|
||||
return;
|
||||
};
|
||||
}
|
||||
|
||||
let clip_mask =
|
||||
(physical_bounds != clip_bounds).then_some(clip_mask as &_);
|
||||
let clip_mask = (!physical_bounds.is_within(&clip_bounds))
|
||||
.then_some(clip_mask as &_);
|
||||
|
||||
pixels.fill_path(
|
||||
path,
|
||||
|
|
@ -545,14 +534,12 @@ impl Engine {
|
|||
} * transformation
|
||||
};
|
||||
|
||||
let Some(clip_bounds) =
|
||||
layer_bounds.intersection(&physical_bounds)
|
||||
else {
|
||||
if !clip_bounds.intersects(&physical_bounds) {
|
||||
return;
|
||||
};
|
||||
}
|
||||
|
||||
let clip_mask =
|
||||
(physical_bounds != clip_bounds).then_some(clip_mask as &_);
|
||||
let clip_mask = (!physical_bounds.is_within(&clip_bounds))
|
||||
.then_some(clip_mask as &_);
|
||||
|
||||
pixels.stroke_path(
|
||||
path,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue