Skip to content

Commit 8dc73c7

Browse files
Update from upstream
1 parent 01012a3 commit 8dc73c7

72 files changed

Lines changed: 1485 additions & 934 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Godot 4+ specific ignores
1+
# Godot-specific ignores
22
.godot/
3-
.DS_Store
3+
.nomedia
44

5-
# Imported translations (automatically generated from CSV files)
6-
*.translation
5+
# Others
76
.~lock.*
7+
.DS_Store

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Contributions don't need to be perfect, but they must move GodSVG in the right d
88

99
GodSVG is made in Godot using its GDScript language. Refer to the [README](https://github.com/MewPurPur/GodSVG?tab=readme-ov-file#how-to-get-it) on how to get GodSVG running.
1010

11-
Git must be configured, then you can clone the repository to your local machine: `git clone git@github.com:MewPurPur/GodSVG.git`
11+
Git must be configured, then you can clone the repository to your local machine: `git clone https://github.com/MewPurPur/GodSVG.git`
1212

1313
The documentation won't go into detail about how to use Git. Refer to outside resources if you are unfamiliar with it.
1414

assets/icons/Expand.svg

Lines changed: 1 addition & 0 deletions
Loading

assets/icons/Expand.svg.import

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="CompressedTexture2D"
5+
uid="uid://0xptbhyrvsk1"
6+
path="res://.godot/imported/Expand.svg-54a09277a628926ed67d8eb42ef8926e.ctex"
7+
metadata={
8+
"vram_texture": false
9+
}
10+
11+
[deps]
12+
13+
source_file="res://assets/icons/Expand.svg"
14+
dest_files=["res://.godot/imported/Expand.svg-54a09277a628926ed67d8eb42ef8926e.ctex"]
15+
16+
[params]
17+
18+
compress/mode=0
19+
compress/high_quality=false
20+
compress/lossy_quality=0.7
21+
compress/hdr_compression=1
22+
compress/normal_map=0
23+
compress/channel_pack=0
24+
mipmaps/generate=false
25+
mipmaps/limit=-1
26+
roughness/mode=0
27+
roughness/src_normal=""
28+
process/fix_alpha_border=true
29+
process/premult_alpha=false
30+
process/normal_map_invert_y=false
31+
process/hdr_as_srgb=false
32+
process/hdr_clamp_exposure=false
33+
process/size_limit=0
34+
detect_3d/compress_to=1
35+
svg/scale=1.0
36+
editor/scale_with_editor_scale=false
37+
editor/convert_colors_with_editor_theme=false

assets/icons/PresetGrayscale.svg

Lines changed: 1 addition & 1 deletion
Loading

godot_only/scripts/tests.gd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ func pathdata_tests(print_success := false) -> bool:
2727
"M 0 0 z 2 3": [["M", 0.0, 0.0], ["z"]],
2828
"M3e1 4e-2": [["M", 3e1, 4e-2]],
2929
"M5,1 A4,4,0,1,1,5,9": [["M", 5.0, 1.0], ["A", 4.0, 4.0, 0.0, 1, 1, 5.0, 9.0]],
30-
"M4 1 2 - 4 4z": [["M", 4.0, 1.0]]
30+
"M4 1 2 - 4 4z": [["M", 4.0, 1.0]],
31+
"M1 6.9e-1": [["M", 1.0, 0.69]],
3132
}
3233

3334
var tests_passed := true

godot_only/scripts/update_translations.gd

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22
@tool
33
extends EditorScript
44

5+
const COMMENTS_DICT = {
6+
"Viewport": "The viewport is the area where the graphic is displayed. In similar applications, it's often called the canvas.",
7+
"CDATA color": "CDATA shouldn't be translated. It's a type of XML section.",
8+
"Editor formatter": "Refers to the formatter used for GodSVG's code editor.",
9+
"Export formatter": "Refers to the formatter used when exporting.",
10+
"Handle colors": "Refers to the colors of the draggable handles.",
11+
"Handle size": "Refers to the size of the draggable handles.",
12+
"Excluded": "Refers to the zero, one, or multiple UI parts to not be shown in the final layout. It's of plural cardinality.",
13+
"Update check failed": "When checking for updates.",
14+
}
15+
516
const TRANSLATIONS_DIR = "translations"
617

