Skip to content

Commit b9aa339

Browse files
authored
Remove extreme dimensions warning (#1779)
1 parent 322fccb commit b9aa339

14 files changed

Lines changed: 68 additions & 119 deletions

File tree

src/autoload/HandlerGUI.gd

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -737,25 +737,14 @@ func open_export() -> void:
737737
var width := State.root_element.width
738738
var height := State.root_element.height
739739

740-
var dimensions_valid := (is_finite(width) and is_finite(height) and width > 0.0 and height > 0.0)
741-
var dimensions_too_different := false
742-
743-
if dimensions_valid:
744-
dimensions_too_different = (1 / minf(width, height) > 16384 / maxf(width, height))
745-
if not dimensions_too_different:
746-
add_menu(ExportMenuScene.instantiate())
747-
return
748-
749-
var message: String
750-
if dimensions_too_different:
751-
message = Translator.translate("The graphic can be exported only as SVG because its proportions are too extreme.")
752-
else:
753-
message = Translator.translate("The graphic can be exported only as SVG because its size is not defined.")
754-
message += "\n\n" + Translator.translate("Do you want to proceed?")
740+
if is_finite(width) and is_finite(height) and width > 0.0 and height > 0.0:
741+
add_menu(ExportMenuScene.instantiate())
742+
return
755743

756744
var confirm_dialog := ConfirmDialogScene.instantiate()
757745
add_menu(confirm_dialog)
758-
confirm_dialog.setup(Translator.translate("Export SVG"), message,
746+
confirm_dialog.setup(Translator.translate("Export SVG"), "%s\n\n%s" %\
747+
[Translator.translate("The graphic can only be exported as SVG because its size is undefined."), Translator.translate("Do you want to proceed?")],
759748
Translator.translate("Export"), FileUtils.open_export_dialog.bind(ImageExportDataSVG.new()))
760749

761750

src/ui_widgets/export_scale_config.gd

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,12 @@ func setup(new_original_width: float, new_original_height: float, initial_scale:
2727
await ready
2828
original_width = new_original_width
2929
original_height = new_original_height
30-
scale_edit.min_value = 1 / minf(original_width, new_original_height)
31-
scale_edit.max_value = max_dimension / maxf(new_original_width, new_original_height)
32-
width_edit.max_value = max_dimension
33-
height_edit.max_value = max_dimension
30+
var bigger_dimension := maxf(original_width, original_height)
31+
var max_scale := max_dimension / bigger_dimension
32+
scale_edit.min_value = 1 / bigger_dimension
33+
scale_edit.max_value = max_dimension / bigger_dimension
34+
width_edit.max_value = floori(original_width * max_scale)
35+
height_edit.max_value = floori(original_height * max_scale)
3436
scale_edit.value_changed.connect(_on_scale_edit_value_changed)
3537
width_edit.value_changed.connect(_on_width_edit_value_changed)
3638
height_edit.value_changed.connect(_on_height_edit_value_changed)

translations/GodSVG.pot

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ msgstr ""
4040
msgid "OK"
4141
msgstr ""
4242

43-
#: src/autoload/HandlerGUI.gd
44-
msgid "The graphic can be exported only as SVG because its proportions are too extreme."
45-
msgstr ""
46-
4743
#: src/autoload/HandlerGUI.gd
4844
msgid "The graphic can be exported only as SVG because its size is not defined."
4945
msgstr ""
@@ -493,10 +489,6 @@ msgstr ""
493489
msgid "Add preview"
494490
msgstr ""
495491

496-
#: src/ui_parts/previews.gd
497-
msgid "Add new preview"
498-
msgstr ""
499-
500492
#: src/ui_parts/previews.gd src/ui_widgets/palette_config.gd
501493
#: src/ui_widgets/setting_shortcut.gd src/ui_widgets/transform_popup.gd
502494
#: src/utils/TranslationUtils.gd

translations/bg.po

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ msgstr "Това ще се свърже с github.com за да сравни ч
4141
msgid "OK"
4242
msgstr "Добре"
4343

44-
#: src/autoload/HandlerGUI.gd
45-
msgid "The graphic can be exported only as SVG because its proportions are too extreme."
46-
msgstr "Графиката може да бъде експортирана само като SVG защото височината и широчината са твърде различни."
47-
4844
#: src/autoload/HandlerGUI.gd
4945
msgid "The graphic can be exported only as SVG because its size is not defined."
5046
msgstr "Графиката може да бъде експортирана само като SVG защото размерът не е определен."
@@ -494,10 +490,6 @@ msgstr "Помощ"
494490
msgid "Add preview"
495491
msgstr "Добави гледка"
496492

497-
#: src/ui_parts/previews.gd
498-
msgid "Add new preview"
499-
msgstr "Добави нова гледка"
500-
501493
#: src/ui_parts/previews.gd src/ui_widgets/palette_config.gd
502494
#: src/ui_widgets/setting_shortcut.gd src/ui_widgets/transform_popup.gd
503495
#: src/utils/TranslationUtils.gd

translations/de.po

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ msgstr "Dadurch wird eine Verbindung zu github.com hergestellt, um Versionsnumme
4141
msgid "OK"
4242
msgstr "OK"
4343

44-
#: src/autoload/HandlerGUI.gd
45-
msgid "The graphic can be exported only as SVG because its proportions are too extreme."
46-
msgstr "Die Grafik kann nur als SVG exportiert werden, da ihre Proportionen zu extrem sind."
47-
4844
#: src/autoload/HandlerGUI.gd
4945
msgid "The graphic can be exported only as SVG because its size is not defined."
5046
msgstr "Die Grafik kann nur als SVG exportiert werden, da ihre Größe nicht definiert ist."
@@ -503,11 +499,6 @@ msgstr "Hilfe"
503499
msgid "Add preview"
504500
msgstr "Farbe hinzufügen"
505501

506-
#: src/ui_parts/previews.gd
507-
#, fuzzy
508-
msgid "Add new preview"
509-
msgstr "Farbe hinzufügen"
510-
511502
#: src/ui_parts/previews.gd src/ui_widgets/palette_config.gd
512503
#: src/ui_widgets/setting_shortcut.gd src/ui_widgets/transform_popup.gd
513504
#: src/utils/TranslationUtils.gd
@@ -1747,6 +1738,13 @@ msgstr ""
17471738
msgid "svg;vector;graphics;draw;design;illustration;image;art;diagram;icon;logo;editor;path;shape;2D;code;blue;fox"
17481739
msgstr ""
17491740

1741+
#~ msgid "The graphic can be exported only as SVG because its proportions are too extreme."
1742+
#~ msgstr "Die Grafik kann nur als SVG exportiert werden, da ihre Proportionen zu extrem sind."
1743+
1744+
#, fuzzy
1745+
#~ msgid "Add new preview"
1746+
#~ msgstr "Farbe hinzufügen"
1747+
17501748
#, fuzzy
17511749
#~ msgid "Add new color"
17521750
#~ msgstr "Farbe hinzufügen"

translations/en.po

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ msgstr ""
4141
msgid "OK"
4242
msgstr ""
4343

44-
#: src/autoload/HandlerGUI.gd
45-
msgid "The graphic can be exported only as SVG because its proportions are too extreme."
46-
msgstr ""
47-
4844
#: src/autoload/HandlerGUI.gd
4945
msgid "The graphic can be exported only as SVG because its size is not defined."
5046
msgstr ""
@@ -494,10 +490,6 @@ msgstr ""
494490
msgid "Add preview"
495491
msgstr ""
496492

497-
#: src/ui_parts/previews.gd
498-
msgid "Add new preview"
499-
msgstr ""
500-
501493
#: src/ui_parts/previews.gd src/ui_widgets/palette_config.gd
502494
#: src/ui_widgets/setting_shortcut.gd src/ui_widgets/transform_popup.gd
503495
#: src/utils/TranslationUtils.gd

translations/es.po

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ msgstr "Esto se conectará a github.com para comparar los números de versión.
4141
msgid "OK"
4242
msgstr "Aceptar"
4343

44-
#: src/autoload/HandlerGUI.gd
45-
msgid "The graphic can be exported only as SVG because its proportions are too extreme."
46-
msgstr "El gráfico solo se puede exportar como SVG porque sus proporciones son demasiado extremas."
47-
4844
#: src/autoload/HandlerGUI.gd
4945
msgid "The graphic can be exported only as SVG because its size is not defined."
5046
msgstr "El gráfico solo se puede exportar como SVG porque su tamaño no está definido."
@@ -496,10 +492,6 @@ msgstr "Ayuda"
496492
msgid "Add preview"
497493
msgstr "Añadir nueva vista previa"
498494

499-
#: src/ui_parts/previews.gd
500-
msgid "Add new preview"
501-
msgstr "Añadir nueva vista previa"
502-
503495
#: src/ui_parts/previews.gd src/ui_widgets/palette_config.gd
504496
#: src/ui_widgets/setting_shortcut.gd src/ui_widgets/transform_popup.gd
505497
#: src/utils/TranslationUtils.gd
@@ -1700,6 +1692,12 @@ msgstr "Una aplicación de gráficos vectoriales para edición SVG estructurada"
17001692
msgid "svg;vector;graphics;draw;design;illustration;image;art;diagram;icon;logo;editor;path;shape;2D;code;blue;fox"
17011693
msgstr "svg;vector;gráficos;dibujo;diseño;ilustración;imagen;arte;diagrama;icono;logo;editor;ruta;forma;2D;código;azul;zorro"
17021694

1695+
#~ msgid "The graphic can be exported only as SVG because its proportions are too extreme."
1696+
#~ msgstr "El gráfico solo se puede exportar como SVG porque sus proporciones son demasiado extremas."
1697+
1698+
#~ msgid "Add new preview"
1699+
#~ msgstr "Añadir nueva vista previa"
1700+
17031701
#~ msgid "Add new color"
17041702
#~ msgstr "Añadir nuevo color"
17051703

translations/et.po

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ msgstr "See ühendab github.com-i, et saada versioonide teabe. Muid andmeid ei k
4141
msgid "OK"
4242
msgstr "Okei"
4343

44-
#: src/autoload/HandlerGUI.gd
45-
msgid "The graphic can be exported only as SVG because its proportions are too extreme."
46-
msgstr "Graafika saab eksportida ainult SVG-na, sest selle proportsioonid on liiga ekstreemsed."
47-
4844
#: src/autoload/HandlerGUI.gd
4945
msgid "The graphic can be exported only as SVG because its size is not defined."
5046
msgstr "Graafika saab eksportida ainult SVG-na, sest selle suurus pole defineeritud."
@@ -496,10 +492,6 @@ msgstr "Abi"
496492
msgid "Add preview"
497493
msgstr "Lisa uus eelvaade"
498494

499-
#: src/ui_parts/previews.gd
500-
msgid "Add new preview"
501-
msgstr "Lisa uus eelvaade"
502-
503495
#: src/ui_parts/previews.gd src/ui_widgets/palette_config.gd
504496
#: src/ui_widgets/setting_shortcut.gd src/ui_widgets/transform_popup.gd
505497
#: src/utils/TranslationUtils.gd
@@ -1701,6 +1693,12 @@ msgstr "Vektorkraafika rakendus SVG struktureeritud redigeerimiseks"
17011693
msgid "svg;vector;graphics;draw;design;illustration;image;art;diagram;icon;logo;editor;path;shape;2D;code;blue;fox"
17021694
msgstr "svg;vektor;graafika;joonista;disain;illustratsioon;pilt;kunst;skeem;diagramm;logo;ikoon;redigeerija;kuju;2D;kood;sinine;rebane"
17031695

1696+
#~ msgid "The graphic can be exported only as SVG because its proportions are too extreme."
1697+
#~ msgstr "Graafika saab eksportida ainult SVG-na, sest selle proportsioonid on liiga ekstreemsed."
1698+
1699+
#~ msgid "Add new preview"
1700+
#~ msgstr "Lisa uus eelvaade"
1701+
17041702
#~ msgid "Add new color"
17051703
#~ msgstr "Lisa värv"
17061704

translations/fr.po

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ msgstr "Une connexion à github.com sera effectuée pour comparer les numéros d
4141
msgid "OK"
4242
msgstr "OK"
4343

44-
#: src/autoload/HandlerGUI.gd
45-
msgid "The graphic can be exported only as SVG because its proportions are too extreme."
46-
msgstr "Le graphique ne peut être exporté qu'en SVG car ses proportions sont trop extrêmes."
47-
4844
#: src/autoload/HandlerGUI.gd
4945
msgid "The graphic can be exported only as SVG because its size is not defined."
5046
msgstr "Le graphique ne peut être exporté qu'en SVG car sa taille n'a pas été pas définie."
@@ -503,11 +499,6 @@ msgstr "Aide"
503499
msgid "Add preview"
504500
msgstr "Couleur de texte"
505501

506-
#: src/ui_parts/previews.gd
507-
#, fuzzy
508-
msgid "Add new preview"
509-
msgstr "Couleur de texte"
510-
511502
#: src/ui_parts/previews.gd src/ui_widgets/palette_config.gd
512503
#: src/ui_widgets/setting_shortcut.gd src/ui_widgets/transform_popup.gd
513504
#: src/utils/TranslationUtils.gd
@@ -1748,6 +1739,13 @@ msgstr ""
17481739
msgid "svg;vector;graphics;draw;design;illustration;image;art;diagram;icon;logo;editor;path;shape;2D;code;blue;fox"
17491740
msgstr ""
17501741

1742+
#~ msgid "The graphic can be exported only as SVG because its proportions are too extreme."
1743+
#~ msgstr "Le graphique ne peut être exporté qu'en SVG car ses proportions sont trop extrêmes."
1744+
1745+
#, fuzzy
1746+
#~ msgid "Add new preview"
1747+
#~ msgstr "Couleur de texte"
1748+
17511749
#, fuzzy
17521750
#~ msgid "Add new color"
17531751
#~ msgstr "Couleur de texte"

translations/nl.po

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ msgstr "Dit zal een verbinding maken naar github.com om de versienummers te verg
4141
msgid "OK"
4242
msgstr "OK"
4343

44-
#: src/autoload/HandlerGUI.gd
45-
msgid "The graphic can be exported only as SVG because its proportions are too extreme."
46-
msgstr "De afbeelding kan alleen maar als SVG geëxporteerd worden door zijn extreme verhoudingen."
47-
4844
#: src/autoload/HandlerGUI.gd
4945
msgid "The graphic can be exported only as SVG because its size is not defined."
5046
msgstr "De afbeelding kan alleen maar als SVG geëxporteerd worden want zijn maat is niet gedefiniëerd."
@@ -502,11 +498,6 @@ msgstr "Help"
502498
msgid "Add preview"
503499
msgstr "Voeg nieuwe kleur toe"
504500

505-
#: src/ui_parts/previews.gd
506-
#, fuzzy
507-
msgid "Add new preview"
508-
msgstr "Voeg nieuwe kleur toe"
509-
510501
#: src/ui_parts/previews.gd src/ui_widgets/palette_config.gd
511502
#: src/ui_widgets/setting_shortcut.gd src/ui_widgets/transform_popup.gd
512503
#: src/utils/TranslationUtils.gd
@@ -1733,6 +1724,13 @@ msgstr ""
17331724
msgid "svg;vector;graphics;draw;design;illustration;image;art;diagram;icon;logo;editor;path;shape;2D;code;blue;fox"
17341725
msgstr ""
17351726

1727+
#~ msgid "The graphic can be exported only as SVG because its proportions are too extreme."
1728+
#~ msgstr "De afbeelding kan alleen maar als SVG geëxporteerd worden door zijn extreme verhoudingen."
1729+
1730+
#, fuzzy
1731+
#~ msgid "Add new preview"
1732+
#~ msgstr "Voeg nieuwe kleur toe"
1733+
17361734
#~ msgid "Add new color"
17371735
#~ msgstr "Voeg nieuwe kleur toe"
17381736

0 commit comments

Comments
 (0)