mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-06-25 21:54:44 -04:00
Moved size variable from Canvas.gd to Project.gd
This commit is contained in:
parent
4e111a7ac0
commit
f9bd590d20
16 changed files with 79 additions and 73 deletions
|
@ -162,8 +162,8 @@ func draw_brush(sprite : Image, pos : Vector2, color : Color, current_mouse_butt
|
|||
Global.canvas.sprite_changed_this_frame = true
|
||||
|
||||
Global.canvas.previous_mouse_pos_for_lines = pos.floor() + Vector2(0.5, 0.5)
|
||||
Global.canvas.previous_mouse_pos_for_lines.x = clamp(Global.canvas.previous_mouse_pos_for_lines.x, Global.canvas.location.x, Global.canvas.location.x + Global.canvas.size.x)
|
||||
Global.canvas.previous_mouse_pos_for_lines.y = clamp(Global.canvas.previous_mouse_pos_for_lines.y, Global.canvas.location.y, Global.canvas.location.y + Global.canvas.size.y)
|
||||
Global.canvas.previous_mouse_pos_for_lines.x = clamp(Global.canvas.previous_mouse_pos_for_lines.x, Global.canvas.location.x, Global.canvas.location.x + Global.current_project.size.x)
|
||||
Global.canvas.previous_mouse_pos_for_lines.y = clamp(Global.canvas.previous_mouse_pos_for_lines.y, Global.canvas.location.y, Global.canvas.location.y + Global.current_project.size.y)
|
||||
if Global.canvas.is_making_line:
|
||||
Global.canvas.line_2d.set_point_position(0, Global.canvas.previous_mouse_pos_for_lines)
|
||||
|
||||
|
|
|
@ -50,6 +50,7 @@ var right_cursor_tool_texture : ImageTexture
|
|||
var image_clipboard : Image
|
||||
var play_only_tags := true
|
||||
|
||||
# Preferences
|
||||
var theme_type : int = Theme_Types.DARK
|
||||
var default_image_width := 64
|
||||
var default_image_height := 64
|
||||
|
|
|
@ -114,7 +114,7 @@ func open_pxo_file(path : String, untitled_backup : bool = false) -> void:
|
|||
Global.canvas.add_child(guide)
|
||||
guide_line = file.get_line()
|
||||
|
||||
Global.canvas.size = Vector2(width, height)
|
||||
Global.current_project.size = Vector2(width, height)
|
||||
Global.current_project.frames.append(frame_class)
|
||||
frame_line = file.get_line()
|
||||
frame += 1
|
||||
|
@ -214,8 +214,8 @@ func save_pxo_file(path : String, autosave : bool) -> void:
|
|||
# Store frames
|
||||
for frame in Global.current_project.frames:
|
||||
file.store_line("--")
|
||||
file.store_16(Global.canvas.size.x)
|
||||
file.store_16(Global.canvas.size.y)
|
||||
file.store_16(Global.current_project.size.x)
|
||||
file.store_16(Global.current_project.size.y)
|
||||
for cel in frame.cels: # Store canvas layers
|
||||
file.store_line("-")
|
||||
file.store_buffer(cel.image.get_data())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue