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:
parent
b7b3d1d924
commit
0ec3af30f4
|
@ -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.
|
- A VSplitContainer has been added between the canvas and the timeline.
|
||||||
- Notification text is now black on the gold and light themes.
|
- 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)
|
- 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
|
### Fixed
|
||||||
- Chinese characters not being rendered in notifications (the labels that appear when undoing/redoing)
|
- 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 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
|
## [v0.6.2] - 17-02-2020
|
||||||
|
|
||||||
|
|
|
@ -74,18 +74,22 @@ func save_sprite(canvas : Canvas, path : String) -> void:
|
||||||
var whole_image := Image.new()
|
var whole_image := Image.new()
|
||||||
whole_image.create(canvas.size.x, canvas.size.y, false, Image.FORMAT_RGBA8)
|
whole_image.create(canvas.size.x, canvas.size.y, false, Image.FORMAT_RGBA8)
|
||||||
whole_image.lock()
|
whole_image.lock()
|
||||||
|
var layer_i := 0
|
||||||
for layer in canvas.layers:
|
for layer in canvas.layers:
|
||||||
var img : Image = layer[0]
|
if Global.layers[layer_i][1]: # If layer is visible
|
||||||
img.lock()
|
var img : Image = layer[0]
|
||||||
if layer[2] < 1: # If we have layer transparency
|
img.lock()
|
||||||
for xx in img.get_size().x:
|
if layer[2] < 1: # If we have layer transparency
|
||||||
for yy in img.get_size().y:
|
for xx in img.get_size().x:
|
||||||
var pixel_color := img.get_pixel(xx, yy)
|
for yy in img.get_size().y:
|
||||||
var alpha : float = pixel_color.a * layer[4]
|
var pixel_color := img.get_pixel(xx, yy)
|
||||||
img.set_pixel(xx, yy, Color(pixel_color.r, pixel_color.g, pixel_color.b, alpha))
|
var alpha : float = pixel_color.a * layer[4]
|
||||||
|
img.set_pixel(xx, yy, Color(pixel_color.r, pixel_color.g, pixel_color.b, alpha))
|
||||||
|
|
||||||
canvas.blend_rect(whole_image, img, Rect2(canvas.position, canvas.size), Vector2.ZERO)
|
canvas.blend_rect(whole_image, img, Rect2(canvas.position, canvas.size), Vector2.ZERO)
|
||||||
layer[0].lock()
|
layer[0].lock()
|
||||||
|
|
||||||
|
layer_i += 1
|
||||||
|
|
||||||
if resize != 100:
|
if resize != 100:
|
||||||
whole_image.unlock()
|
whole_image.unlock()
|
||||||
|
@ -129,18 +133,22 @@ func save_spritesheet() -> void:
|
||||||
hh = 1
|
hh = 1
|
||||||
dst.y = canvas.size.y * vv
|
dst.y = canvas.size.y * vv
|
||||||
|
|
||||||
|
var layer_i := 0
|
||||||
for layer in canvas.layers:
|
for layer in canvas.layers:
|
||||||
var img : Image = layer[0]
|
if Global.layers[layer_i][1]: # If layer is visible
|
||||||
img.lock()
|
var img : Image = layer[0]
|
||||||
if layer[2] < 1: # If we have layer transparency
|
img.lock()
|
||||||
for xx in img.get_size().x:
|
if layer[2] < 1: # If we have layer transparency
|
||||||
for yy in img.get_size().y:
|
for xx in img.get_size().x:
|
||||||
var pixel_color := img.get_pixel(xx, yy)
|
for yy in img.get_size().y:
|
||||||
var alpha : float = pixel_color.a * layer[4]
|
var pixel_color := img.get_pixel(xx, yy)
|
||||||
img.set_pixel(xx, yy, Color(pixel_color.r, pixel_color.g, pixel_color.b, alpha))
|
var alpha : float = pixel_color.a * layer[4]
|
||||||
|
img.set_pixel(xx, yy, Color(pixel_color.r, pixel_color.g, pixel_color.b, alpha))
|
||||||
|
|
||||||
canvas.blend_rect(whole_image, img, Rect2(canvas.position, canvas.size), dst)
|
canvas.blend_rect(whole_image, img, Rect2(canvas.position, canvas.size), dst)
|
||||||
layer[0].lock()
|
layer[0].lock()
|
||||||
|
|
||||||
|
layer_i += 1
|
||||||
|
|
||||||
if resize != 100:
|
if resize != 100:
|
||||||
whole_image.unlock()
|
whole_image.unlock()
|
||||||
|
|
Loading…
Reference in a new issue