Skip to content

Commit

Permalink
Fix image exports (#774)
Browse files Browse the repository at this point in the history
  • Loading branch information
MewPurPur authored May 30, 2024
1 parent 2c764c5 commit 9876893
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/FileUtils.gd
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ static func generate_image_from_tags(upscale_amount := 1.0) -> Image:
var export_svg := SVG.root_tag.duplicate()
if export_svg.attributes.viewBox.get_list().is_empty():
export_svg.attributes.viewBox.set_list([0, 0, export_svg.width, export_svg.height])
# First ensure there are dimensions.
# Otherwise changing one side could influence the other.
export_svg.attributes.width.set_num(export_svg.width)
export_svg.attributes.height.set_num(export_svg.height)
export_svg.attributes.width.set_num(export_svg.width * upscale_amount)
export_svg.attributes.height.set_num(export_svg.height * upscale_amount)
var img := Image.new()
Expand All @@ -63,7 +67,8 @@ non_native_callable: Callable) -> void:
TranslationServer.translate("Save the .\"{extension}\" file") %\
{"extension": extension}, Utils.get_last_dir(), Utils.get_file_name(
GlobalSettings.save_data.current_file_path) + "." + extension, false,
DisplayServer.FILE_DIALOG_MODE_SAVE_FILE, ["*." + extension], native_callable)
DisplayServer.FILE_DIALOG_MODE_SAVE_FILE,
PackedStringArray(["*." + extension]), native_callable)
elif OS.has_feature("web"):
web_save_svg()
else:
Expand Down
1 change: 1 addition & 0 deletions src/ui_elements/setting_shortcut.gd
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func sync() -> void:
new_btn.auto_translate = false
shortcut_container.add_child.call_deferred(new_btn)
shortcut_buttons.append(new_btn)
new_btn.button_mask = MOUSE_BUTTON_MASK_LEFT | MOUSE_BUTTON_MASK_RIGHT
new_btn.size_flags_horizontal = Control.SIZE_EXPAND_FILL
new_btn.theme_type_variation = "TranslucentButton"
new_btn.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND
Expand Down
2 changes: 1 addition & 1 deletion src/ui_parts/donate_menu.gd
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func _on_github_link_mouse_entered() -> void:

func _on_ko_fi_link_mouse_entered() -> void:
show_description("Ko-Fi", PackedStringArray(["Low extra fees",
"Can donate an arbitrary amount"]), PackedStringArray(["Missing some perks"]))
"Can donate an arbitrary amount"]), PackedStringArray(["No perks"]))

func _on_patreon_link_mouse_entered() -> void:
show_description("Patreon", PackedStringArray(["Includes all perks"]),
Expand Down

0 comments on commit 9876893

Please sign in to comment.