zenozeng/p5.js-svg

Can't rotate loaded SVG element

Opened this issue · 1 comments

Hi! Thanks for this awesome library. I'm using it and for the most part I don't have any issues, but I'm stuck trying to rotate a loaded SVG. I'm working with both the last versions of pj5s and the library.
Here is the code to reproduce:

`function preload() {
svgs = [
loadSVG('/img/plantilla_01.svg'),
loadSVG('/img/plantilla_02.svg'),
loadSVG('/img/plantilla_03.svg')
]
}

function setup() {
createCanvas(windowWidth, windowHeight, SVG)
noLoop()
angleMode(DEGREES)
imageMode(CENTER)
}

function draw() {
let posX = 0
let posY = 0
let imagen
for (let index = 0; index < 10; index++) {
let giro = random(-90, 90)
push()
translate(width/2, height/2)
rotate(giro)
imagen = svgs[floor(random(0,3))]
image(imagen, posX, posY, width/10, height/10)
posX += width/10
posY += height/10
pop()
}
}`

Which can be the issue?

I have the same issue!