Jump to content

Layer Window Bug


Recommended Posts

A layer can "disappear" from the Layer Window. Still actually there but needs user input before it will revalidate.

Steps to reproduce:

1. Open an image

LayerWindowBug%20(3.0%20Alpha%203)%20-%20Step%201.png

2. Create a new layer (Layer 2)

3. Move Layer 2 to bottom

LayerWindowBug%20(3.0%20Alpha%203)%20-%20Step%202.png

4. Select original layer

5. Zoom in 3200%

LayerWindowBug%20(3.0%20Alpha%203)%20-%20Step%203.png

6. Gaussian Blur

7. Zoom Window

LayerWindowBug%20(3.0%20Alpha%203)%20-%20Step%204.png

8. Import Layer From File

LayerWindowBug%20(3.0%20Alpha%203)%20-%20Step%205.png

-- Layer 2 is no longer visible in the Layer Window.

Link to comment
Share on other sites

I have a layer window bug for you...

The background layer is listed in italics--that's fine.

However if you move a layer below it, the original background layer is still listed in italics and the new background layer is not.

What is the meaning of italics in this case?

Is there any point in displaying any layer name in italics?

Click to play:
j.pngs.pngd.pnga.pngp.png
Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game

Link to comment
Share on other sites

Actually that's a good question BoltBait. In older versions of Paint.NET, it wouldn't let you move, delete, or rename the Background layer. Everyone hated it, so now those restrictions are gone.

I've considered treating the background layer in special ways, such as having it implicitely be opaque so that erasing its contents would not reveal the 'checkerboard' pattern -- Photoshop does this for instance. But this would just make things non-uniform in seemingly random or "buggy" ways (seemingly buggy, mind you).

But, in the end, the only thing that the 'background' property does now is one small change in the Image->Canvas Size behavior: when expanding the canvas size, if the layer is the background, the new area will be filled with the Secondary color. Otherwise, it will be filled with transparency.

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

But, in the end, the only thing that the 'background' property does now is one small change in the Image->Canvas Size behavior: when expanding the canvas size, if the layer is the background, the new area will be filled with the Secondary color. Otherwise, it will be filled with transparency.

I say, make it be filled with transparency, get rid of the italics, and be done with it. :P

Click to play:
j.pngs.pngd.pnga.pngp.png
Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game

Link to comment
Share on other sites

I will then make sure to forward to you the 1000 e-mails I end up getting that look like this:

Hello,

When I make the image bigger it turns into a checkerboard! What in the world?!

Consider that the most common use case for Paint.NET is to open a regular 1-layer image (like oh, a JPEG) and to do simple 1-layer manipulations to it (crop, brightness, resize, save as another format). Transparency is the farthest thing from most people's considerations.

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

Images Added Above...

I also found out during screen capture, that if you paste a new during the process, the problem does not occur. I have duplicated the bug on two computers (both WinXP SP2), open a new instance of Paint.NET and follow the steps above to duplicate.

Link to comment
Share on other sites

Images Added Above...

I also found out during screen capture, that if you paste a new during the process, the problem does not occur. I have duplicated the bug on two computers (both WinXP SP2), open a new instance of Paint.NET and follow the steps above to duplicate.

If you then resize the Layers window, does it redraw and then display correctly?

Also, it looks like at step 8 you are answering 'no' to the dialog that asks you to expand the canvas size. Correct?

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

OK, make the bottom most layer always shown in italics. Make it work as before.

That's one way to do it. But "isBackground" is stored in the file, so now you're asking me to add a bunch of extra logic to the .PDN image read/write code. This is code that works great as it is, mind you! Plus that would break forwards file format compatibility -- files saved in 3.0 would not open in 2.72, whereas they otherwise should. Plus, a layer object by itself has no notion of 'where' it is, so the 'isBackground' logic would have to be moved to other places of the code: anytime a layer is added, moved, deleted, or otherwise positionally altered, there would have to be code to figure out how to cope with the 'isBackground' bit. So your idea, while simple at the surface, actually adds a lot of complexity and introduces risk to simplify something that really isn't in grand need of simplification (IMO of course -- and I'm the dev lead ;)).

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

If you then resize the Layers window, does it redraw and then display correctly?
Yes.
Also, it looks like at step 8 you are answering 'no' to the dialog that asks you to expand the canvas size. Correct?
In the above example, yes, but not necessary. I have imported an image of the same size and still get the bug to happen.
Link to comment
Share on other sites

If you then resize the Layers window, does it redraw and then display correctly?
Yes.

Ok that's probably a pretty simple bug then. There are parts of the code where redrawing is temporarily disabled to prevent flickering or to enable operations to appear atomic (i.e. if I had 8 things to a list, it looks better to have them all appear at once than to redraw 8 times after I add each one in turn). Probably just re-enabled redrawing but then forgot to refresh the window.

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

OK, make the bottom most layer always shown in italics. Make it work as before.

That's one way to do it. But "isBackground" is stored in the file, so now you're asking me to add a bunch of extra logic to the .PDN image read/write code. This is code that works great as it is, mind you! Plus that would break forwards file format compatibility -- files saved in 3.0 would not open in 2.72, whereas they otherwise should. Plus, a layer object by itself has no notion of 'where' it is, so the 'isBackground' logic would have to be moved to other places of the code: anytime a layer is added, moved, deleted, or otherwise positionally altered, there would have to be code to figure out how to cope with the 'isBackground' bit. So your idea, while simple at the surface, actually adds a lot of complexity and introduces risk to simplify something that really isn't in grand need of simplification (IMO of course -- and I'm the dev lead ;)).

In that case, you could probably just modify three sections of code: Move Layer Down, Delete Layer, and Load File.

At the end of each of those routines, adjust the isBackground property as necessary.

It's only minorly annoying. I'll drop it.

YOU KNOW... you could just not display it in italics and no one would be the wiser. ;)

Click to play:
j.pngs.pngd.pnga.pngp.png
Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game

Link to comment
Share on other sites

It creates a bug hazard. Any time I do code like this I would also have to remember to update that big of data. Elimination and avoidance of bug hazards is something I can cite as having a profound effect on Paint.NET's code quality and stability over its development.

Anyway it's really not a big deal either way, it just doesn't warrant the attention. I've yet to receive any other questions or concerns about it.

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.

 Share

×
×
  • Create New...