1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-02-20 12:33:14 +00:00

Minor code/scene changes

Renames "Centralize" to "Center", as it is a more appropriate verb.
This commit is contained in:
Emmanouil Papadeas 2023-07-08 17:47:24 +03:00
parent 82aa3f5304
commit 6e46cf0c8d
10 changed files with 18 additions and 20 deletions

View file

@ -158,7 +158,7 @@ msgstr ""
msgid "Wrap around:"
msgstr ""
msgid "Centralize Image"
msgid "Center Frames"
msgstr ""
msgid "Rotate Image"

View file

@ -462,11 +462,11 @@ func scale_image(width: int, height: int, interpolation: int) -> void:
general_undo_scale()
func centralize(indices: Array) -> void:
func center(indices: Array) -> void:
var project: Project = Global.current_project
Global.canvas.selection.transform_content_confirm()
project.undos += 1
project.undo_redo.create_action("Centralize")
project.undo_redo.create_action("Center Frames")
for frame in indices:
# Find used rect of the current frame (across all of the layers)
var used_rect := Rect2()
@ -479,7 +479,7 @@ func centralize(indices: Array) -> void:
if used_rect.has_no_area():
continue
# Now apply Centralization
# Now apply centering
var offset: Vector2 = (0.5 * (project.size - used_rect.size)).floor()
for cel in project.frames[frame].cels:
if not cel is PixelCel:

View file

@ -463,7 +463,7 @@ func undo_or_redo(
"Select",
"Move Selection",
"Scale",
"Centralize",
"Center Frames",
"Merge Layer",
"Link Cel",
"Unlink Cel"

View file

@ -54,7 +54,6 @@ func update_texture() -> void:
if self in Global.current_project.frames[frame].cels:
for cel in link_set["cels"]:
cel.emit_signal("texture_changed")
return
func serialize() -> Dictionary:

View file

@ -331,6 +331,7 @@ func draw_fill_gap(start: Vector2, end: Vector2) -> void:
var x := start.x
var y := start.y
_prepare_tool()
# This needs to be a dictionary to ensure duplicate coordinates are not being added
var coords_to_draw := {}
while !(x == end.x && y == end.y):
e2 = err << 1
@ -340,8 +341,7 @@ func draw_fill_gap(start: Vector2, end: Vector2) -> void:
if e2 <= dx:
err += dx
y += sy
#coords_to_draw.append_array(_draw_tool(Vector2(x, y)))
var current_pixel_coord = Vector2(x, y)
var current_pixel_coord := Vector2(x, y)
if _spacing_mode:
current_pixel_coord = get_spacing_position(current_pixel_coord)
for coord in _draw_tool(current_pixel_coord):

View file

@ -246,7 +246,6 @@ margin_left = 36.0
margin_right = 382.0
margin_bottom = 24.0
size_flags_horizontal = 3
align = 2
caret_blink = true
caret_blink_speed = 0.5

View file

@ -1,9 +1,8 @@
extends ImageEffect
enum Animate { OFFSET_X, OFFSET_Y }
var offset := Vector2(5, 5)
var color := Color.black
var shader: Shader = load("res://src/Shaders/DropShadow.tres")
var shader: Shader = preload("res://src/Shaders/DropShadow.tres")
onready var shadow_color := $VBoxContainer/ShadowOptions/ShadowColor as ColorPickerButton
@ -25,8 +24,8 @@ func _ready() -> void:
func commit_action(cel: Image, project: Project = Global.current_project) -> void:
var offset_x = animate_panel.get_animated_value(commit_idx, Animate.OFFSET_X)
var offset_y = animate_panel.get_animated_value(commit_idx, Animate.OFFSET_Y)
var offset_x := animate_panel.get_animated_value(commit_idx, Animate.OFFSET_X)
var offset_y := animate_panel.get_animated_value(commit_idx, Animate.OFFSET_Y)
var selection_tex := ImageTexture.new()
if selection_checkbox.pressed and project.has_selection:
selection_tex.create_from_image(project.selection_map, 0)
@ -45,8 +44,7 @@ func commit_action(cel: Image, project: Project = Global.current_project) -> voi
yield(gen, "done")
func _on_OffsetSliders_value_changed(value: Vector2) -> void:
offset = value
func _on_OffsetSliders_value_changed(_value: Vector2) -> void:
update_preview()

View file

@ -5,7 +5,6 @@
[ext_resource path="res://src/UI/Nodes/ValueSliderV2.tscn" type="PackedScene" id=3]
[node name="DropShadowDialog" instance=ExtResource( 1 )]
visible = false
window_title = "Drop Shadow"
script = ExtResource( 2 )
@ -70,6 +69,9 @@ color = Color( 0.0823529, 0.0823529, 0.0823529, 0.627451 )
margin_top = 308.0
margin_bottom = 332.0
[node name="AffectOptionButton" parent="VBoxContainer/OptionsContainer" index="1"]
items = [ "Selected cels", null, false, 0, null, "Current frame", null, false, 1, null, "All frames", null, false, 2, null, "All projects", null, false, 3, null ]
[node name="AnimateDialog" parent="." index="4"]
margin_bottom = 340.0

View file

@ -1,6 +1,6 @@
extends Button
enum { REMOVE, CLONE, MOVE_LEFT, MOVE_RIGHT, PROPERTIES, REVERSE, CENTRALIZE }
enum { REMOVE, CLONE, MOVE_LEFT, MOVE_RIGHT, PROPERTIES, REVERSE, CENTER }
var frame := 0
@ -92,8 +92,8 @@ func _on_PopupMenu_id_pressed(id: int) -> void:
Global.dialog_open(true)
REVERSE:
Global.animation_timeline.reverse_frames(indices)
CENTRALIZE:
DrawingAlgos.centralize(indices)
CENTER:
DrawingAlgos.center(indices)
func change_frame_order(rate: int) -> void:

View file

@ -20,7 +20,7 @@ __meta__ = {
margin_right = 20.0
margin_bottom = 20.0
mouse_default_cursor_shape = 2
items = [ "Remove Frame", null, 0, false, true, -1, 0, null, "", false, "Clone Frame", null, 0, false, false, -1, 0, null, "", false, "Move Left", null, 0, false, true, -1, 0, null, "", false, "Move Right", null, 0, false, true, -1, 0, null, "", false, "Frame Properties", null, 0, false, false, -1, 0, null, "", false, "Reverse Frames", null, 0, false, true, 5, 0, null, "", false, "Centralize Frames", null, 0, false, false, 6, 0, null, "", false ]
items = [ "Remove Frame", null, 0, false, true, -1, 0, null, "", false, "Clone Frame", null, 0, false, false, -1, 0, null, "", false, "Move Left", null, 0, false, true, -1, 0, null, "", false, "Move Right", null, 0, false, true, -1, 0, null, "", false, "Frame Properties", null, 0, false, false, -1, 0, null, "", false, "Reverse Frames", null, 0, false, true, 5, 0, null, "", false, "Center Frames", null, 0, false, false, 6, 0, null, "", false ]
__meta__ = {
"_edit_use_anchors_": false
}