Skip to content

Commit 0c5ff4f

Browse files
committed
Fix issues with polygon and polyline
1 parent 3bafd1a commit 0c5ff4f

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/data_classes/DB.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const recognized_attributes = { # Dictionary{String: Array[String]}
5151
"line": ["transform", "opacity", "stroke", "stroke-opacity", "stroke-width",
5252
"stroke-linecap", "x1", "y1", "x2", "y2"],
5353
"polygon": ["transform", "opacity", "fill", "fill-opacity", "stroke", "stroke-opacity",
54-
"stroke-width", "stroke-linecap", "stroke-linejoin", "points"],
54+
"stroke-width", "stroke-linejoin", "points"],
5555
"polyline": ["transform", "opacity", "fill", "fill-opacity", "stroke",
5656
"stroke-opacity", "stroke-width", "stroke-linecap", "stroke-linejoin", "points"],
5757
"stop": ["offset", "stop-color", "stop-opacity"],

src/data_classes/ElementPolygon.gd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ const possible_conversions = ["path", "rect"]
66

77
func user_setup(pos := Vector2.ZERO) -> void:
88
if pos != Vector2.ZERO:
9-
set_attribute("points", "0 0")
9+
var attrib: AttributeList = get_attribute("points")
10+
attrib.set_points(PackedVector2Array([pos]))
1011

1112
func _get_own_default(attribute_name: String) -> String:
1213
if attribute_name == "opacity":

src/data_classes/ElementPolyline.gd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ const possible_conversions = ["path", "line"]
66

77
func user_setup(pos := Vector2.ZERO) -> void:
88
if pos != Vector2.ZERO:
9-
set_attribute("points", "0 0")
9+
var attrib: AttributeList = get_attribute("points")
10+
attrib.set_points(PackedVector2Array([pos]))
1011
set_attribute("fill", "none")
1112
set_attribute("stroke", "black")
1213

0 commit comments

Comments
 (0)