mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-01 10:38:17 +08:00
fix for anchor + rotation regarding composed component
This commit is contained in:
@ -92,10 +92,12 @@ abstract class PositionComponent extends Component {
|
||||
}
|
||||
|
||||
void prepareCanvas(Canvas canvas) {
|
||||
double ax = x - anchor.relativePosition.dx * width;
|
||||
double ay = y - anchor.relativePosition.dy * height;
|
||||
canvas.translate(ax, ay);
|
||||
canvas.translate(x, y);
|
||||
|
||||
canvas.rotate(angle);
|
||||
double dx = - anchor.relativePosition.dx * width;
|
||||
double dy = - anchor.relativePosition.dy * height;
|
||||
canvas.translate(dx, dy);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user