Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transform the arrow shaft style #276

Merged
merged 1 commit into from
Jun 7, 2016
Merged

Transform the arrow shaft style #276

merged 1 commit into from
Jun 7, 2016

Conversation

cchalmers
Copy link
Member

Hopefully fixes #274.

It seems to be fixed by applying the transform to the shaft style. I've applied the transform before applying the global style since this (should) already have the transform applied to it.

Here's an example comparing arrow shafts to paths for different dashings:

import Diagrams.Backend.Rasterific.CmdLine
import Diagrams.Prelude

arrows :: Diagram Rasterific
arrows = mconcat
  [ arrowV' (with & shaftStyle %~ dashingL [0.25, 0.25] 0) unitX
  , arrowV' (with & shaftStyle %~ dashingO [5, 5] 0) unitY
  , arrowV' (with & shaftStyle %~ dashingN [0.05, 0.05] 0) unit_X
  , arrowV' (with & shaftStyle %~ dashingG [0.2, 0.2] 0) unit_Y
  , square 2
  ]

straights :: Diagram Rasterific
straights = mconcat
  [ v unitX  # dashingL [0.25, 0.25] 0
  , v unitY  # dashingO [5, 5] 0
  , v unit_X # dashingN [0.05, 0.05] 0
  , v unit_Y # dashingG [0.2, 0.2] 0
  , square 2
  ] where v = stroke . (`at` origin) . straight

main :: IO ()
main = defaultMain . frame 0.2 $
  (arrows    ||| arrows # scale 2)
             ===
  (straights ||| straights # scale 2)

arrow-test

@byorgey
Copy link
Member

byorgey commented Jun 7, 2016

Ah, yes, that makes sense, thanks!

The travis failure seems to be an out-of-memory error while running a test suite, not sure if that is due to a bug in the test suite or just plain insufficient memory, but in any case it's clearly not caused by this PR.

@byorgey byorgey merged commit 74fbafa into master Jun 7, 2016
@byorgey byorgey deleted the shaft-transform branch June 7, 2016 03:24
@bergey
Copy link
Member

bergey commented Jun 7, 2016

That's an interesting failure. It looks stochastic (one build out of five, not always the same GHC version), which makes sense since it's in a QuickCheck test. We should try limiting the list length in the Arbitrary instance, and see if it goes away.

I think travis allocates more RAM to the new containerized builders. We should switch all the travis configs over at some point; this is another reason.

@bergey
Copy link
Member

bergey commented Jun 8, 2016

@dashhalpern points out that we're generating Arbitrary Directions' , notPath`s, so it's less obvious how to pick Directions that don't lead to huge lists.

@byorgey
Copy link
Member

byorgey commented Jun 8, 2016

I made a new issue for the test suite failures: #277 . Let's continue discussing it there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Local dashing on shaft style isn't local
3 participants