Skip to content

Commit

Permalink
Fix symmetry points being wrong on project initialization
Browse files Browse the repository at this point in the history
The symmetry points were wrong if the "Show Guides" option in the View menu is toggled off, and mirroring was enabled.
  • Loading branch information
OverloadedOrama committed Jul 4, 2022
1 parent 23f591a commit f432def
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/Classes/Project.gd
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,19 @@ func _init(_frames := [], _name := tr("untitled"), _size := Vector2(64, 64)) ->
OpenSave.current_save_paths.append("")
OpenSave.backup_save_paths.append("")

x_symmetry_point = size.x / 2
y_symmetry_point = size.y / 2
x_symmetry_point = size.x
y_symmetry_point = size.y

x_symmetry_axis.type = x_symmetry_axis.Types.HORIZONTAL
x_symmetry_axis.project = self
x_symmetry_axis.add_point(Vector2(-19999, y_symmetry_point))
x_symmetry_axis.add_point(Vector2(19999, y_symmetry_point))
x_symmetry_axis.add_point(Vector2(-19999, y_symmetry_point / 2 + 0.5))
x_symmetry_axis.add_point(Vector2(19999, y_symmetry_point / 2 + 0.5))
Global.canvas.add_child(x_symmetry_axis)

y_symmetry_axis.type = y_symmetry_axis.Types.VERTICAL
y_symmetry_axis.project = self
y_symmetry_axis.add_point(Vector2(x_symmetry_point, -19999))
y_symmetry_axis.add_point(Vector2(x_symmetry_point, 19999))
y_symmetry_axis.add_point(Vector2(x_symmetry_point / 2 + 0.5, -19999))
y_symmetry_axis.add_point(Vector2(x_symmetry_point / 2 + 0.5, 19999))
Global.canvas.add_child(y_symmetry_axis)

if OS.get_name() == "HTML5":
Expand Down
2 changes: 1 addition & 1 deletion src/UI/Canvas/Rulers/SymmetryGuide.gd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class_name SymmetryGuide
extends Guide

var _texture = preload("res://assets/graphics/dotted_line.png")
var _texture: Texture = preload("res://assets/graphics/dotted_line.png")


func _ready() -> void:
Expand Down

0 comments on commit f432def

Please sign in to comment.