score:0

it looks like you will need to add in code to the drawpoint function within helpers.canvas.js. if the point is an image object, rotate the canvas as needed, draw the image, then rotate the context back to standard orientation. an example of doing this is here.

i don't know enough about the library and the toolchain to be able to write functional code, but those 2 links should get you started.

score:0

faced same problem, if you can use svg format. this solution will help you.

  1. get xml string of your svg.
  2. dynamically generate it, as below code snippet.

let svg = `<?xml version="1.0" encoding="utf-8"?> <svg height="16px" width="16px" version="1.1" id="layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewbox="-297 389 16 16" style="enable-background:new -297 389 16 16;" xml:space="preserve" transform-origin="center" transform="rotate(${math.floor(history.direction)})"> </svg>`; let yourimage = new image(); let parser = new domparser(); yourimage.src =`data:image/svg+xml;base64,${btoa(svg)}`;

sorry for bad formatting :p.

you can modify svg as per you need, just use its attributes. such as transform=rotate(40) etc.


Related Query

More Query from same tag