Skip to content

Inconsistencies when saving to a stretched image?  #431

@etiennedeg

Description

@etiennedeg

Hi, when the output image in SVG format is shaped to a stretched rectangle, there are inconsistencies in the way forms are reshaped.
In the following example, the circle is still a circle, but the rectangle and the lines are stretched.

using Compose
using Colors
center = (0, 0)
p1 = (1, 0)
p2 = (0, 1)
p3 = (-1, 0)
p4 = (0, -1)
lines2 = [[center, p1], [center, p2], [center, p3],[center, p4]]
c = compose(
        context(units=UnitBox(-2., -2., 4., 4.)),
        compose(context(), line(lines2), stroke(colorant"white")),
        compose(context(), rectangle(-1, -1, 2, 2), fill(colorant"red")),
        compose(context(), circle(0, 0, 1.5), fill(colorant"blue"))
)
draw(SVG("myplot.svg", 10cm, 10cm), c)
draw(SVG("myplot_reshaped.svg", 10cm, 5cm), c)

"myplot.svg"
myplot
"myplot_reshaped.svg"
myplot_reshaped

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions