mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-06-25 06:54:43 -04:00
Retain the zoom factor when adding a new frame
Also, when importing a PNG, the window title changes.
This commit is contained in:
parent
31a67fcbc2
commit
704dcf90c0
4 changed files with 104 additions and 99 deletions
|
@ -27,7 +27,6 @@ func _input(event : InputEvent) -> void:
|
|||
# Zoom Camera
|
||||
func zoom_camera(dir : int) -> void:
|
||||
var zoom_margin = zoom * dir / 10
|
||||
#if zoom + zoom_margin > zoom_min && zoom + zoom_margin < zoom_max:
|
||||
if zoom + zoom_margin > zoom_min:
|
||||
zoom += zoom_margin
|
||||
|
||||
|
|
|
@ -53,7 +53,9 @@ func _ready() -> void:
|
|||
frame_texture_rect = Global.find_node_by_name(frame_button, "FrameTexture")
|
||||
frame_texture_rect.texture = layers[0][1] #ImageTexture current_layer_index
|
||||
|
||||
camera_zoom()
|
||||
#Only handle camera zoom settings & offset on the first frame
|
||||
if Global.canvases[0] == self:
|
||||
camera_zoom()
|
||||
|
||||
func camera_zoom() -> void:
|
||||
#Set camera zoom based on the sprite size
|
||||
|
|
|
@ -514,6 +514,9 @@ func _on_ImportSprites_files_selected(paths) -> void:
|
|||
|
||||
Global.undo_redo.clear_history(false)
|
||||
|
||||
var first_path : String = paths[0]
|
||||
OS.set_window_title(first_path.get_file() + " (imported) - Pixelorama")
|
||||
|
||||
func clear_canvases() -> void:
|
||||
for child in Global.vbox_layer_container.get_children():
|
||||
if child is PanelContainer:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue