coolbutuseless / minisvg

Create SVG documents with R
https://coolbutuseless.github.io/package/minisvg/
MIT License
31 stars 3 forks source link

Multiple transformations #7

Closed dmi3kno closed 4 years ago

dmi3kno commented 4 years ago

I am looking at the Transformations vignette and I don't actually see multiple transformations applied, as the code suggests:

heart_shadow <- stag$g(
  fill = 'grey',
  svg_prop$transform$rotate(-10, 50, 100),
  svg_prop$transform$translate(-36, 45.5),
  svg_prop$transform$skewX(40),
  svg_prop$transform$scale(1, 0.5),
  heart_shape
)

This should have translated to

  <g fill="grey" transform="rotate(-10 50 100) translate(-36 45.5) skewX(40) scale(1 0.5)">

heart_3

While it only shows

  <g fill="grey" transform="scale(1 0.5)">

heart_1

It is actually pretty useful feature to be able to combine transforms and I would like to use it in other stags as well, such as in $use

coolbutuseless commented 4 years ago

Definite bug.

This used to work as documented. Will investigate.