diff --git a/assets/graphics/dotted_line.png b/assets/graphics/dotted_line.png new file mode 100644 index 000000000..d322af80d Binary files /dev/null and b/assets/graphics/dotted_line.png differ diff --git a/assets/graphics/dotted_line.png.import b/assets/graphics/dotted_line.png.import new file mode 100644 index 000000000..a5869898a --- /dev/null +++ b/assets/graphics/dotted_line.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/dotted_line.png-9a94e4e6ebf9c11e53076f53e529d37a.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/graphics/dotted_line.png" +dest_files=[ "res://.import/dotted_line.png-9a94e4e6ebf9c11e53076f53e529d37a.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=1 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/src/UI/Rulers/SymmetryGuide.gd b/src/UI/Rulers/SymmetryGuide.gd index 0e08794ce..43f8a7b39 100644 --- a/src/UI/Rulers/SymmetryGuide.gd +++ b/src/UI/Rulers/SymmetryGuide.gd @@ -1,10 +1,18 @@ class_name SymmetryGuide extends Guide +var _texture = preload("res://assets/graphics/dotted_line.png") + + func _ready() -> void: ._ready() has_focus = false visible = false + texture = _texture + texture_mode = Line2D.LINE_TEXTURE_TILE + width = Global.camera.zoom.x * 4 + yield(get_tree().create_timer(0.01), "timeout") + modulate = Global.guide_color func _input(_event : InputEvent) -> void: @@ -14,6 +22,9 @@ func _input(_event : InputEvent) -> void: elif type == Types.VERTICAL: project.x_symmetry_point = points[0].x * 2 - 1 + yield(get_tree().create_timer(0.01), "timeout") + width = Global.camera.zoom.x * 4 + func outside_canvas() -> bool: if type == Types.HORIZONTAL: