Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/export-optimized.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ env:
# Which Godot version to use for exporting (e.g., 4.4.1, 4.5)
GODOT_VERSION: 4.8
# Which Godot release to use for exporting (e.g., stable, dev5, rc2)
GODOT_RELEASE_TYPE: dev5
GODOT_RELEASE_TYPE: dev6
# Commit hash (found in Github releases)
GODOT_COMMIT_HASH: 9552dfb6859a1aaba1e570b8e0ef5c599b830f19
GODOT_COMMIT_HASH: 8898c2b3db32adf6f92c694ffb6dac19af672e5f
# Emscripten version. Should normally be "latest", but if this causes problems, see what Godot itself is using.
EMSDK_VERSION: latest
# deprecated=no disables deprecated Godot features, which exist for compat and we don't use.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ GodSVG also runs on web - here's a link to the official web editor: https://gods

To run the latest unreleased version, you can download Godot from https://godotengine.org and also download GodSVG's repository files. Once they are on your machine, open Godot, click on the "Import" button, and import the `project.godot` folder from this repository.

Development is currently happening on v4.8 dev5, so prefer this version if you're downloading GodSVG for your own use or for contributing.
Development is currently happening on v4.8 dev6, so prefer this version if you're downloading GodSVG for your own use or for contributing.

Another way to run the latest dev build is to open a recent commit and download its artifacts (Checks > export-optimized > Summary > Artifacts). You must log into Github for that.

Expand Down
4 changes: 3 additions & 1 deletion no_export/scripts/update_translations.gd
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ const COMMENTS_DICT: Dictionary[String, String] = {
"Editor formatter": "Refers to the formatter used for GodSVG's code editor.",
"Export formatter": "Refers to the formatter used when exporting.",
"Handles": "Refers to the draggable gizmos.",
"Dash length": "Refers to the selection rectangle's animated dashed stroke.",
"Dash": "Refers to the dashes of a dashed stroke.",
"Gap": "Refers to the gaps in a dashed stroke.",
"Dash length": "Refers to the dashes of a dashed stroke.",
"Excluded": "Refers to the zero, one, or multiple UI parts to not be shown in the final layout. It's of plural cardinality.",
"Update check failed": "When checking for updates.",
"Points to insert": "Refers to a number of points.",
Expand Down
8 changes: 5 additions & 3 deletions src/data_classes/DB.gd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## A central database for SVG element and attribute definitions.
@abstract class_name DB

enum AttributeType {NUMERIC, COLOR, LIST, PATHDATA, ENUM, TRANSFORM_LIST, ID, HREF, UNKNOWN}
enum AttributeType {NUMERIC, COLOR, LIST, DASHARRAY, PATHDATA, ENUM, TRANSFORM_LIST, ID, HREF, UNKNOWN}
enum PercentageHandling {FRACTION, HORIZONTAL, VERTICAL, NORMALIZED}
enum NumberRange {ARBITRARY, POSITIVE, UNIT}

Expand Down Expand Up @@ -126,8 +126,9 @@ const _ATTRIBUTE_TYPES: Dictionary[String, AttributeType] = {
"stroke-width": AttributeType.NUMERIC,
"stroke-linecap": AttributeType.ENUM,
"stroke-linejoin": AttributeType.ENUM,
#"stroke-dashoffset": AttributeType.NUMERIC,
#"stroke-dasharray": AttributeType.LIST, # TODO Should be of dasharray type eventually.
"stroke-miterlimit": AttributeType.NUMERIC,
"stroke-dashoffset": AttributeType.NUMERIC,
"stroke-dasharray": AttributeType.DASHARRAY,
"color": AttributeType.COLOR,
"d": AttributeType.PATHDATA,
"points": AttributeType.LIST,
Expand Down Expand Up @@ -173,6 +174,7 @@ const ATTRIBUTE_NUMBER_RANGE: Dictionary[String, NumberRange] = {
"fill-opacity": NumberRange.UNIT,
"stroke-opacity": NumberRange.UNIT,
"stroke-width": NumberRange.POSITIVE,
"stroke-miterlimit": NumberRange.POSITIVE,
"offset": NumberRange.UNIT,
"stop-opacity": NumberRange.UNIT,
}
Expand Down
12 changes: 12 additions & 0 deletions src/ui_widgets/dasharray_field.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[gd_scene format=3 uid="uid://i4scl07fwpo7"]

[ext_resource type="Script" uid="uid://bws54nmwus6y6" path="res://src/ui_widgets/transformlist_field.gd" id="1_gj48o"]
[ext_resource type="Texture2D" uid="uid://coda6chhcatal" path="res://assets/icons/Arrow.svg" id="2_3b2jo"]

[node name="TransformField" type="Control" unique_id=636640374]
custom_minimum_size = Vector2(162, 0)
layout_mode = 3
anchors_preset = 0
script = ExtResource("1_gj48o")
icon = ExtResource("2_3b2jo")
mono_font_tooltip = true
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[gd_scene format=3 uid="uid://bc45fp38kar6a"]

[ext_resource type="Script" uid="uid://bws54nmwus6y6" path="res://src/ui_widgets/transform_field.gd" id="1_5gokr"]
[ext_resource type="Script" uid="uid://bws54nmwus6y6" path="res://src/ui_widgets/transformlist_field.gd" id="1_5gokr"]
[ext_resource type="Texture2D" uid="uid://coda6chhcatal" path="res://assets/icons/Arrow.svg" id="2_2uudq"]

[node name="TransformField" type="Control" unique_id=636640374]
Expand Down
5 changes: 3 additions & 2 deletions src/utils/AttributeFieldBuilder.gd
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
@abstract class_name AttributeFieldBuilder

const TransformFieldScene = preload("res://src/ui_widgets/transform_field.tscn")
const TransformListFieldScene = preload("res://src/ui_widgets/transformlist_field.tscn")
const NumberFieldScene = preload("res://src/ui_widgets/number_field.tscn")
const NumberSliderScene = preload("res://src/ui_widgets/number_field_with_slider.tscn")
const ColorFieldScene = preload("res://src/ui_widgets/color_field.tscn")
const EnumFieldScene = preload("res://src/ui_widgets/enum_field.tscn")
const IdFieldScene = preload("res://src/ui_widgets/id_field.tscn")
const HrefFieldScene = preload("res://src/ui_widgets/href_field.tscn")
const DashArrayFieldScene = preload("res://src/ui_widgets/dasharray_field.tscn")
const UnrecognizedFieldScene = preload("res://src/ui_widgets/unrecognized_field.tscn")

static func create(attribute_name: String, element: Element) -> Control:
match DB.get_attribute_type(attribute_name):
DB.AttributeType.ID: return _generate_no_name(IdFieldScene, element)
DB.AttributeType.HREF: return _generate_no_name(HrefFieldScene, element)
DB.AttributeType.TRANSFORM_LIST: return _generate(TransformFieldScene, element, attribute_name)
DB.AttributeType.TRANSFORM_LIST: return _generate(TransformListFieldScene, element, attribute_name)
DB.AttributeType.COLOR: return _generate(ColorFieldScene, element, attribute_name)
DB.AttributeType.ENUM: return _generate(EnumFieldScene, element, attribute_name)
DB.AttributeType.NUMERIC:
Expand Down
Loading