mirror of
https://github.com/italicsjenga/vello.git
synced 2025-01-10 12:41:30 +11:00
fix fragment transform logic
This commit is contained in:
parent
d7773bf877
commit
2e8be24fc9
|
@ -61,7 +61,7 @@ impl From<(f32, f32)> for Point {
|
|||
}
|
||||
|
||||
/// Affine transformation matrix.
|
||||
#[derive(Copy, Clone, Debug, Pod, Zeroable)]
|
||||
#[derive(Copy, Clone, PartialEq, Debug, Pod, Zeroable)]
|
||||
#[repr(C)]
|
||||
pub struct Affine {
|
||||
pub xx: f32,
|
||||
|
|
|
@ -160,11 +160,13 @@ impl<'a> Builder<'a> {
|
|||
pub fn append(&mut self, fragment: &Fragment, transform: Option<Affine>) {
|
||||
let drawdata_base = self.scene.drawdata_stream.len();
|
||||
let mut cur_transform = self.scene.transform_stream.last().copied();
|
||||
if cur_transform.is_none() {
|
||||
if let Some(transform) = transform {
|
||||
self.encode_transform(transform);
|
||||
if cur_transform.is_none() {
|
||||
cur_transform = Some(Affine::IDENTITY);
|
||||
}
|
||||
self.encode_transform(transform);
|
||||
} else if cur_transform != Some(Affine::IDENTITY) {
|
||||
self.encode_transform(Affine::IDENTITY);
|
||||
}
|
||||
self.scene.append(&fragment.data, &transform);
|
||||
match &mut self.resources {
|
||||
|
|
Loading…
Reference in a new issue