JuliaGraphics / Luxor.jl

Simple drawings using vector graphics; Cairo "for tourists!"

Home Page:http://juliagraphics.github.io/Luxor.jl/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rotated `placeimage` broken

yha opened this issue · comments

commented

Placing an svg after rotate often clips the svg or draws nothing, and sometimes messes up subsequent draws as well.
Some examples with this file:
strip-tmp

s = readsvg("strip-tmp.svg")
@svg let
    rotate(-0.2)
    placeimage(s)
end 200 200

tmp

@svg for angle in 1.2:-0.2:-1.2
    @layer let
        rotate(angle)
        placeimage(s; centered=true)
        translate(50, 0)
        text(string(angle))
    end
end 800 800

tmp

It appears that the Rsvg.handle_render_cairo() call inside placesvg() modifies the coordinate system in such a way that, although it's enclosed in @layer ...end, changes can "leak" out into surrounding code and upset subsequent graphics.

You could try enclosing the placeimage() in another @layer ... end to see if that can really isolate the changes introduced by the Rsvg action...

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.