1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 17:19:50 +00:00

Layer visibility is taken into account when exporting the drawing as a .png file

This means that invisible layers will not be included in the final .png file.
This commit is contained in:
OverloadedOrama 2020-03-19 19:28:05 +02:00
parent b7b3d1d924
commit 0ec3af30f4
2 changed files with 31 additions and 20 deletions

View file

@ -17,10 +17,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- A VSplitContainer has been added between the canvas and the timeline.
- Notification text is now black on the gold and light themes.
- Layer's LineEdit now saves the changes when it loses focus, or when the user presses ESC (or Enter)
- LineEdits lose focus when the user presses Enter - thanks to Gaarco!
- Layer visibility is taken into account when exporting the drawing as a .png file. This means that invisible layers will not be included in the final .png file.
### Fixed
- Chinese characters not being rendered in notifications (the labels that appear when undoing/redoing)
- Fixed issue when moving frames, the current frame was being shown but the frame next to it was actually the one being drawn on.
- Fixed issue with LineEdits not letting go of focus when the user clicked somewhere else - Thanks to Gaarco! (Issue #167)
## [v0.6.2] - 17-02-2020

View file

@ -74,7 +74,9 @@ func save_sprite(canvas : Canvas, path : String) -> void:
var whole_image := Image.new()
whole_image.create(canvas.size.x, canvas.size.y, false, Image.FORMAT_RGBA8)
whole_image.lock()
var layer_i := 0
for layer in canvas.layers:
if Global.layers[layer_i][1]: # If layer is visible
var img : Image = layer[0]
img.lock()
if layer[2] < 1: # If we have layer transparency
@ -87,6 +89,8 @@ func save_sprite(canvas : Canvas, path : String) -> void:
canvas.blend_rect(whole_image, img, Rect2(canvas.position, canvas.size), Vector2.ZERO)
layer[0].lock()
layer_i += 1
if resize != 100:
whole_image.unlock()
whole_image.resize(whole_image.get_size().x * resize / 100, whole_image.get_size().y * resize / 100, interpolation)
@ -129,7 +133,9 @@ func save_spritesheet() -> void:
hh = 1
dst.y = canvas.size.y * vv
var layer_i := 0
for layer in canvas.layers:
if Global.layers[layer_i][1]: # If layer is visible
var img : Image = layer[0]
img.lock()
if layer[2] < 1: # If we have layer transparency
@ -142,6 +148,8 @@ func save_spritesheet() -> void:
canvas.blend_rect(whole_image, img, Rect2(canvas.position, canvas.size), dst)
layer[0].lock()
layer_i += 1
if resize != 100:
whole_image.unlock()
whole_image.resize(width * resize / 100, height * resize / 100, interpolation)