diagrams / diagrams-lib

Diagrams standard library
https://diagrams.github.io/
Other
138 stars 62 forks source link

Local dashing on shaft style isn't local #274

Closed byorgey closed 8 years ago

byorgey commented 8 years ago

Consider this code:

dia = mconcat
  [ arrowV' (with & shaftStyle %~ dashingL [5, 5] 0) unitX
  , square 2
  ]

main = defaultMain (dia # frame 1)

It creates an arrow on top of a square, with a dashed arrow shaft. The dashing is supposedly using a local measure; since the arrow is only 1 unit long, local dash lengths of [5,5] are ridiculously large and there shouldn't be any dashing visible at all. But in fact we get this:

dashedshaft1

Moreover, look what happens when we change frame 1 to frame 0.1:

dashedshaft2

The square and arrow get relatively bigger, but the dashing remains exactly the same size.

So it seems that dashingL within an arrow shaft is not actually using a local measure. (Incidentally, if you make a normal dashed path with dashingL, it works fine.)

byorgey commented 8 years ago

This seems related: https://github.com/diagrams/diagrams-lib/commit/f057ada771ab335dab848aa58ec03c795316216f but it's been a while since I've thought about any of this.