Bug 389546 - .kra-based file layer with only one layer fills the canvas with white
Summary: .kra-based file layer with only one layer fills the canvas with white
Status: RESOLVED NOT A BUG
Alias: None
Product: krita
Classification: Applications
Component: Layer Stack (other bugs)
Version First Reported In: 4.0.0-beta.1
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-28 10:29 UTC by Nathan GDquest
Modified: 2018-04-02 22:56 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Tileset example with a file layer that fills the canvas with white (528.01 KB, application/x-zip-compressed)
2018-01-28 10:29 UTC, Nathan GDquest
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan GDquest 2018-01-28 10:29:58 UTC
Created attachment 110173 [details]
Tileset example with a file layer that fills the canvas with white

If you use a .kra document as a file layer and it has only one layer, it is not transparent: instead Krita draws the content of the kra document and fills the rest of the canvas with white.

You have to add a second layer to the kra file from the file layer for it to become transparent.

See the attached project.
Comment 1 Raghavendra kamath 2018-02-03 19:43:17 UTC
+1 I can reproduce this with the attached document
Comment 2 Dmitry Kazakov 2018-04-02 14:51:12 UTC
Hi, Nathan!

I'm afraid that such behavior is "by design".

The problem is that you have created corner.kra with the background's default pixel color set to white. When the image is pasted into autotile-pit.kra, this corner's layer is virtually extended into the size of the new image, therefore filling everything with it default color (white). The same thing will happen if you just D&D a layer from corner.kra into autotile-pit.kra --- it will extend to the full area.

To overcome the issue, please open corner.kra, activate the layer, then press:
1) Ctrl+A
2) Ctrl+C
3) Ctrl+V
4) Ctrl+D
5) Remove the original layer
6) Ctrl+S

When pasting, Krita automatically creates a layer with fully transparent pixel, that is exactly what you need for embedding the document into other files.

PS:
We probably need to some better UIX for dealing with the default pixel color of the layer...
Comment 3 Nathan GDquest 2018-04-02 22:56:54 UTC
It makes sense! I got tricked by the fact the corner was completely painted and this fill extends to the new document's bounds. Didn't expect the latter but it's good to know. Problem solved :)