You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
This implements one part of issue #149. By basing the renderer for
rectangles off of the path painting algorithms, we can easily obtain
rotated and skewed rectangles. This would be very difficult to do
manually especially for rectangles with rounded corners. Now, we can
simply use the arc approximator to construct a polygon.
I was torn between basing the RectRenderer off of either the
PathRenderer, which would be the obvious choice but would require
needlessly constructing an intermediate command array, or the
PolygonRenderer, which means we have to work with the ArcApproximator on
a lower level but possibly get better performance. I chose the latter.
This implements one part of issue #149. By basing the renderer for
rectangles off of the path painting algorithms, we can easily obtain
rotated and skewed rectangles. This would be very difficult to do
manually especially for rectangles with rounded corners. Now, we can
simply use the arc approximator to construct a polygon.
I was torn between basing the RectRenderer off of either the
PathRenderer, which would be the obvious choice but would require
needlessly constructing an intermediate command array, or the
PolygonRenderer, which means we have to work with the ArcApproximator on
a lower level but possibly get better performance. I chose the latter.
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 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.
The text was updated successfully, but these errors were encountered: