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

canvas.Fit() throws exception if there is no layer #5

Merged
merged 3 commits into from
Nov 25, 2019
Merged

canvas.Fit() throws exception if there is no layer #5

merged 3 commits into from
Nov 25, 2019

Conversation

ttt43ttt
Copy link
Contributor

@ttt43ttt ttt43ttt commented Nov 6, 2019

No description provided.

Copy link
Owner

@tdewolff tdewolff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not going to work as it includes (0,0) as a point to which we will fit the canvas. I suggest instead that we treat the absence of layers as a special case.

@ttt43ttt
Copy link
Contributor Author

ttt43ttt commented Nov 7, 2019

Actually I think if there is nothing in the canvas, calling Fit() should make the canvas have width/height equal to 2*margin/2*margin instead of 0/0, which makes the value continuous.
Hope you can consider it again. Thanks!

Copy link
Owner

@tdewolff tdewolff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry to get back so late!

canvas.go Outdated Show resolved Hide resolved
canvas.go Show resolved Hide resolved
@tdewolff tdewolff merged commit d2a1fc5 into tdewolff:master Nov 25, 2019
@ttt43ttt ttt43ttt deleted the canvas-fit-error branch November 28, 2019 05:35
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