提交 a27edc40 编写于 作者: V Viktor Lidholt

Fixes anchor points for particles in particle systems

上级 7a386db1
......@@ -300,6 +300,10 @@ class ParticleSystem extends Node {
_paint.setTransferMode(transferMode);
for (_Particle particle in _particles) {
// Rect
Rect rect = texture.frame;
rects.add(rect);
// Transform
double scos;
double ssin;
......@@ -314,13 +318,13 @@ class ParticleSystem extends Node {
scos = particle.size;
ssin = 0.0;
}
RSTransform transform = new RSTransform(scos, ssin, particle.pos[0], particle.pos[1]);
double ax = rect.width / 2;
double ay = rect.height / 2;
double tx = particle.pos[0] + -scos * ax + ssin * ay;
double ty = particle.pos[1] + -ssin * ax - scos * ay;
RSTransform transform = new RSTransform(scos, ssin, tx, ty);
transforms.add(transform);
// Rect
Rect rect = texture.frame;
rects.add(rect);
// Color
if (particle.simpleColorSequence != null) {
Color particleColor = new Color.fromARGB(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册