718
const HEADER = """#, fuzzy
@@ -80,11 +91,15 @@ func search_directory(dir: String) -> void:
8091

8192

8293
func update_translations() -> void:
94+
var used_comments := PackedStringArray()
8395
var location := ProjectSettings.globalize_path(TRANSLATIONS_DIR + "/GodSVG.pot")
8496
var fa := FileAccess.open(location, FileAccess.WRITE)
8597
fa.store_string(HEADER)
8698

8799
for msg in messages:
100+
if COMMENTS_DICT.has(msg.msgid):
101+
fa.store_string("#. %s\n" % COMMENTS_DICT[msg.msgid])
102+
used_comments.append(msg.msgid)
88103
fa.store_string(msg.to_string())
89104
fa = null
90105
print("Created " + TRANSLATIONS_DIR + "/GodSVG.pot with %d strings" % (messages.size() + 1))
@@ -105,3 +120,7 @@ func update_translations() -> void:
105120
print("Updated " + TRANSLATIONS_DIR + "/%s: %s" % [file, output[0].rstrip("\n")])
106121
else:
107122
print("Updated " + TRANSLATIONS_DIR + "%s" % file)
123+
124+
for id in COMMENTS_DICT:
125+
if not used_comments.has(id):
126+
print_rich("[color=#f66]The \"%s\" string, which has a comment defined for it, wasn't encountered." % id)

project.godot

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,11 +336,19 @@ toggle_snap={
336336
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":true,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":83,"physical_keycode":0,"key_label":0,"unicode":115,"location":0,"echo":false,"script":null)
337337
]
338338
}
339+
toggle_fullscreen={
340+
"deadzone": 0.2,
341+
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194342,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
342+
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":true,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194309,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
343+
]
344+
}
339345

340346
[input_devices]
341347

342348
pointing/android/enable_long_press_as_right_click=true
343349
pointing/android/enable_pan_and_scale_gestures=true
350+
pen_tablet/driver="dummy"
351+
pen_tablet/driver.windows="dummy"
344352

345353
[internationalization]
346354

src/autoload/HandlerGUI.gd

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ func _unhandled_input(event: InputEvent) -> void:
223223
if ShortcutUtils.is_action_pressed(event, action):
224224
match action:
225225
"quit": prompt_quit()
226+
"toggle_fullscreen": toggle_fullscreen()
226227
"about_info": open_about()
227228
"about_donate": open_donate()
228229
"check_updates": open_update_checker()
@@ -401,6 +402,31 @@ func prompt_quit() -> void:
401402
Translator.translate("Do you want to quit GodSVG?"),
402403
Translator.translate("Quit"), get_tree().quit)
403404

405+
406+
var was_window_maximized: bool
407+
var window_old_rect: Rect2
408+
409+
func toggle_fullscreen() -> void:
410+
if DisplayServer.window_get_mode() != DisplayServer.WindowMode.WINDOW_MODE_FULLSCREEN:
411+
if DisplayServer.window_get_mode() == DisplayServer.WindowMode.WINDOW_MODE_MAXIMIZED:
412+
was_window_maximized = true
413+
else:
414+
was_window_maximized = false
415+
window_old_rect = Rect2(DisplayServer.window_get_position(),
416+
DisplayServer.window_get_size())
417+
DisplayServer.window_set_mode(DisplayServer.WindowMode.WINDOW_MODE_FULLSCREEN)
418+
else:
419+
if was_window_maximized:
420+
DisplayServer.window_set_mode(DisplayServer.WindowMode.WINDOW_MODE_MAXIMIZED)
421+
else:
422+
DisplayServer.window_set_mode(DisplayServer.WindowMode.WINDOW_MODE_WINDOWED)
423+
DisplayServer.window_set_size(window_old_rect.size)
424+
# TODO Without at least 3 frames of wait, on my laptop the window would
425+
# sometimes go a little higher than before after setting its position.
426+
for i in 3:
427+
await get_tree().process_frame
428+
DisplayServer.window_set_position(window_old_rect.position)
429+
404430
func open_update_checker() -> void:
405431
remove_all_menus()
406432
var confirmation_dialog := ConfirmDialogScene.instantiate()

src/autoload/State.gd

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ func get_export_text() -> String:
196196
signal hover_changed
197197
signal selection_changed
198198

199-
signal requested_scroll_to_element_editor(xid: PackedInt32Array, inner_idx: int)
199+
signal requested_scroll_to_selection(xid: PackedInt32Array, inner_idx: int)
200200

201201
# The viewport listens for this signal to put you in handle-placing mode.
202202
signal handle_added
@@ -705,10 +705,10 @@ func _move_selected(down: bool) -> void:
705705
#xnode.get_attribute("d").move_subpath(inner_selections[0], down)
706706
queue_svg_save()
707707

708-
func view_in_list(xid: PackedInt32Array, inner_index := -1) -> void:
708+
func view_in_inspector(xid: PackedInt32Array, inner_index := -1) -> void:
709709
if xid.is_empty():
710710
return
711-
requested_scroll_to_element_editor.emit(xid, inner_index)
711+
requested_scroll_to_selection.emit(xid, inner_index)
712712

713713
func duplicate_selected() -> void:
714714
root_element.duplicate_xnodes(selected_xids)
@@ -761,7 +761,7 @@ func get_selection_context(popup_method: Callable, context: Utils.LayoutPart) ->
761761
can_move_down = true
762762
if context == Utils.LayoutPart.VIEWPORT:
763763
btn_arr.append(ContextPopup.create_button(Translator.translate("View in Inspector"),
764-
view_in_list.bind(selected_xids[0]), false,
764+
view_in_inspector.bind(selected_xids[0]), false,
765765
load("res://assets/icons/Inspector.svg")))
766766

767767
btn_arr.append(ContextPopup.create_shortcut_button("duplicate"))
@@ -791,7 +791,7 @@ func get_selection_context(popup_method: Callable, context: Utils.LayoutPart) ->
791791
if idx < inner_idx:
792792
inner_idx = idx
793793
btn_arr.append(ContextPopup.create_button(Translator.translate("View in Inspector"),
794-
view_in_list.bind(semi_selected_xid, inner_idx), false,
794+
view_in_inspector.bind(semi_selected_xid, inner_idx), false,
795795
load("res://assets/icons/Inspector.svg")))
796796
match element_ref.name:
797797
"path":
@@ -886,8 +886,12 @@ func popup_insert_command_after_context(popup_method: Callable) -> void:
886886
# Disable invalid commands. Z is syntactically invalid, so disallow it even harder.
887887
var warned_commands: PackedStringArray
888888
var disabled_commands: PackedStringArray
889+
# S commands are deliberately warned against in most cases, even though
890+
# there is some sense in using them without a C or S command before them.
891+
# Same for T commands in most cases, even though
892+
# there is a notion of letting them determine the next shorthand quadratic curve.
889893
match cmd_char.to_upper():
890-
"M": warned_commands = PackedStringArray(["M", "Z", "T"])
894+
"M": warned_commands = PackedStringArray(["M", "Z", "S", "T"])
891895
"L", "H", "V", "A": warned_commands = PackedStringArray(["S", "T"])
892896
"C", "S": warned_commands = PackedStringArray(["T"])
893897
"Q", "T": warned_commands = PackedStringArray(["S"])

0 commit comments

Comments
 (0)