mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-02-21 21:13:14 +00:00
Compare commits
5 commits
1b48eac843
...
8c7594a1c8
Author | SHA1 | Date | |
---|---|---|---|
|
8c7594a1c8 | ||
|
1e2e5dc431 | ||
|
501a7d3c02 | ||
|
6ad23f8485 | ||
|
462a95a5ae |
4 changed files with 17 additions and 29 deletions
|
@ -28,6 +28,8 @@ Built using Godot 4.3
|
||||||
- The export dialog has been optimized by caching all of the blended frames. Changing export options, besides the layers, no longer cause slowness by re-blending all of the frames.
|
- The export dialog has been optimized by caching all of the blended frames. Changing export options, besides the layers, no longer cause slowness by re-blending all of the frames.
|
||||||
- Optimized the lasso and polygon select tools, as well as the fill options of the pencil and curve tools. The time they take to complete now depends on the size of the selection, rather than checking all of the pixels of the entire canvas.
|
- Optimized the lasso and polygon select tools, as well as the fill options of the pencil and curve tools. The time they take to complete now depends on the size of the selection, rather than checking all of the pixels of the entire canvas.
|
||||||
- Fixed a crash when re-arranging palette swatches while holding <kbd>Shift</kbd>.
|
- Fixed a crash when re-arranging palette swatches while holding <kbd>Shift</kbd>.
|
||||||
|
- Fixed a crash when using the move tool snapped to the grid.
|
||||||
|
- Fixed a visual bug with the preview of the resize canvas dialog.
|
||||||
- Fixed wrong stretch mode in the cel button previews. [#1097](https://github.com/Orama-Interactive/Pixelorama/pull/1097)
|
- Fixed wrong stretch mode in the cel button previews. [#1097](https://github.com/Orama-Interactive/Pixelorama/pull/1097)
|
||||||
|
|
||||||
## [v1.0.2] - 2024-08-21
|
## [v1.0.2] - 2024-08-21
|
||||||
|
|
|
@ -63,17 +63,22 @@ func commit_action(cel: Image, project := Global.current_project) -> void:
|
||||||
|
|
||||||
var dither_texture := selected_dither_matrix.texture
|
var dither_texture := selected_dither_matrix.texture
|
||||||
var gradient := gradient_edit.gradient
|
var gradient := gradient_edit.gradient
|
||||||
var n_of_colors := gradient.offsets.size()
|
var offsets := gradient.offsets
|
||||||
|
offsets.sort()
|
||||||
|
var n_of_colors := offsets.size()
|
||||||
# Pass the gradient offsets as an array to the shader
|
# Pass the gradient offsets as an array to the shader
|
||||||
# ...but since Godot 3.x doesn't support uniform arrays, instead we construct
|
# ...but we can't provide arrays with variable sizes as uniforms, instead we construct
|
||||||
# a nx1 grayscale texture with each offset stored in each pixel, and pass it to the shader
|
# a nx1 grayscale texture with each offset stored in each pixel, and pass it to the shader
|
||||||
var offsets_image := Image.create(n_of_colors, 1, false, Image.FORMAT_L8)
|
var offsets_image := Image.create(n_of_colors, 1, false, Image.FORMAT_L8)
|
||||||
# Construct an image that contains the selected colors of the gradient without interpolation
|
# Construct an image that contains the selected colors of the gradient without interpolation
|
||||||
var gradient_image := Image.create(n_of_colors, 1, false, Image.FORMAT_RGBA8)
|
var gradient_image := Image.create(n_of_colors, 1, false, Image.FORMAT_RGBA8)
|
||||||
for i in n_of_colors:
|
for i in n_of_colors:
|
||||||
var c := gradient.offsets[i]
|
var c := offsets[i]
|
||||||
offsets_image.set_pixel(i, 0, Color(c, c, c, c))
|
offsets_image.set_pixel(i, 0, Color(c, c, c, c))
|
||||||
gradient_image.set_pixel(i, 0, gradient.colors[i])
|
var actual_index := gradient.offsets.find(offsets[i])
|
||||||
|
if actual_index == -1:
|
||||||
|
actual_index = i
|
||||||
|
gradient_image.set_pixel(i, 0, gradient.colors[actual_index])
|
||||||
var offsets_tex := ImageTexture.create_from_image(offsets_image)
|
var offsets_tex := ImageTexture.create_from_image(offsets_image)
|
||||||
var gradient_tex: Texture2D
|
var gradient_tex: Texture2D
|
||||||
if shader == shader_linear:
|
if shader == shader_linear:
|
||||||
|
|
|
@ -32,10 +32,9 @@ unique_name_in_owner = true
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
mouse_default_cursor_shape = 2
|
mouse_default_cursor_shape = 2
|
||||||
item_count = 2
|
|
||||||
selected = 0
|
selected = 0
|
||||||
|
item_count = 2
|
||||||
popup/item_0/text = "Linear"
|
popup/item_0/text = "Linear"
|
||||||
popup/item_0/id = 0
|
|
||||||
popup/item_1/text = "Radial"
|
popup/item_1/text = "Radial"
|
||||||
popup/item_1/id = 1
|
popup/item_1/id = 1
|
||||||
|
|
||||||
|
@ -47,10 +46,9 @@ text = "Dithering pattern:"
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
mouse_default_cursor_shape = 2
|
mouse_default_cursor_shape = 2
|
||||||
item_count = 1
|
|
||||||
selected = 0
|
selected = 0
|
||||||
|
item_count = 1
|
||||||
popup/item_0/text = "None"
|
popup/item_0/text = "None"
|
||||||
popup/item_0/id = 0
|
|
||||||
|
|
||||||
[node name="RepeatLabel" type="Label" parent="VBoxContainer/GradientOptions" index="4" groups=["gradient_common"]]
|
[node name="RepeatLabel" type="Label" parent="VBoxContainer/GradientOptions" index="4" groups=["gradient_common"]]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
|
@ -60,10 +58,9 @@ text = "Repeat:"
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
mouse_default_cursor_shape = 2
|
mouse_default_cursor_shape = 2
|
||||||
item_count = 4
|
|
||||||
selected = 0
|
selected = 0
|
||||||
|
item_count = 4
|
||||||
popup/item_0/text = "None"
|
popup/item_0/text = "None"
|
||||||
popup/item_0/id = 0
|
|
||||||
popup/item_1/text = "Repeat"
|
popup/item_1/text = "Repeat"
|
||||||
popup/item_1/id = 1
|
popup/item_1/id = 1
|
||||||
popup/item_2/text = "Mirror"
|
popup/item_2/text = "Mirror"
|
||||||
|
|
|
@ -17,25 +17,9 @@ var image := Image.create(1, 1, false, Image.FORMAT_RGBA8)
|
||||||
func _on_ResizeCanvas_about_to_show() -> void:
|
func _on_ResizeCanvas_about_to_show() -> void:
|
||||||
Global.canvas.selection.transform_content_confirm()
|
Global.canvas.selection.transform_content_confirm()
|
||||||
image.resize(Global.current_project.size.x, Global.current_project.size.y)
|
image.resize(Global.current_project.size.x, Global.current_project.size.y)
|
||||||
|
image.fill(Color(0.0, 0.0, 0.0, 0.0))
|
||||||
var layer_i := 0
|
var frame := Global.current_project.frames[Global.current_project.current_frame]
|
||||||
for cel in Global.current_project.frames[Global.current_project.current_frame].cels:
|
DrawingAlgos.blend_layers(image, frame)
|
||||||
var layer := Global.current_project.layers[layer_i]
|
|
||||||
if cel is PixelCel and layer.is_visible_in_hierarchy():
|
|
||||||
var cel_image := Image.new()
|
|
||||||
cel_image.copy_from(cel.get_image())
|
|
||||||
var opacity := cel.get_final_opacity(layer)
|
|
||||||
if opacity < 1.0: # If we have cel transparency
|
|
||||||
for xx in cel_image.get_size().x:
|
|
||||||
for yy in cel_image.get_size().y:
|
|
||||||
var pixel_color := cel_image.get_pixel(xx, yy)
|
|
||||||
pixel_color.a *= cel.opacity
|
|
||||||
cel_image.set_pixel(xx, yy, pixel_color)
|
|
||||||
image.blend_rect(
|
|
||||||
cel_image, Rect2i(Vector2i.ZERO, Global.current_project.size), Vector2i.ZERO
|
|
||||||
)
|
|
||||||
layer_i += 1
|
|
||||||
|
|
||||||
width_spinbox.value = Global.current_project.size.x
|
width_spinbox.value = Global.current_project.size.x
|
||||||
height_spinbox.value = Global.current_project.size.y
|
height_spinbox.value = Global.current_project.size.y
|
||||||
update_preview()
|
update_preview()
|
||||||
|
|
Loading…
Add table
Reference in a new issue