Sign in to follow this  
Joshua Lamusga

Selections out-of-bounds use the out-of-bounds pixels when resizing

Recommended Posts

Specs

Paint.net version 4.0.19 running on Windows 10 64-bit Home edition

 

Problem

Normally, making a selection with e.g. the rectangular select tool will constrain the selected pixels to the actual canvas. That is, you can't make a selection that goes out-of-bounds of the canvas. However, if you make a selection and move the selection itself so it's partially out-of-bounds, those pixels are ignored when pixels within that selection are moved -- until the selected pixels are resized. This causes inconsistent behavior.


Removing the selected region outside of the actual canvas when the user is done (step 3) should solve this problem.

 

Steps to Reproduce

1) Open paint.net.

2) Make a large selection, then press M twice so you can manipulate the selection without affecting pixels.

4) Drag part of the selection out of bounds.

5) Press M so you're manipulating pixels again.

6) Drag the selection somewhere like the middle of the screen.

7) Resize the selected pixels. You should see the section that was off-screen suddenly appear as transparent pixels.

 

Examples

5a4587004aa21_PixelsBug.thumb.png.fca9140158452bc9ca12f120004dc18d.png

Edited by Joshua Lamusga

Share this post


Link to post
Share on other sites

Oh wow, you found a new bug here!

 

This all works correct until the very last step. If you try this out with something like a photograph, up until step 6 (the 5th picture), it's more obvious that the "pixels" you dragged from outside of the canvas are actually just non-existent. But the fact that they convert into overwriting transparent pixels in the last step is certainly a bug.

Share this post


Link to post
Share on other sites

Yep, that's the bug. I think snipping the selected region according to the physical canvas bounds is the solution. Then you don't have to worry about weird behavior. Rotating would probably also cause that issue in step 6.

Edited by Joshua Lamusga

Share this post


Link to post
Share on other sites

If you switch the toolbar from Bilinear to Nearest Neighbor, then the issue goes away.

 

So, this at least does a very good job of isolating where this problem is in the code...!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this