mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-02-21 13:03:13 +00:00
Minor code/scene changes
Renames "Centralize" to "Center", as it is a more appropriate verb.
This commit is contained in:
parent
82aa3f5304
commit
6e46cf0c8d
10 changed files with 18 additions and 20 deletions
|
@ -158,7 +158,7 @@ msgstr ""
|
||||||
msgid "Wrap around:"
|
msgid "Wrap around:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Centralize Image"
|
msgid "Center Frames"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Rotate Image"
|
msgid "Rotate Image"
|
||||||
|
|
|
@ -462,11 +462,11 @@ func scale_image(width: int, height: int, interpolation: int) -> void:
|
||||||
general_undo_scale()
|
general_undo_scale()
|
||||||
|
|
||||||
|
|
||||||
func centralize(indices: Array) -> void:
|
func center(indices: Array) -> void:
|
||||||
var project: Project = Global.current_project
|
var project: Project = Global.current_project
|
||||||
Global.canvas.selection.transform_content_confirm()
|
Global.canvas.selection.transform_content_confirm()
|
||||||
project.undos += 1
|
project.undos += 1
|
||||||
project.undo_redo.create_action("Centralize")
|
project.undo_redo.create_action("Center Frames")
|
||||||
for frame in indices:
|
for frame in indices:
|
||||||
# Find used rect of the current frame (across all of the layers)
|
# Find used rect of the current frame (across all of the layers)
|
||||||
var used_rect := Rect2()
|
var used_rect := Rect2()
|
||||||
|
@ -479,7 +479,7 @@ func centralize(indices: Array) -> void:
|
||||||
if used_rect.has_no_area():
|
if used_rect.has_no_area():
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Now apply Centralization
|
# Now apply centering
|
||||||
var offset: Vector2 = (0.5 * (project.size - used_rect.size)).floor()
|
var offset: Vector2 = (0.5 * (project.size - used_rect.size)).floor()
|
||||||
for cel in project.frames[frame].cels:
|
for cel in project.frames[frame].cels:
|
||||||
if not cel is PixelCel:
|
if not cel is PixelCel:
|
||||||
|
|
|
@ -463,7 +463,7 @@ func undo_or_redo(
|
||||||
"Select",
|
"Select",
|
||||||
"Move Selection",
|
"Move Selection",
|
||||||
"Scale",
|
"Scale",
|
||||||
"Centralize",
|
"Center Frames",
|
||||||
"Merge Layer",
|
"Merge Layer",
|
||||||
"Link Cel",
|
"Link Cel",
|
||||||
"Unlink Cel"
|
"Unlink Cel"
|
||||||
|
|
|
@ -54,7 +54,6 @@ func update_texture() -> void:
|
||||||
if self in Global.current_project.frames[frame].cels:
|
if self in Global.current_project.frames[frame].cels:
|
||||||
for cel in link_set["cels"]:
|
for cel in link_set["cels"]:
|
||||||
cel.emit_signal("texture_changed")
|
cel.emit_signal("texture_changed")
|
||||||
return
|
|
||||||
|
|
||||||
|
|
||||||
func serialize() -> Dictionary:
|
func serialize() -> Dictionary:
|
||||||
|
|
|
@ -331,6 +331,7 @@ func draw_fill_gap(start: Vector2, end: Vector2) -> void:
|
||||||
var x := start.x
|
var x := start.x
|
||||||
var y := start.y
|
var y := start.y
|
||||||
_prepare_tool()
|
_prepare_tool()
|
||||||
|
# This needs to be a dictionary to ensure duplicate coordinates are not being added
|
||||||
var coords_to_draw := {}
|
var coords_to_draw := {}
|
||||||
while !(x == end.x && y == end.y):
|
while !(x == end.x && y == end.y):
|
||||||
e2 = err << 1
|
e2 = err << 1
|
||||||
|
@ -340,8 +341,7 @@ func draw_fill_gap(start: Vector2, end: Vector2) -> void:
|
||||||
if e2 <= dx:
|
if e2 <= dx:
|
||||||
err += dx
|
err += dx
|
||||||
y += sy
|
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:
|
if _spacing_mode:
|
||||||
current_pixel_coord = get_spacing_position(current_pixel_coord)
|
current_pixel_coord = get_spacing_position(current_pixel_coord)
|
||||||
for coord in _draw_tool(current_pixel_coord):
|
for coord in _draw_tool(current_pixel_coord):
|
||||||
|
|
|
@ -246,7 +246,6 @@ margin_left = 36.0
|
||||||
margin_right = 382.0
|
margin_right = 382.0
|
||||||
margin_bottom = 24.0
|
margin_bottom = 24.0
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
align = 2
|
|
||||||
caret_blink = true
|
caret_blink = true
|
||||||
caret_blink_speed = 0.5
|
caret_blink_speed = 0.5
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
extends ImageEffect
|
extends ImageEffect
|
||||||
|
|
||||||
enum Animate { OFFSET_X, OFFSET_Y }
|
enum Animate { OFFSET_X, OFFSET_Y }
|
||||||
var offset := Vector2(5, 5)
|
|
||||||
var color := Color.black
|
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
|
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:
|
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_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_y := animate_panel.get_animated_value(commit_idx, Animate.OFFSET_Y)
|
||||||
var selection_tex := ImageTexture.new()
|
var selection_tex := ImageTexture.new()
|
||||||
if selection_checkbox.pressed and project.has_selection:
|
if selection_checkbox.pressed and project.has_selection:
|
||||||
selection_tex.create_from_image(project.selection_map, 0)
|
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")
|
yield(gen, "done")
|
||||||
|
|
||||||
|
|
||||||
func _on_OffsetSliders_value_changed(value: Vector2) -> void:
|
func _on_OffsetSliders_value_changed(_value: Vector2) -> void:
|
||||||
offset = value
|
|
||||||
update_preview()
|
update_preview()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
[ext_resource path="res://src/UI/Nodes/ValueSliderV2.tscn" type="PackedScene" id=3]
|
[ext_resource path="res://src/UI/Nodes/ValueSliderV2.tscn" type="PackedScene" id=3]
|
||||||
|
|
||||||
[node name="DropShadowDialog" instance=ExtResource( 1 )]
|
[node name="DropShadowDialog" instance=ExtResource( 1 )]
|
||||||
visible = false
|
|
||||||
window_title = "Drop Shadow"
|
window_title = "Drop Shadow"
|
||||||
script = ExtResource( 2 )
|
script = ExtResource( 2 )
|
||||||
|
|
||||||
|
@ -70,6 +69,9 @@ color = Color( 0.0823529, 0.0823529, 0.0823529, 0.627451 )
|
||||||
margin_top = 308.0
|
margin_top = 308.0
|
||||||
margin_bottom = 332.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"]
|
[node name="AnimateDialog" parent="." index="4"]
|
||||||
margin_bottom = 340.0
|
margin_bottom = 340.0
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
extends Button
|
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
|
var frame := 0
|
||||||
|
|
||||||
|
@ -92,8 +92,8 @@ func _on_PopupMenu_id_pressed(id: int) -> void:
|
||||||
Global.dialog_open(true)
|
Global.dialog_open(true)
|
||||||
REVERSE:
|
REVERSE:
|
||||||
Global.animation_timeline.reverse_frames(indices)
|
Global.animation_timeline.reverse_frames(indices)
|
||||||
CENTRALIZE:
|
CENTER:
|
||||||
DrawingAlgos.centralize(indices)
|
DrawingAlgos.center(indices)
|
||||||
|
|
||||||
|
|
||||||
func change_frame_order(rate: int) -> void:
|
func change_frame_order(rate: int) -> void:
|
||||||
|
|
|
@ -20,7 +20,7 @@ __meta__ = {
|
||||||
margin_right = 20.0
|
margin_right = 20.0
|
||||||
margin_bottom = 20.0
|
margin_bottom = 20.0
|
||||||
mouse_default_cursor_shape = 2
|
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__ = {
|
__meta__ = {
|
||||||
"_edit_use_anchors_": false
|
"_edit_use_anchors_": false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue