mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-18 17:19:50 +00:00
Change guides when switching project
This commit is contained in:
parent
fc03e83377
commit
736521246d
|
@ -89,7 +89,7 @@ boot_splash/bg_color=Color( 0.145098, 0.145098, 0.164706, 1 )
|
|||
config/icon="res://assets/graphics/icons/icon.png"
|
||||
config/macos_native_icon="res://assets/graphics/icons/icon.icns"
|
||||
config/windows_native_icon="res://assets/graphics/icons/icon.ico"
|
||||
config/Version="v0.7.1"
|
||||
config/Version="v0.8-dev"
|
||||
|
||||
[autoload]
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ var layers := [] setget layers_changed # Array of Layers
|
|||
var current_frame := 0 setget frame_changed
|
||||
var current_layer := 0 setget layer_changed
|
||||
var animation_tags := [] setget animation_tags_changed # Array of AnimationTags
|
||||
#var guides := [] # Array of Guides
|
||||
var guides := [] # Array of Guides
|
||||
|
||||
var brushes := [] # Array of Images
|
||||
var brush_images := [Image.new(), Image.new()]
|
||||
|
@ -91,6 +91,7 @@ func change_project() -> void:
|
|||
|
||||
self.animation_tags = animation_tags
|
||||
|
||||
# Change the selection rectangle
|
||||
if selected_pixels.size() != 0:
|
||||
Global.selection_rectangle.polygon[0] = Vector2(x_min, y_min)
|
||||
Global.selection_rectangle.polygon[1] = Vector2(x_max, y_min)
|
||||
|
@ -102,6 +103,13 @@ func change_project() -> void:
|
|||
Global.selection_rectangle.polygon[2] = Vector2.ZERO
|
||||
Global.selection_rectangle.polygon[3] = Vector2.ZERO
|
||||
|
||||
for guide in Global.canvas.get_children():
|
||||
if guide is Guide:
|
||||
if guide in guides:
|
||||
guide.visible = true
|
||||
else:
|
||||
guide.visible = false
|
||||
|
||||
|
||||
func frames_changed(value : Array) -> void:
|
||||
frames = value
|
||||
|
|
|
@ -13,6 +13,7 @@ var type = Types.HORIZONTAL
|
|||
func _ready() -> void:
|
||||
width = 0.1
|
||||
default_color = Global.guide_color
|
||||
Global.current_project.guides.append(self)
|
||||
|
||||
|
||||
func _input(_event : InputEvent):
|
||||
|
@ -31,7 +32,7 @@ func _input(_event : InputEvent):
|
|||
has_focus = true
|
||||
Global.has_focus = false
|
||||
update()
|
||||
if has_focus:
|
||||
if has_focus and visible:
|
||||
if Input.is_action_just_pressed("left_mouse"):
|
||||
previous_points = points
|
||||
if Input.is_action_pressed("left_mouse"):
|
||||
|
|
Loading…
Reference in a new issue