duality
duality copied to clipboard
Consider Rewriting CanvasState Vertex Transformation
In the current implementation the Canvas convenience class is not able to express complex (stacked) and arbitrary vertex transformations. It relies on a hardcoded triple of offset, rotation and scale and is always performed locally on the currently drawn shape.
Consider extending / changing transformation support to
- operate on the global coordinate system, not each shape's local system and
- allow arbitrary and complex transformations.
Both could potentially be achieved by switching to a matrix stack.
Things to consider:
- What are the potential use cases for this?
- What are the existing use cases for Canvas vertex transformation?
- Would the old use cases benefit from this change?
- Are the new use cases important / wide-spread enough to make an impact?
- What are the performance implications?
Note: In the same vein, also reconsider half pixel offsets on line drawing.
Edit: Actually, the current way this is handled might be considered a bug, as the half pixel offset is done in world space. Then again, does a half pixel offset make any sense when world space is different from screen space?
Moving this from the v3.0 milestone to Future. Seems to be mostly nice2have, a lot of design an refactoring work, and performance implications are unclear. Probably will be done at some point, but no need for it to be now.