Jump to content

Flawed 90 degree rotations, only affects non-square selections with an odd width or height


Recommended Posts

Expected results
In PDN v5.0.13, rotating a selection by exactly 90 degrees should never result in blurring due to rotation, because this is achievable in all cases through basic matrix translation.

Actual results

In PDN v5.0.13, rotating a selection which is (1) Not square, and (2) has a width and/or height which is not divisible by two results in blurry rotations.

 

Exact Repro steps

1. Open paint.net version 5.0.13 (latest)

2. Select the line tool at line thickness 1, this is the most visible

3. Draw a line any way you want
4. Make a selection including the line and make sure at least one of the dimensions is not divisible by two

5. Press M and hold shift while rotating to make sure it's exactly at 90 degrees. This will result in blurring

 

image.png?ex=668da272&is=668c50f2&hm=c96

If the bounding box has an even width and height, the result is not blurred. This is definitely bug behavior.

  • Upvote 1
Link to comment
Share on other sites

If you're rotating about the center of the selected area (which is always the default), and the width or height is odd, and the other axis is even, then this will always be blurry in the way you describe. I'm unable to reproduce this for something like a 13x7 selection (that is, odd on both axes) -- it always results in sharp output in the way you expect.

 

This is 100% drawing correctly with respect to all of the math involved. If you have a selected area that is odd width and even height, then the center point will be in the middle of a pixel on one axis, but straddling two pixels on the other axis. If you then rotate by 90 degrees then you're making sure that the whole image, on that axis, is shifted by half a pixel in a way that results in it not being sharp.

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

28 minutes ago, Rick Brewster said:

This is 100% drawing correctly with respect to all of the math involved

No. You 100% understand what's happening with the math, but it's not about a bug in the math. I keep raising bugs that are very clearly against user expectation that are being considered non-issues because either it was unexpected and you don't think it's an issue, or because there's a workaround. A user can't be expected to predict or understand why a very common target rotation results in blur, especially when the repro steps are specific. But it will occur often too.

This is definitively bugged because there is no way this is acceptable to a user. It should be special-cased so that rotations do not do this. And while it happens when the selection is odd in one or two dimensions, it doesn't happen if you correct them by as little as 1px to make it even. How would an average user discover that? It's not expected, it has a bad effect on the program, and it's demonstrably going to happen to someone. I don't know why you can't repro the steps so I'm curious what exactly you did, but I guess first you have to consider this a bug and if you don't, I don't think I need to raise any future ones.

Link to comment
Share on other sites

2 hours ago, NinthDesertDude said:

No. You 100% understand what's happening with the math, but it's not about a bug in the math.

Your comment on Discord, where this started, said "Rotation is blurred at 90deg. Shouldn't be, it's an easy matrix translation." That's what I was basing that particular statement on. The very premise of this conversation started as a statement about the math. But the math is correct, we both know that, it's not the problem.

 

The trick with this rotation is that it requires special casing for this one scenario so that it arbitrarily rounds things in a particular direction. In this case I'm not keen on doing that. I would certainly like to have better mechanisms in place for snapping, and I've mostly erred on the side of not snapping/rounding. This requires some design work because there are MANY MANY places that would require fixups for this, and there would be A LOT of wrestling with floating point (im)precision, and there hasn't been a lot of demand for it so it hasn't been prioritized. The usual.

 

You sound very upset, but this is coming out of left field for me? I haven't seen any indication prior to this that you were upset about anything. I've fixed some of the bugs you've reported, I obviously haven't fixed or agreed with all of them, and others I probably just haven't gotten to. If you think I've misfired on a specific issue, which certainly happens, then go ahead and push back, but we should be able to talk about this professionally. Please don't take it personally if I disagree with you or if you think I got it wrong.

  • Upvote 1

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...