Jump to content

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


NinthDesertDude

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
Link to comment
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.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
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
Link to comment
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...!

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...