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

do scaling on a Path before constructing PathLike in 'rect' (fixes #43) #70

Merged
merged 1 commit into from Jan 1, 2013

Conversation

byorgey
Copy link
Member

@byorgey byorgey commented Dec 30, 2012

We used to have

rect w h = unitSquare # scaleX w # scaleY h

since unitSquare can produce any PathLike. The new code
instead uses (unitSquare # scaleX w # scaleY h) to specifically
produce a Path, which is then deconstructed and passed into
pathLike to create any PathLike.

The difference is that while scaling by zero works fine for
Path it does not work very well for, say, Diagrams (leading to
NaNs or worse). This way, we force the scaling to happen on a
Path, where we know it will behave properly, and then use the
resulting geometry to construct an arbitrary PathLike.

We used to have

  rect w h = unitSquare # scaleX w # scaleY h

since unitSquare can produce any PathLike.  The new code
instead uses (unitSquare # scaleX w # scaleY h) to specifically
produce a Path, which is then deconstructed and passed into
'pathLike' to create any PathLike.

The difference is that while scaling by zero works fine for
Path it does not work very well for, say, Diagrams (leading to
NaNs or worse).  This way, we force the scaling to happen on a
Path, where we know it will behave properly, and then use the
resulting geometry to construct an arbitrary PathLike.
@byorgey
Copy link
Member Author

byorgey commented Dec 30, 2012

Oh, and this should fix #51 as well.

fryguybob added a commit that referenced this pull request Jan 1, 2013
do scaling on a Path before constructing PathLike in 'rect' (fixes #43)
@fryguybob fryguybob merged commit e7b3d92 into master Jan 1, 2013
@byorgey byorgey deleted the issue43 branch January 1, 2013 15:14
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.

None yet

2 participants