Skip to content

Rewrite rendering to care about more complex transforms #149

Open
@meyfa

Description

@meyfa

Renderers such as the rect renderer currently assume only translation and scale transforms are present. This means that e.g. rotated rects cannot be rendered. Instead of computing the bottom-right corner AFTER the transform was applied to the top-left edge and size, we have to compute each corner first and then map them separately.

The following renderer types are affected:

  • rect
  • ellipse
  • image
  • text

Rect and ellipse can probably be implemented somewhat effectively by generating an equivalent path and rendering that via the path renderer (which supports every type of transform quite well). Transforming embedded SVG images should be doable, but embedded raster images might require a lot of work. For PHP >= 5.5.0 there is imageaffine() but I have no idea what to do on PHP 5.3 or 5.4. Text can be rotated via imagettftext(), but not skewed or non-uniformly scaled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementImprovement to an existing feature

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions