-
Notifications
You must be signed in to change notification settings - Fork 69
Change the handling of out-of-bounds canvas #255
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
base: trunk
Are you sure you want to change the base?
Change the handling of out-of-bounds canvas #255
Conversation
if (widthDiff == 1) { | ||
rows.forEach { it.add(newBlankPixel) } | ||
} else { | ||
rows.forEach { it.addAll(createBlankRow(widthDiff)) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is not an ideal solution, because several lists are created, but on the other hand it should not be a hot execution path.
I would like to write tests for this behavior before committing |
7a2f4c4
to
8dd3870
Compare
8dd3870
to
2e592ea
Compare
2e592ea
to
6d1073b
Compare
I haven't forgotten about all these PRs. I'm just busy, but they hover near the top of my "TODO" list and "Feels-bad-about-not-yet-merging" list. |
6d1073b
to
9df5a80
Compare
9df5a80
to
94800f1
Compare
94800f1
to
3be531a
Compare
7c53340
to
fa691bb
Compare
fa691bb
to
bafdd41
Compare
bafdd41
to
0769131
Compare
0769131
to
0fed246
Compare
0fed246
to
9f78f34
Compare
Example from #254
The first picture
The second picture
It seems to be the partial solution for point 5 in #153
Update:
Now this is a simple logic that does not cause crashes, while it allows you to partially draw objects that are partially shifted beyond the border. In the first commit, the canvas expanded automatically, but since this is done in the get method, offset modifier expanded the boundaries, although it should not be as a modifier.