Skip to content

Commit 885d266

Browse files
committed
fix: effect does not work well with flip_x
Closes #749
1 parent a639f7f commit 885d266

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

prpr/src/core/chart.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,15 @@ impl Chart {
170170
}
171171
}
172172
if !res.no_effect {
173-
for effect in &self.extra.effects {
174-
effect.render(res);
173+
let render = |res: &mut Resource| {
174+
for effect in &self.extra.effects {
175+
effect.render(res);
176+
}
177+
};
178+
if res.config.flip_x() {
179+
res.apply_model_of(&Matrix::identity().append_nonuniform_scaling(&Vector::new(-1., 1.)), render);
180+
} else {
181+
render(res);
175182
}
176183
}
177184
});

0 commit comments

Comments
 (0)