duality icon indicating copy to clipboard operation
duality copied to clipboard

Consider Rewriting CanvasState Vertex Transformation

Open ilexp opened this issue 9 years ago • 3 comments

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

  1. operate on the global coordinate system, not each shape's local system and
  2. allow arbitrary and complex transformations.

Both could potentially be achieved by switching to a matrix stack.

ilexp avatar Jan 21 '16 22:01 ilexp

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?

ilexp avatar Jan 11 '17 10:01 ilexp

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?

ilexp avatar Dec 22 '17 10:12 ilexp

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.

ilexp avatar Feb 03 '18 16:02 ilexp