forked from 1b-agent/opencadstudio-upstream
Merge pull request #1741 from ramox81/codex/view-background-followups
This commit is contained in:
commit
798014c773
33 files changed
+555
-94
No files matched your search
@@ -879,9 +879,12 @@ common =
|
||||
.sent-to-printer-printer = أُرسل إلى الطابعة: __ocs_fmt_0__
|
||||
.set-current = تعيين كحالي
|
||||
.shade-plot = تظليل الطباعة
|
||||
.shaded-with-edges = مظلل مع الحواف
|
||||
.shades-of-gray = درجات الرمادي
|
||||
.shadow-flags = علامات الظلال
|
||||
.single = مفرد
|
||||
.size = الحجم
|
||||
.sketchy = تخطيطي
|
||||
.snap-override-label-next-pick-only = تجاوز الالتقاط: __ocs_fmt_0__ (للاختيار التالي فقط).
|
||||
.solid-created = أُنشئ المجسم.
|
||||
.source-object-not-found = لم يُعثر على الكائن المصدر.
|
||||
@@ -6345,8 +6348,11 @@ view-background =
|
||||
.stretch = Stretch
|
||||
.tile = Tile
|
||||
.scale = Scale
|
||||
.fit = Fit to screen
|
||||
.aspect = Keep aspect ratio
|
||||
.adjust = Adjust
|
||||
.reset = Reset
|
||||
.offset = Offset
|
||||
.pixels = px
|
||||
.no-image = No image selected
|
||||
.canvas = Drawing area color
|
||||
.info = Info
|
||||
|
||||
@@ -866,9 +866,12 @@ common =
|
||||
.sent-to-printer-printer = Изпратено до принтер: __ocs_fmt_0__
|
||||
.set-current = Задай като текущ
|
||||
.shade-plot = Плотиране със засенчване
|
||||
.shaded-with-edges = Засенчен с ръбове
|
||||
.shades-of-gray = Нюанси на сивото
|
||||
.shadow-flags = Флагове на сенки
|
||||
.single = Единично
|
||||
.size = Размер
|
||||
.sketchy = Скициран
|
||||
.snap-override-label-next-pick-only = Прескачане на закачване: __ocs_fmt_0__ (само за следващото избиране).
|
||||
.solid-created = Тялото е създадено.
|
||||
.source-object-not-found = Изходният обект не е намерен.
|
||||
@@ -6333,8 +6336,11 @@ view-background =
|
||||
.stretch = Stretch
|
||||
.tile = Tile
|
||||
.scale = Scale
|
||||
.fit = Fit to screen
|
||||
.aspect = Keep aspect ratio
|
||||
.adjust = Adjust
|
||||
.reset = Reset
|
||||
.offset = Offset
|
||||
.pixels = px
|
||||
.no-image = No image selected
|
||||
.canvas = Drawing area color
|
||||
.info = Info
|
||||
|
||||
@@ -866,9 +866,12 @@ common =
|
||||
.sent-to-printer-printer = Odesláno do tiskárny: __ocs_fmt_0__
|
||||
.set-current = Nastavit aktuální
|
||||
.shade-plot = Stínový pozemek
|
||||
.shaded-with-edges = Stínovaný s hranami
|
||||
.shades-of-gray = Odstíny šedi
|
||||
.shadow-flags = Stínové vlajky
|
||||
.single = Svobodný
|
||||
.size = Velikost
|
||||
.sketchy = Náčrt
|
||||
.snap-override-label-next-pick-only = Přepsání uchopení: __ocs_fmt_0__ (pouze další výběr).
|
||||
.solid-created = Pevná látka vytvořena.
|
||||
.source-object-not-found = Zdrojový objekt nebyl nalezen.
|
||||
@@ -6330,8 +6333,11 @@ view-background =
|
||||
.stretch = Stretch
|
||||
.tile = Tile
|
||||
.scale = Scale
|
||||
.fit = Fit to screen
|
||||
.aspect = Keep aspect ratio
|
||||
.adjust = Adjust
|
||||
.reset = Reset
|
||||
.offset = Offset
|
||||
.pixels = px
|
||||
.no-image = No image selected
|
||||
.canvas = Drawing area color
|
||||
.info = Info
|
||||
|
||||
@@ -867,9 +867,12 @@ common =
|
||||
.sent-to-printer-printer = Gesendet an Drucker: __ocs_fmt_0__
|
||||
.set-current = Aktuell setzen
|
||||
.shade-plot = Schattierter Plot
|
||||
.shaded-with-edges = Schattiert mit Kanten
|
||||
.shades-of-gray = Graustufen
|
||||
.shadow-flags = Schattenfahnen
|
||||
.single = Einzel
|
||||
.size = Größe
|
||||
.sketchy = Skizzenhaft
|
||||
.snap-override-label-next-pick-only = Snap Übersteuerung: __ocs_fmt_0__ (nur nächste Auswahl).
|
||||
.solid-created = Volumenkörper erstellt.
|
||||
.source-object-not-found = Quellobjekt nicht gefunden.
|
||||
@@ -6331,8 +6334,11 @@ view-background =
|
||||
.stretch = Stretch
|
||||
.tile = Tile
|
||||
.scale = Scale
|
||||
.fit = Fit to screen
|
||||
.aspect = Keep aspect ratio
|
||||
.adjust = Adjust
|
||||
.reset = Reset
|
||||
.offset = Offset
|
||||
.pixels = px
|
||||
.no-image = No image selected
|
||||
.canvas = Drawing area color
|
||||
.info = Info
|
||||
|
||||
@@ -868,9 +868,12 @@ common =
|
||||
.sent-to-printer-printer = Στάλθηκε στον εκτυπωτή: __ocs_fmt_0__
|
||||
.set-current = Ορισμός ως τρέχον
|
||||
.shade-plot = Σκίαση εκτύπωσης
|
||||
.shaded-with-edges = Σκιασμένο με ακμές
|
||||
.shades-of-gray = Αποχρώσεις του γκρι
|
||||
.shadow-flags = Σημαίες σκιάς
|
||||
.single = Μονό
|
||||
.size = Μέγεθος
|
||||
.sketchy = Σκίτσο
|
||||
.snap-override-label-next-pick-only = Παράκαμψη έλξης: __ocs_fmt_0__ (μόνο για την επόμενη επιλογή).
|
||||
.solid-created = Το στερεό δημιουργήθηκε.
|
||||
.source-object-not-found = Το αντικείμενο προέλευσης δεν βρέθηκε.
|
||||
@@ -6333,8 +6336,11 @@ view-background =
|
||||
.stretch = Stretch
|
||||
.tile = Tile
|
||||
.scale = Scale
|
||||
.fit = Fit to screen
|
||||
.aspect = Keep aspect ratio
|
||||
.adjust = Adjust
|
||||
.reset = Reset
|
||||
.offset = Offset
|
||||
.pixels = px
|
||||
.no-image = No image selected
|
||||
.canvas = Drawing area color
|
||||
.info = Info
|
||||
|
||||
@@ -865,9 +865,12 @@ common =
|
||||
.sent-to-printer-printer = Sent to printer: __ocs_fmt_0__
|
||||
.set-current = Set Current
|
||||
.shade-plot = Shade plot
|
||||
.shaded-with-edges = Shaded with edges
|
||||
.shades-of-gray = Shades of Gray
|
||||
.shadow-flags = Shadow flags
|
||||
.single = Single
|
||||
.size = Size
|
||||
.sketchy = Sketchy
|
||||
.snap-override-label-next-pick-only = Snap override: __ocs_fmt_0__ (next pick only).
|
||||
.solid-created = Solid created.
|
||||
.source-object-not-found = Source object not found.
|
||||
@@ -6332,8 +6335,11 @@ view-background =
|
||||
.stretch = Stretch
|
||||
.tile = Tile
|
||||
.scale = Scale
|
||||
.fit = Fit to screen
|
||||
.aspect = Keep aspect ratio
|
||||
.adjust = Adjust
|
||||
.reset = Reset
|
||||
.offset = Offset
|
||||
.pixels = px
|
||||
.no-image = No image selected
|
||||
.canvas = Drawing area color
|
||||
.info = Info
|
||||
|
||||
@@ -867,9 +867,12 @@ common =
|
||||
.sent-to-printer-printer = Enviado a la impresora: __ocs_fmt_0__
|
||||
.set-current = Establecer actual
|
||||
.shade-plot = Trazado sombreado
|
||||
.shaded-with-edges = Sombreado con aristas
|
||||
.shades-of-gray = Tonos de gris
|
||||
.shadow-flags = Indicadores de sombra
|
||||
.single = Único
|
||||
.size = Tamaño
|
||||
.sketchy = Bosquejo
|
||||
.snap-override-label-next-pick-only = Modificación de referencia: __ocs_fmt_0__ (solo la siguiente designación).
|
||||
.solid-created = Se creó el sólido.
|
||||
.source-object-not-found = No se encontró el objeto de origen.
|
||||
@@ -6333,8 +6336,11 @@ view-background =
|
||||
.stretch = Stretch
|
||||
.tile = Tile
|
||||
.scale = Scale
|
||||
.fit = Fit to screen
|
||||
.aspect = Keep aspect ratio
|
||||
.adjust = Adjust
|
||||
.reset = Reset
|
||||
.offset = Offset
|
||||
.pixels = px
|
||||
.no-image = No image selected
|
||||
.canvas = Drawing area color
|
||||
.info = Info
|
||||
|
||||
@@ -866,9 +866,12 @@ common =
|
||||
.sent-to-printer-printer = Lähetetty tulostimelle: __ocs_fmt_0__
|
||||
.set-current = Aseta nykyinen
|
||||
.shade-plot = Shade juoni
|
||||
.shaded-with-edges = Varjostettu reunoilla
|
||||
.shades-of-gray = Harmaasävyt
|
||||
.shadow-flags = Varjoliput
|
||||
.single = Sinkku
|
||||
.size = Koko
|
||||
.sketchy = Luonnos
|
||||
.snap-override-label-next-pick-only = Snap-ohitus: __ocs_fmt_0__ (vain seuraava valinta).
|
||||
.solid-created = Kiinteä luotu.
|
||||
.source-object-not-found = Lähdeobjektia ei löydy.
|
||||
@@ -6330,8 +6333,11 @@ view-background =
|
||||
.stretch = Stretch
|
||||
.tile = Tile
|
||||
.scale = Scale
|
||||
.fit = Fit to screen
|
||||
.aspect = Keep aspect ratio
|
||||
.adjust = Adjust
|
||||
.reset = Reset
|
||||
.offset = Offset
|
||||
.pixels = px
|
||||
.no-image = No image selected
|
||||
.canvas = Drawing area color
|
||||
.info = Info
|
||||
|
||||
@@ -867,9 +867,12 @@ common =
|
||||
.sent-to-printer-printer = Envoyé à l'imprimante : __ocs_fmt_0__
|
||||
.set-current = Définir comme courant
|
||||
.shade-plot = Terrain ombragé
|
||||
.shaded-with-edges = Ombré avec arêtes
|
||||
.shades-of-gray = Nuances de gris
|
||||
.shadow-flags = Drapeaux d'ombre
|
||||
.single = Un seul
|
||||
.size = Taille
|
||||
.sketchy = Croquis
|
||||
.snap-override-label-next-pick-only = Accrochage temporaire : __ocs_fmt_0__ (prochaine sélection uniquement).
|
||||
.solid-created = Solide créé.
|
||||
.source-object-not-found = Objet source introuvable.
|
||||
@@ -6333,8 +6336,11 @@ view-background =
|
||||
.stretch = Stretch
|
||||
.tile = Tile
|
||||
.scale = Scale
|
||||
.fit = Fit to screen
|
||||
.aspect = Keep aspect ratio
|
||||
.adjust = Adjust
|
||||
.reset = Reset
|
||||
.offset = Offset
|
||||
.pixels = px
|
||||
.no-image = No image selected
|
||||
.canvas = Drawing area color
|
||||
.info = Info
|
||||
|
||||
@@ -855,9 +855,12 @@ common =
|
||||
.sent-to-printer-printer = प्रिंटर के लिए भेजा गया: __ocs_fmt_0__
|
||||
.set-current = वर्तमान सेट करें
|
||||
.shade-plot = छाया कथा
|
||||
.shaded-with-edges = किनारों सहित छायांकित
|
||||
.shades-of-gray = ग्रे के शेड
|
||||
.shadow-flags = छाया झंडे
|
||||
.single = एकल
|
||||
.size = आकार
|
||||
.sketchy = रेखाचित्र
|
||||
.snap-override-label-next-pick-only = स्नैप ओवरराइड: __ocs_fmt_0__ (अकेले केवल पिक)।
|
||||
.solid-created = ठोस बनाया गया।
|
||||
.source-object-not-found = स्रोत ऑब्जेक्ट नहीं मिला।
|
||||
@@ -6321,8 +6324,11 @@ view-background =
|
||||
.stretch = Stretch
|
||||
.tile = Tile
|
||||
.scale = Scale
|
||||
.fit = Fit to screen
|
||||
.aspect = Keep aspect ratio
|
||||
.adjust = Adjust
|
||||
.reset = Reset
|
||||
.offset = Offset
|
||||
.pixels = px
|
||||
.no-image = No image selected
|
||||
.canvas = Drawing area color
|
||||
.info = Info
|
||||
|
||||
@@ -871,9 +871,12 @@ common =
|
||||
.sent-to-printer-printer = Nyomtatóra küldve: __ocs_fmt_0__
|
||||
.set-current = Aktuálissá tétel
|
||||
.shade-plot = Árnyalt nyomtatás
|
||||
.shaded-with-edges = Árnyalt élekkel
|
||||
.shades-of-gray = Szürkeárnyalatok
|
||||
.shadow-flags = Árnyékbeállítások
|
||||
.single = Egyetlen
|
||||
.size = Méret
|
||||
.sketchy = Vázlatos
|
||||
.snap-override-label-next-pick-only = Ideiglenes tárgyraszter: __ocs_fmt_0__ (csak a következő pontnál).
|
||||
.solid-created = Test létrehozva.
|
||||
.source-object-not-found = A forrásobjektum nem található.
|
||||
@@ -6317,8 +6320,11 @@ view-background =
|
||||
.stretch = Stretch
|
||||
.tile = Tile
|
||||
.scale = Scale
|
||||
.fit = Fit to screen
|
||||
.aspect = Keep aspect ratio
|
||||
.adjust = Adjust
|
||||
.reset = Reset
|
||||
.offset = Offset
|
||||
.pixels = px
|
||||
.no-image = No image selected
|
||||
.canvas = Drawing area color
|
||||
.info = Info
|
||||
|
||||
@@ -866,9 +866,12 @@ common =
|
||||
.sent-to-printer-printer = Inviato alla stampante: __ocs_fmt_0__
|
||||
.set-current = Imposta corrente
|
||||
.shade-plot = Stampa ombreggiatura
|
||||
.shaded-with-edges = Ombreggiato con spigoli
|
||||
.shades-of-gray = Sfumature di grigio
|
||||
.shadow-flags = Opzioni di ombreggiatura
|
||||
.single = Singolo
|
||||
.size = Dimensioni
|
||||
.sketchy = Schizzo
|
||||
.snap-override-label-next-pick-only = Sostituzione dello snap: __ocs_fmt_0__ (solo scelta successiva).
|
||||
.solid-created = Solido creato.
|
||||
.source-object-not-found = Oggetto di origine non trovato.
|
||||
@@ -6332,8 +6335,11 @@ view-background =
|
||||
.stretch = Stretch
|
||||
.tile = Tile
|
||||
.scale = Scale
|
||||
.fit = Fit to screen
|
||||
.aspect = Keep aspect ratio
|
||||
.adjust = Adjust
|
||||
.reset = Reset
|
||||
.offset = Offset
|
||||
.pixels = px
|
||||
.no-image = No image selected
|
||||
.canvas = Drawing area color
|
||||
.info = Info
|
||||
|
||||
@@ -857,9 +857,12 @@ common =
|
||||
.sent-to-printer-printer = プリンターへ送信しました: __ocs_fmt_0__
|
||||
.set-current = 現在に設定
|
||||
.shade-plot = シェーディング印刷
|
||||
.shaded-with-edges = 陰影付き(エッジ表示)
|
||||
.shades-of-gray = グレースケール
|
||||
.shadow-flags = 影フラグ
|
||||
.single = 単一
|
||||
.size = サイズ
|
||||
.sketchy = スケッチ
|
||||
.snap-override-label-next-pick-only = スナップ優先: __ocs_fmt_0__(次の選択のみ)。
|
||||
.solid-created = ソリッドを作成しました。
|
||||
.source-object-not-found = 元オブジェクトが見つかりません。
|
||||
@@ -6321,8 +6324,11 @@ view-background =
|
||||
.stretch = Stretch
|
||||
.tile = Tile
|
||||
.scale = Scale
|
||||
.fit = Fit to screen
|
||||
.aspect = Keep aspect ratio
|
||||
.adjust = Adjust
|
||||
.reset = Reset
|
||||
.offset = Offset
|
||||
.pixels = px
|
||||
.no-image = No image selected
|
||||
.canvas = Drawing area color
|
||||
.info = Info
|
||||
|
||||
@@ -866,9 +866,12 @@ common =
|
||||
.sent-to-printer-printer = 프린터로 전송됨: __ocs_fmt_0__
|
||||
.set-current = 현재 설정
|
||||
.shade-plot = 음영 플롯
|
||||
.shaded-with-edges = 모서리로 음영처리됨
|
||||
.shades-of-gray = 회색 음영
|
||||
.shadow-flags = 그림자 깃발
|
||||
.single = 싱글
|
||||
.size = 크기
|
||||
.sketchy = 스케치
|
||||
.snap-override-label-next-pick-only = 스냅 재정의: __ocs_fmt_0__(다음 선택에만 해당)
|
||||
.solid-created = 솔리드가 생성되었습니다.
|
||||
.source-object-not-found = 소스 개체를 찾을 수 없습니다.
|
||||
@@ -6332,8 +6335,11 @@ view-background =
|
||||
.stretch = Stretch
|
||||
.tile = Tile
|
||||
.scale = Scale
|
||||
.fit = Fit to screen
|
||||
.aspect = Keep aspect ratio
|
||||
.adjust = Adjust
|
||||
.reset = Reset
|
||||
.offset = Offset
|
||||
.pixels = px
|
||||
.no-image = No image selected
|
||||
.canvas = Drawing area color
|
||||
.info = Info
|
||||
|
||||
@@ -872,9 +872,12 @@ common =
|
||||
.sent-to-printer-printer = ສົ່ງໄປເຄື່ອງພິມແລ້ວ: __ocs_fmt_0__
|
||||
.set-current = ຕັ້ງເປັນປັດຈຸບັນ
|
||||
.shade-plot = ການພລັອດແບບແຮເງົາ
|
||||
.shaded-with-edges = ມີເງົາພ້ອມຂອບ
|
||||
.shades-of-gray = ໂທນສີເທົາ
|
||||
.shadow-flags = ແຟລກເງົາ
|
||||
.single = ດ່ຽວ
|
||||
.size = ຂະໜາດ
|
||||
.sketchy = ແບບຮ່າງ
|
||||
.snap-override-label-next-pick-only = ປ່ຽນຄ່າສະແນັບຊົ່ວຄາວ: __ocs_fmt_0__ (ສຳລັບການເລືອກຄັ້ງຕໍ່ໄປເທົ່ານັ້ນ).
|
||||
.solid-created = ສ້າງຮູບຊົງຕັນແລ້ວ.
|
||||
.source-object-not-found = ບໍ່ພົບວັດຖຸຕົ້ນສະບັບ.
|
||||
@@ -6333,8 +6336,11 @@ view-background =
|
||||
.stretch = Stretch
|
||||
.tile = Tile
|
||||
.scale = Scale
|
||||
.fit = Fit to screen
|
||||
.aspect = Keep aspect ratio
|
||||
.adjust = Adjust
|
||||
.reset = Reset
|
||||
.offset = Offset
|
||||
.pixels = px
|
||||
.no-image = No image selected
|
||||
.canvas = Drawing area color
|
||||
.info = Info
|
||||
|
||||
@@ -865,9 +865,12 @@ common =
|
||||
.sent-to-printer-printer = Verzonden aan printer: __ocs_fmt_0__
|
||||
.set-current = Actief maken
|
||||
.shade-plot = Schaduwplot
|
||||
.shaded-with-edges = Gearceerd met randen
|
||||
.shades-of-gray = Grijstinten
|
||||
.shadow-flags = Schaduwvlaggen
|
||||
.single = Enkel
|
||||
.size = Grootte
|
||||
.sketchy = Schetsmatig
|
||||
.snap-override-label-next-pick-only = Objectmagneet negeren: __ocs_fmt_0__ (alleen volgende selectie).
|
||||
.solid-created = Vast gemaakt.
|
||||
.source-object-not-found = Bronobject niet gevonden.
|
||||
@@ -6331,8 +6334,11 @@ view-background =
|
||||
.stretch = Stretch
|
||||
.tile = Tile
|
||||
.scale = Scale
|
||||
.fit = Fit to screen
|
||||
.aspect = Keep aspect ratio
|
||||
.adjust = Adjust
|
||||
.reset = Reset
|
||||
.offset = Offset
|
||||
.pixels = px
|
||||
.no-image = No image selected
|
||||
.canvas = Drawing area color
|
||||
.info = Info
|
||||
|
||||
@@ -866,9 +866,12 @@ common =
|
||||
.sent-to-printer-printer = Wysłano do drukarki: __ocs_fmt_0__
|
||||
.set-current = Ustaw prąd
|
||||
.shade-plot = Fabuła cienia
|
||||
.shaded-with-edges = Cieniowany z krawędziami
|
||||
.shades-of-gray = Odcienie szarości
|
||||
.shadow-flags = Flagi cienia
|
||||
.single = Pojedynczy
|
||||
.size = Rozmiar
|
||||
.sketchy = Szkicowy
|
||||
.snap-override-label-next-pick-only = Nadpisanie przyciągania: __ocs_fmt_0__ (tylko następny wybór).
|
||||
.solid-created = Utworzono bryłę.
|
||||
.source-object-not-found = Nie znaleziono obiektu źródłowego.
|
||||
@@ -6332,8 +6335,11 @@ view-background =
|
||||
.stretch = Stretch
|
||||
.tile = Tile
|
||||
.scale = Scale
|
||||
.fit = Fit to screen
|
||||
.aspect = Keep aspect ratio
|
||||
.adjust = Adjust
|
||||
.reset = Reset
|
||||
.offset = Offset
|
||||
.pixels = px
|
||||
.no-image = No image selected
|
||||
.canvas = Drawing area color
|
||||
.info = Info
|
||||
|
||||
@@ -867,9 +867,12 @@ common =
|
||||
.sent-to-printer-printer = Enviado à impressora: __ocs_fmt_0__
|
||||
.set-current = Definir como atual
|
||||
.shade-plot = Plotagem sombreada
|
||||
.shaded-with-edges = Sombreado com arestas
|
||||
.shades-of-gray = Tons de cinza
|
||||
.shadow-flags = Indicadores de sombra
|
||||
.single = Único
|
||||
.size = Tamanho
|
||||
.sketchy = Esboço
|
||||
.snap-override-label-next-pick-only = Substituição de snap: __ocs_fmt_0__ (somente a próxima escolha).
|
||||
.solid-created = Sólido criado.
|
||||
.source-object-not-found = Objeto de origem não encontrado.
|
||||
@@ -6333,8 +6336,11 @@ view-background =
|
||||
.stretch = Stretch
|
||||
.tile = Tile
|
||||
.scale = Scale
|
||||
.fit = Fit to screen
|
||||
.aspect = Keep aspect ratio
|
||||
.adjust = Adjust
|
||||
.reset = Reset
|
||||
.offset = Offset
|
||||
.pixels = px
|
||||
.no-image = No image selected
|
||||
.canvas = Drawing area color
|
||||
.info = Info
|
||||
|
||||
@@ -870,9 +870,12 @@ common =
|
||||
.sent-to-printer-printer = Отправлено на принтер: __ocs_fmt_0__
|
||||
.set-current = Сделать текущим
|
||||
.shade-plot = Скриншоты игры Shade
|
||||
.shaded-with-edges = Тонированный с кромками
|
||||
.shades-of-gray = Оттенки серого
|
||||
.shadow-flags = Флаги теней
|
||||
.single = Одинарный
|
||||
.size = Размер
|
||||
.sketchy = Эскизный
|
||||
.snap-override-label-next-pick-only = Переопределение по щелчку: __ocs_fmt_0__ (только следующий выбор).
|
||||
.solid-created = Твердое создание.
|
||||
.source-object-not-found = Источник объекта не найден.
|
||||
@@ -6334,8 +6337,11 @@ view-background =
|
||||
.stretch = Stretch
|
||||
.tile = Tile
|
||||
.scale = Scale
|
||||
.fit = Fit to screen
|
||||
.aspect = Keep aspect ratio
|
||||
.adjust = Adjust
|
||||
.reset = Reset
|
||||
.offset = Offset
|
||||
.pixels = px
|
||||
.no-image = No image selected
|
||||
.canvas = Drawing area color
|
||||
.info = Info
|
||||
|
||||
@@ -855,9 +855,12 @@ common =
|
||||
.sent-to-printer-printer = Yazıcıya gönderildi: __ocs_fmt_0__
|
||||
.set-current = Geçerli Yap
|
||||
.shade-plot = Gölgelendirilmiş yazdırma
|
||||
.shaded-with-edges = Kenarlarla gölgeli
|
||||
.shades-of-gray = Gri tonları
|
||||
.shadow-flags = Gölge bayrakları
|
||||
.single = Tek
|
||||
.size = Boyut
|
||||
.sketchy = Eskiz
|
||||
.snap-override-label-next-pick-only = Yakalama geçersiz kılma: __ocs_fmt_0__ (yalnızca sonraki seçim).
|
||||
.solid-created = Katı oluşturuldu.
|
||||
.source-object-not-found = Kaynak nesne bulunamadı.
|
||||
@@ -6254,8 +6257,11 @@ view-background =
|
||||
.stretch = Uzat
|
||||
.tile = Döşe
|
||||
.scale = Ölçek
|
||||
.fit = Ekrana sığdır
|
||||
.aspect = Oranı koru
|
||||
.aspect = En-boy oranını koru
|
||||
.adjust = Ayarla
|
||||
.reset = Sıfırla
|
||||
.offset = Öteleme
|
||||
.pixels = px
|
||||
.no-image = görüntü seçilmedi
|
||||
.canvas = çizim alanı rengi
|
||||
.info = Bilgi
|
||||
|
||||
@@ -854,9 +854,12 @@ common =
|
||||
.sent-to-printer-printer = 发送到打印机 : __ocs_fmt_0__
|
||||
.set-current = 置为当前
|
||||
.shade-plot = 着色打印
|
||||
.shaded-with-edges = 带边缘着色
|
||||
.shades-of-gray = 灰度
|
||||
.shadow-flags = 阴影标志
|
||||
.single = 单一
|
||||
.size = 大小
|
||||
.sketchy = 勾画
|
||||
.snap-override-label-next-pick-only = 抓取覆盖 : __ocs_fmt_0__ (仅选择下一步) 。
|
||||
.solid-created = 实相所造.
|
||||
.source-object-not-found = 找不到源对象 。
|
||||
@@ -6316,8 +6319,11 @@ view-background =
|
||||
.stretch = Stretch
|
||||
.tile = Tile
|
||||
.scale = Scale
|
||||
.fit = Fit to screen
|
||||
.aspect = Keep aspect ratio
|
||||
.adjust = Adjust
|
||||
.reset = Reset
|
||||
.offset = Offset
|
||||
.pixels = px
|
||||
.no-image = No image selected
|
||||
.canvas = Drawing area color
|
||||
.info = Info
|
||||
|
||||
@@ -866,9 +866,12 @@ common =
|
||||
.sent-to-printer-printer = 發送到印表機 : __ocs_fmt_0__
|
||||
.set-current = 置為目前
|
||||
.shade-plot = 著色列印
|
||||
.shaded-with-edges = 帶邊緣著色
|
||||
.shades-of-gray = 灰階
|
||||
.shadow-flags = 陰影標誌
|
||||
.single = 單一
|
||||
.size = 大小
|
||||
.sketchy = 草圖
|
||||
.snap-override-label-next-pick-only = 抓取覆蓋 : __ocs_fmt_0__ (僅選擇下一步) 。
|
||||
.solid-created = 實相所造.
|
||||
.source-object-not-found = 找不到源物件 。
|
||||
@@ -6328,8 +6331,11 @@ view-background =
|
||||
.stretch = Stretch
|
||||
.tile = Tile
|
||||
.scale = Scale
|
||||
.fit = Fit to screen
|
||||
.aspect = Keep aspect ratio
|
||||
.adjust = Adjust
|
||||
.reset = Reset
|
||||
.offset = Offset
|
||||
.pixels = px
|
||||
.no-image = No image selected
|
||||
.canvas = Drawing area color
|
||||
.info = Info
|
||||
|
||||
@@ -582,6 +582,10 @@ impl OpenCADStudio {
|
||||
| PdfDialogMsg::BgBrowse
|
||||
| PdfDialogMsg::BgPosition(_)
|
||||
| PdfDialogMsg::BgAspect(_)
|
||||
| PdfDialogMsg::BgOffset(_)
|
||||
| PdfDialogMsg::BgScale(_)
|
||||
| PdfDialogMsg::BgStep(..)
|
||||
| PdfDialogMsg::BgReset
|
||||
| PdfDialogMsg::BgApply) => return self.update_view_background(message),
|
||||
message @ (PdfDialogMsg::SecPerimeter(_)
|
||||
| PdfDialogMsg::SecMaxPoints(_)
|
||||
|
||||
@@ -450,8 +450,14 @@ impl OpenCADStudio {
|
||||
image: String::new(),
|
||||
position: BgPosition::Center,
|
||||
aspect: false,
|
||||
offset: [0.0, 0.0],
|
||||
scale: [1.0, 1.0],
|
||||
offset: ["0".into(), "0".into()],
|
||||
scale: ["1".into(), "1".into()],
|
||||
scale_base: [1.0, 1.0],
|
||||
preview: None,
|
||||
viewport: {
|
||||
let (width, height) = self.tabs[i].scene.selection.borrow().view.vp_size;
|
||||
[width as f32, height as f32]
|
||||
},
|
||||
canvas: [0, 1, 2].map(|k| (canvas[k].clamp(0.0, 1.0) * 255.0).round() as u8),
|
||||
};
|
||||
let document = &self.tabs[i].scene.document;
|
||||
@@ -478,8 +484,10 @@ impl OpenCADStudio {
|
||||
BgPosition::Center
|
||||
};
|
||||
state.aspect = value.maintain_aspect_ratio;
|
||||
state.offset = [value.offset.x, value.offset.y];
|
||||
state.scale = [value.scale.x, value.scale.y];
|
||||
state.offset = [value.offset.x, value.offset.y].map(crate::ui::window::pdf_dialogs::short);
|
||||
state.scale = [value.scale.x, value.scale.y].map(crate::ui::window::pdf_dialogs::short);
|
||||
state.scale_base = [value.scale.x, value.scale.y];
|
||||
state.preview = crate::ui::window::pdf_dialogs::bg_preview(&value.filename);
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
@@ -504,9 +512,42 @@ impl OpenCADStudio {
|
||||
M::BgKind(kind) => state.kind = kind,
|
||||
M::BgThree(on) => state.three = on,
|
||||
M::BgRotation(value) => state.rotation = value,
|
||||
M::BgImage(value) => state.image = value,
|
||||
M::BgImage(value) => {
|
||||
state.preview = crate::ui::window::pdf_dialogs::bg_preview(&value);
|
||||
state.image = value;
|
||||
}
|
||||
M::BgPosition(value) => state.position = value,
|
||||
M::BgAspect(on) => state.aspect = on,
|
||||
M::BgOffset(value) => state.offset = value,
|
||||
M::BgScale(value) => {
|
||||
// Keeping the aspect ratio, both scales follow the one changed.
|
||||
state.scale = if state.aspect {
|
||||
let changed = if value[0] != state.scale[0] { 0 } else { 1 };
|
||||
[value[changed].clone(), value[changed].clone()]
|
||||
} else {
|
||||
value
|
||||
};
|
||||
}
|
||||
M::BgStep(field, dir) => {
|
||||
use crate::ui::window::pdf_dialogs::{bg_step, short};
|
||||
let current = |text: &String, default: f64| text.trim().parse::<f64>().ok().filter(|v| v.is_finite()).unwrap_or(default);
|
||||
if field < 2 {
|
||||
let k = field as usize;
|
||||
state.offset[k] = short(bg_step(field, current(&state.offset[k], 0.0), dir));
|
||||
} else {
|
||||
let k = field as usize - 2;
|
||||
let next = short(bg_step(field, current(&state.scale[k], state.scale_base[k]), dir));
|
||||
if state.aspect {
|
||||
state.scale = [next.clone(), next];
|
||||
} else {
|
||||
state.scale[k] = next;
|
||||
}
|
||||
}
|
||||
}
|
||||
M::BgReset => {
|
||||
state.offset = ["0".into(), "0".into()];
|
||||
state.scale = ["1".into(), "1".into()];
|
||||
}
|
||||
M::BgColor(slot, rgb) => match slot {
|
||||
0 => state.solid = rgb,
|
||||
1 => state.top = rgb,
|
||||
@@ -585,14 +626,36 @@ impl OpenCADStudio {
|
||||
self.command_line.push_error("Invalid Background Image File!");
|
||||
return Task::none();
|
||||
}
|
||||
use crate::ui::window::pdf_dialogs::{BG_OFFSET_LIMIT, BG_SCALE_LIMIT};
|
||||
let number = |text: &String| text.trim().parse::<f64>().ok().filter(|v| v.is_finite());
|
||||
let (Some(ox), Some(oy), Some(sx), Some(sy)) = (
|
||||
number(&state.offset[0]),
|
||||
number(&state.offset[1]),
|
||||
number(&state.scale[0]),
|
||||
number(&state.scale[1]),
|
||||
) else {
|
||||
self.command_line.push_error(crate::t!("Requires a number.").as_ref());
|
||||
return Task::none();
|
||||
};
|
||||
// Within the reference's slider ranges; a zero scale
|
||||
// is ignored there, so the image keeps its scale.
|
||||
let scale = |value: f64, base: f64| {
|
||||
if value.abs() < 1e-9 { base } else { value.clamp(-BG_SCALE_LIMIT, BG_SCALE_LIMIT) }
|
||||
};
|
||||
Some(D::ImageBackground(ImageBackground {
|
||||
class_version: 1,
|
||||
filename: state.image.trim().to_string(),
|
||||
fit_to_screen: state.position == BgPosition::Stretch,
|
||||
maintain_aspect_ratio: state.aspect,
|
||||
use_tiling: state.position == BgPosition::Tile,
|
||||
offset: codec::types::Vector2::new(state.offset[0], state.offset[1]),
|
||||
scale: codec::types::Vector2::new(state.scale[0], state.scale[1]),
|
||||
offset: codec::types::Vector2::new(
|
||||
ox.clamp(-BG_OFFSET_LIMIT, BG_OFFSET_LIMIT),
|
||||
oy.clamp(-BG_OFFSET_LIMIT, BG_OFFSET_LIMIT),
|
||||
),
|
||||
scale: codec::types::Vector2::new(
|
||||
scale(sx, state.scale_base[0]),
|
||||
scale(sy, state.scale_base[1]),
|
||||
),
|
||||
}))
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1798,7 +1798,8 @@ impl OpenCADStudio {
|
||||
"ribbon_dropdown" => Message::ToggleRibbonDropdown(string(req, "value")?.into()),
|
||||
// The -VIEW Background dialog, one field per call: "type=gradient",
|
||||
// "color|top|middle|bottom=r,g,b", "three=1", "rotation=30",
|
||||
// "image=<path>", "position=center|stretch|tile", "aspect=1",
|
||||
// "image=<path>", "position=center|stretch|tile", "aspect=1", "offset=x,y" (pixels), "scale=x,y",
|
||||
// "step=offset_x|offset_y|scale_x|scale_y,+1|-1", "reset",
|
||||
// "apply" or "cancel".
|
||||
"view_background" => {
|
||||
use crate::ui::window::pdf_dialogs::{BgKind, BgPosition, PdfDialogMsg as P};
|
||||
@@ -1840,6 +1841,32 @@ impl OpenCADStudio {
|
||||
_ => return Err(bad()),
|
||||
})),
|
||||
"aspect" => Message::PdfDialog(P::BgAspect(value == "1")),
|
||||
"offset" | "scale" => {
|
||||
let pair: Vec<String> = value.split(',').map(|part| part.trim().to_string()).collect();
|
||||
let pair = <[String; 2]>::try_from(pair).map_err(|_| bad())?;
|
||||
if pair.iter().any(|v| v.parse::<f64>().map_or(true, |v| !v.is_finite())) {
|
||||
return Err(bad());
|
||||
}
|
||||
if key == "offset" {
|
||||
Message::PdfDialog(P::BgOffset(pair))
|
||||
} else {
|
||||
Message::PdfDialog(P::BgScale(pair))
|
||||
}
|
||||
}
|
||||
"step" => {
|
||||
// step=offset_x|offset_y|scale_x|scale_y,+1|-1
|
||||
let (field, dir) = value.split_once(',').ok_or_else(bad)?;
|
||||
let field = match field {
|
||||
"offset_x" => 0,
|
||||
"offset_y" => 1,
|
||||
"scale_x" => 2,
|
||||
"scale_y" => 3,
|
||||
_ => return Err(bad()),
|
||||
};
|
||||
let dir: i8 = dir.trim().parse().map_err(|_| bad())?;
|
||||
Message::PdfDialog(P::BgStep(field, dir))
|
||||
}
|
||||
"reset" => Message::PdfDialog(P::BgReset),
|
||||
_ => return Err(bad()),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1084,6 +1084,9 @@ impl OpenCADStudio {
|
||||
// viewport, the picker drives that viewport entity's own
|
||||
// render mode; the model-layout tab style is untouched.
|
||||
if self.tabs[i].scene.set_active_viewport_render_mode(mode) {
|
||||
self.tabs[i]
|
||||
.scene
|
||||
.set_active_visual_style_named(crate::modules::view::visual_style::style_name_for(mode));
|
||||
self.tabs[i].scene.bump_geometry_no_blocks();
|
||||
self.tabs[i].dirty = true;
|
||||
self.command_line
|
||||
|
||||
+20
-13
@@ -182,6 +182,24 @@ impl std::fmt::Display for RenderModeChoice {
|
||||
}
|
||||
}
|
||||
|
||||
/// A named style (Realistic, …) the active viewport draws as, by name.
|
||||
fn named_visual_style(
|
||||
scene: &crate::scene::Scene,
|
||||
mode: codec::entities::ViewportRenderMode,
|
||||
) -> Option<String> {
|
||||
match scene.document.objects.get(&scene.active_visual_style()) {
|
||||
Some(codec::objects::ObjectType::VisualStyle(style)) => {
|
||||
match crate::modules::view::visual_style::mode_for_style_name(&style.description) {
|
||||
Some((named_mode, true)) if named_mode == mode => {
|
||||
Some(crate::t!(style.description.as_str()).into_owned())
|
||||
}
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
impl OpenCADStudio {
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
pub fn view(&self, window_id: window::Id) -> Element<'_, Message> {
|
||||
@@ -1297,18 +1315,7 @@ bg={bg_ms:.1}ms n={view_count}"
|
||||
let rect = tab.scene.active_model_tile_bounds(vw, vh);
|
||||
// Unified control chip: split buttons + render-mode picker +
|
||||
// grid / grid-snap toggles, for the active Model tile.
|
||||
// A named style (Realistic, …) the tile draws as shows by name.
|
||||
let style_name = match tab.scene.document.objects.get(&tab.scene.active_visual_style()) {
|
||||
Some(codec::objects::ObjectType::VisualStyle(style)) => {
|
||||
match crate::modules::view::visual_style::mode_for_style_name(&style.description) {
|
||||
Some((mode, true)) if mode == tab.render_mode => {
|
||||
Some(crate::t!(style.description.as_str()).into_owned())
|
||||
}
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
_ => None,
|
||||
};
|
||||
let style_name = named_visual_style(&tab.scene, tab.render_mode);
|
||||
let bar = viewport_controls(
|
||||
tab.render_mode,
|
||||
self.show_grid,
|
||||
@@ -1410,7 +1417,7 @@ bg={bg_ms:.1}ms n={view_count}"
|
||||
0,
|
||||
self.render_mode_menu_open,
|
||||
self.render_mode_preview,
|
||||
None,
|
||||
named_visual_style(&tab.scene, vp_mode),
|
||||
);
|
||||
let adaptive: Element<'_, Message> = DensitySwap::new(vec![
|
||||
iced::widget::opaque(bar),
|
||||
|
||||
@@ -2994,6 +2994,8 @@ pub(super) fn message_attribute(source: &str) -> Option<(&'static str, &'static
|
||||
"Shade plot" => Some(("common", "shade-plot")),
|
||||
"Shaded" => Some(("view", "shaded")),
|
||||
"Shaded viewport options" => Some(("plot", "shaded-viewport-options")),
|
||||
"Shaded with edges" => Some(("common", "shaded-with-edges")),
|
||||
"Shades of Gray" => Some(("common", "shades-of-gray")),
|
||||
"Shadow flags" => Some(("common", "shadow-flags")),
|
||||
"Shadows" => Some(("properties", "shadows")),
|
||||
"Shape" => Some(("properties", "shape")),
|
||||
@@ -3020,6 +3022,7 @@ pub(super) fn message_attribute(source: &str) -> Option<(&'static str, &'static
|
||||
"SingleLine" => Some(("properties", "singleline")),
|
||||
"Size" => Some(("common", "size")),
|
||||
"Sketch" => Some(("draw", "sketch")),
|
||||
"Sketchy" => Some(("common", "sketchy")),
|
||||
"Snap override: {label} (next pick only)." => Some(("common", "snap-override-label-next-pick-only")),
|
||||
"Snap to\nUnderlays" => Some(("insert", "snap-to-underlays")),
|
||||
"Softness" => Some(("properties", "softness")),
|
||||
|
||||
+16
-1
@@ -336,6 +336,12 @@ impl Scene {
|
||||
|
||||
/// The visual style of the active Model tile's viewport record.
|
||||
pub fn active_visual_style(&self) -> Handle {
|
||||
if self.current_layout != "Model" {
|
||||
return match self.active_viewport.and_then(|handle| self.document.get_entity(handle)) {
|
||||
Some(EntityType::Viewport(value)) => value.visual_style_handle,
|
||||
_ => Handle::NULL,
|
||||
};
|
||||
}
|
||||
self.active_tile_vport_handle()
|
||||
.and_then(|handle| self.document.vports.iter().find(|value| value.handle == handle))
|
||||
.map_or(Handle::NULL, |value| value.visual_style_handle)
|
||||
@@ -348,7 +354,16 @@ impl Scene {
|
||||
codec::objects::ObjectType::VisualStyle(style) if style.description == name => Some(*handle),
|
||||
_ => None,
|
||||
});
|
||||
let (Some(style), Some(handle)) = (style, self.active_tile_vport_handle()) else { return };
|
||||
let Some(style) = style else { return };
|
||||
if self.current_layout != "Model" {
|
||||
if let Some(handle) = self.active_viewport {
|
||||
if let Some(EntityType::Viewport(value)) = self.document.get_entity_mut(handle) {
|
||||
value.visual_style_handle = style;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
let Some(handle) = self.active_tile_vport_handle() else { return };
|
||||
if let Some(value) = self.document.vports.iter_mut().find(|value| value.handle == handle) {
|
||||
value.visual_style_handle = style;
|
||||
}
|
||||
|
||||
@@ -4013,7 +4013,8 @@ analytic={:.1} regular={:.1} blocks={:.1}",
|
||||
}
|
||||
let upload = |label: &'static str,
|
||||
image: Option<&crate::scene::model::image_model::DecodedImage>,
|
||||
fallback: [u8; 4]| {
|
||||
fallback: [u8; 4],
|
||||
format: wgpu::TextureFormat| {
|
||||
let (width, height, pixels) = image
|
||||
.map(|image| (image.width, image.height, image.pixels.as_slice()))
|
||||
.unwrap_or((1, 1, fallback.as_slice()));
|
||||
@@ -4027,7 +4028,7 @@ analytic={:.1} regular={:.1} blocks={:.1}",
|
||||
mip_level_count: 1,
|
||||
sample_count: 1,
|
||||
dimension: wgpu::TextureDimension::D2,
|
||||
format: wgpu::TextureFormat::Rgba8UnormSrgb,
|
||||
format,
|
||||
usage: wgpu::TextureUsages::TEXTURE_BINDING | wgpu::TextureUsages::COPY_DST,
|
||||
view_formats: &[],
|
||||
});
|
||||
@@ -4047,8 +4048,21 @@ analytic={:.1} regular={:.1} blocks={:.1}",
|
||||
);
|
||||
texture
|
||||
};
|
||||
self.background_texture = upload("background.texture", background, [0, 0, 0, 255]);
|
||||
self.environment_texture = upload("environment.texture", environment, [128, 128, 128, 255]);
|
||||
// The background image is drawn as it is, like the solid and gradient
|
||||
// colours (an sRGB view would darken it a second time); the
|
||||
// environment map stays sRGB for lighting.
|
||||
self.background_texture = upload(
|
||||
"background.texture",
|
||||
background,
|
||||
[0, 0, 0, 255],
|
||||
wgpu::TextureFormat::Rgba8Unorm,
|
||||
);
|
||||
self.environment_texture = upload(
|
||||
"environment.texture",
|
||||
environment,
|
||||
[128, 128, 128, 255],
|
||||
wgpu::TextureFormat::Rgba8UnormSrgb,
|
||||
);
|
||||
self.rebuild_frame_bind_group(device);
|
||||
self.background_source_id = background_id;
|
||||
self.environment_source_id = environment_id;
|
||||
|
||||
@@ -3,3 +3,4 @@ pub mod dispatch;
|
||||
pub mod render;
|
||||
pub mod transform;
|
||||
pub mod viewport_pane;
|
||||
pub use render::device_scale;
|
||||
@@ -385,6 +385,7 @@ impl shader::Primitive for Primitive {
|
||||
pipeline.gpu_error_epoch = errors_at_entry;
|
||||
}
|
||||
let scale = viewport.scale_factor() as f32;
|
||||
DEVICE_SCALE.store(scale.to_bits(), std::sync::atomic::Ordering::Relaxed);
|
||||
let instance_ids: Vec<u64> = self.viewports.iter().map(|vp| vp.instance_id).collect();
|
||||
let slots = pipeline.resolve_slots(device, queue, &instance_ids);
|
||||
for (i, vp) in self.viewports.iter().enumerate() {
|
||||
@@ -5440,3 +5441,11 @@ mod layer0_inherit_tests {
|
||||
assert!(scene.document_render_env_cache.borrow().is_some());
|
||||
}
|
||||
}
|
||||
|
||||
/// The display's device pixels per logical pixel, as the viewport last drew.
|
||||
static DEVICE_SCALE: std::sync::atomic::AtomicU32 = std::sync::atomic::AtomicU32::new(0x3f80_0000);
|
||||
|
||||
/// Device pixels per logical pixel of the drawing viewport.
|
||||
pub fn device_scale() -> f32 {
|
||||
f32::from_bits(DEVICE_SCALE.load(std::sync::atomic::Ordering::Relaxed))
|
||||
}
|
||||
+228
-45
@@ -122,6 +122,13 @@ pub enum PdfDialogMsg {
|
||||
BgBrowse,
|
||||
BgPosition(BgPosition),
|
||||
BgAspect(bool),
|
||||
/// An image background's offset (pixels, x and y) and scale, as typed.
|
||||
BgOffset([String; 2]),
|
||||
BgScale([String; 2]),
|
||||
/// A spinner step on offset x / y (0, 1) or scale x / y (2, 3).
|
||||
BgStep(u8, i8),
|
||||
/// Offset 0, scale 1.
|
||||
BgReset,
|
||||
BgApply,
|
||||
}
|
||||
|
||||
@@ -2178,19 +2185,42 @@ impl fmt::Display for BgPosition {
|
||||
}
|
||||
}
|
||||
|
||||
/// How an image background is scaled: to the screen, or keeping its
|
||||
/// aspect ratio.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub struct BgAspect(pub bool);
|
||||
/// A background image as the preview draws it.
|
||||
pub struct BgPreview {
|
||||
pub size: [u32; 2],
|
||||
/// Unmirrored, mirrored in x, in y, in both.
|
||||
pub handles: [image::Handle; 4],
|
||||
}
|
||||
|
||||
impl fmt::Display for BgAspect {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.write_str(&if self.0 {
|
||||
crate::tr!("view-background", "aspect")
|
||||
} else {
|
||||
crate::tr!("view-background", "fit")
|
||||
})
|
||||
/// Loads a background image for the preview, at most 512 pixels a side.
|
||||
pub fn bg_preview(path: &str) -> Option<BgPreview> {
|
||||
let decoded = ::image::open(path.trim()).ok()?;
|
||||
let size = [decoded.width(), decoded.height()];
|
||||
let small = if size[0].max(size[1]) > 512 { decoded.thumbnail(512, 512) } else { decoded }.to_rgba8();
|
||||
let handle = |pixels: ::image::RgbaImage| image::Handle::from_rgba(pixels.width(), pixels.height(), pixels.into_raw());
|
||||
let flip_x = ::image::imageops::flip_horizontal(&small);
|
||||
let flip_y = ::image::imageops::flip_vertical(&small);
|
||||
let flip_xy = ::image::imageops::flip_vertical(&flip_x);
|
||||
Some(BgPreview { size, handles: [handle(small), handle(flip_x), handle(flip_y), handle(flip_xy)] })
|
||||
}
|
||||
|
||||
/// Image offsets the reference's Adjust Image sliders reach, in pixels.
|
||||
pub const BG_OFFSET_LIMIT: f64 = 2000.0;
|
||||
/// Image scales the reference's sliders reach (slider value / 10).
|
||||
pub const BG_SCALE_LIMIT: f64 = 10.0;
|
||||
|
||||
/// One spinner step on an image background field: a pixel for an offset, a
|
||||
/// tenth for a scale, which skips 0 (the reference ignores a zero scale).
|
||||
pub fn bg_step(field: u8, value: f64, dir: i8) -> f64 {
|
||||
let dir = f64::from(dir.signum());
|
||||
if field < 2 {
|
||||
return (value.round() + dir).clamp(-BG_OFFSET_LIMIT, BG_OFFSET_LIMIT);
|
||||
}
|
||||
let mut next = ((value * 10.0).round() + dir) / 10.0;
|
||||
if next.abs() < 0.05 {
|
||||
next += dir / 10.0;
|
||||
}
|
||||
next.clamp(-BG_SCALE_LIMIT, BG_SCALE_LIMIT)
|
||||
}
|
||||
|
||||
/// The Background dialog's fields for one named view.
|
||||
@@ -2206,9 +2236,16 @@ pub struct ViewBackgroundState {
|
||||
pub image: String,
|
||||
pub position: BgPosition,
|
||||
pub aspect: bool,
|
||||
/// The image's offset (pixels) and scale, kept from the view's image.
|
||||
pub offset: [f64; 2],
|
||||
pub scale: [f64; 2],
|
||||
/// The image's offset (pixels) and scale as typed, and the scale the
|
||||
/// view's image had (kept for a zero scale).
|
||||
pub offset: [String; 2],
|
||||
pub scale: [String; 2],
|
||||
pub scale_base: [f64; 2],
|
||||
/// The chosen image for the preview: its size in pixels and a small copy
|
||||
/// as it is and mirrored (x, y, both), for negative scales.
|
||||
pub preview: Option<BgPreview>,
|
||||
/// The drawing viewport's size, which the preview stands for.
|
||||
pub viewport: [f32; 2],
|
||||
/// The drawing area colour, shown for no background.
|
||||
pub canvas: [u8; 3],
|
||||
}
|
||||
@@ -2268,20 +2305,80 @@ pub fn view_background<'a>(
|
||||
}
|
||||
BgKind::Image => {
|
||||
if std::path::Path::new(state.image.trim()).is_file() {
|
||||
let fit = match (state.position, state.aspect) {
|
||||
(BgPosition::Stretch, false) => iced::ContentFit::Fill,
|
||||
(BgPosition::Stretch, true) => iced::ContentFit::Contain,
|
||||
_ => iced::ContentFit::None,
|
||||
};
|
||||
container(
|
||||
image(image::Handle::from_path(state.image.trim()))
|
||||
.content_fit(fit)
|
||||
.width(Fill)
|
||||
.height(Fill),
|
||||
)
|
||||
.center(Fill)
|
||||
.style(fill(Background::Color(rgb(state.canvas))))
|
||||
.into()
|
||||
let canvas = Background::Color(rgb(state.canvas));
|
||||
if state.position == BgPosition::Stretch {
|
||||
// Filling the view; keeping the aspect ratio it covers
|
||||
// the view and the overflow is cut off.
|
||||
let fit = if state.aspect { iced::ContentFit::Cover } else { iced::ContentFit::Fill };
|
||||
let handle = state.preview.as_ref().map_or_else(
|
||||
|| image::Handle::from_path(state.image.trim()),
|
||||
|preview| preview.handles[0].clone(),
|
||||
);
|
||||
container(image(handle).content_fit(fit).width(Fill).height(Fill))
|
||||
.center(Fill)
|
||||
.clip(true)
|
||||
.style(fill(canvas))
|
||||
.into()
|
||||
} else {
|
||||
// The image at its size times its scale, moved by its
|
||||
// offset, in a view of the drawing viewport's shape.
|
||||
let parse = |v: &String, d: f64| v.trim().parse::<f64>().ok().filter(|v| v.is_finite()).unwrap_or(d);
|
||||
let offset = [parse(&state.offset[0], 0.0), parse(&state.offset[1], 0.0)];
|
||||
let scale = [0, 1].map(|k| {
|
||||
let v = parse(&state.scale[k], state.scale_base[k]);
|
||||
if v.abs() < 1e-9 { state.scale_base[k] } else { v }
|
||||
});
|
||||
let [iw, ih] = state.preview.as_ref().map_or([1, 1], |preview| preview.size);
|
||||
// A negative scale mirrors the image.
|
||||
let mirrored = usize::from(scale[0] < 0.0) | usize::from(scale[1] < 0.0) << 1;
|
||||
let handle = state.preview.as_ref().map_or_else(
|
||||
|| image::Handle::from_path(state.image.trim()),
|
||||
|preview| preview.handles[mirrored].clone(),
|
||||
);
|
||||
let viewport = state.viewport;
|
||||
// The image's pixels and offsets are device pixels; the
|
||||
// viewport is measured in logical ones.
|
||||
let device = crate::scene::view::device_scale().max(0.1);
|
||||
let tile = state.position == BgPosition::Tile;
|
||||
container(iced::widget::responsive(move |size| {
|
||||
let factor = size.height / viewport[1].max(1.0) / device;
|
||||
let w = (iw as f32 * scale[0].abs() as f32 * factor).max(1.0);
|
||||
let h = (ih as f32 * scale[1].abs() as f32 * factor).max(1.0);
|
||||
let x = size.width / 2.0 + offset[0] as f32 * factor - w / 2.0;
|
||||
let y = size.height / 2.0 + offset[1] as f32 * factor - h / 2.0;
|
||||
let (cols, rows) = if tile {
|
||||
((size.width / w).ceil() as i32 + 1, (size.height / h).ceil() as i32 + 1)
|
||||
} else {
|
||||
(0, 0)
|
||||
};
|
||||
let mut layers = iced::widget::Stack::new()
|
||||
.width(Fill)
|
||||
.height(Fill)
|
||||
.push(container(Space::new()).width(Fill).height(Fill));
|
||||
let x0 = if tile { x - (x / w).ceil() * w } else { x };
|
||||
let y0 = if tile { y - (y / h).ceil() * h } else { y };
|
||||
for row_index in 0..=rows.min(60) {
|
||||
for col_index in 0..=cols.min(60) {
|
||||
let at = iced::Point::new(x0 + col_index as f32 * w, y0 + row_index as f32 * h);
|
||||
layers = layers.push(
|
||||
iced::widget::pin(
|
||||
image(handle.clone())
|
||||
.content_fit(iced::ContentFit::Fill)
|
||||
.width(Length::Fixed(w))
|
||||
.height(Length::Fixed(h)),
|
||||
)
|
||||
.position(at),
|
||||
);
|
||||
}
|
||||
}
|
||||
Element::<Message>::from(layers)
|
||||
}))
|
||||
.width(Fill)
|
||||
.height(Fill)
|
||||
.clip(true)
|
||||
.style(fill(canvas))
|
||||
.into()
|
||||
}
|
||||
} else {
|
||||
container(note(crate::tr!("view-background", "no-image")))
|
||||
.center(Fill)
|
||||
@@ -2394,28 +2491,22 @@ pub fn view_background<'a>(
|
||||
]
|
||||
.spacing(8)
|
||||
.align_y(iced::Center),
|
||||
row![
|
||||
label(crate::tr!("view-background", "scale"), true),
|
||||
pick_list(
|
||||
Some(BgAspect(state.aspect)),
|
||||
vec![BgAspect(false), BgAspect(true)],
|
||||
|a: &BgAspect| a.to_string()
|
||||
)
|
||||
.on_select(|a: BgAspect| msg(PdfDialogMsg::BgAspect(a.0)))
|
||||
.text_size(12)
|
||||
.padding([4, 8])
|
||||
.width(Fill),
|
||||
]
|
||||
.spacing(8)
|
||||
.align_y(iced::Center),
|
||||
chip(
|
||||
crate::tr!("view-background", "aspect"),
|
||||
state.aspect,
|
||||
msg(PdfDialogMsg::BgAspect(!state.aspect))
|
||||
),
|
||||
]
|
||||
.spacing(8),
|
||||
),
|
||||
};
|
||||
let adjust = (state.kind == BgKind::Image).then(|| adjust_card(state));
|
||||
let mut body = column![kind, preview, options].spacing(10);
|
||||
if let Some(adjust) = adjust {
|
||||
body = body.push(adjust);
|
||||
}
|
||||
column![
|
||||
kind,
|
||||
preview,
|
||||
options,
|
||||
body,
|
||||
footer(
|
||||
"background",
|
||||
None,
|
||||
@@ -2428,3 +2519,95 @@ pub fn view_background<'a>(
|
||||
.width(sizing.width)
|
||||
.into()
|
||||
}
|
||||
|
||||
/// The image's offset and scale (the reference's Adjust Image): pixel offsets
|
||||
/// and scales with spinners and a reset; inactive while the image is
|
||||
/// stretched over the view, where the reference ignores them.
|
||||
fn adjust_card<'a>(state: &'a ViewBackgroundState) -> Element<'a, Message> {
|
||||
let enabled = state.position != BgPosition::Stretch;
|
||||
let dim = move |theme: &Theme| {
|
||||
if enabled {
|
||||
muted_style(theme)
|
||||
} else {
|
||||
text::Style { color: Some(theme.palette().background.strong.color) }
|
||||
}
|
||||
};
|
||||
let spin = |field: u8| -> Element<'a, Message> {
|
||||
let value = if field < 2 { &state.offset[field as usize] } else { &state.scale[field as usize - 2] };
|
||||
let mut input = text_input("", value)
|
||||
.size(11)
|
||||
.padding([4, 8])
|
||||
.width(Length::Fixed(64.0))
|
||||
.style(move |theme: &Theme, status| {
|
||||
let mut style = field_style(theme, status);
|
||||
if !enabled {
|
||||
style.value = theme.palette().background.strong.color;
|
||||
}
|
||||
style
|
||||
});
|
||||
if enabled {
|
||||
input = input.on_input(move |v| {
|
||||
if field < 2 {
|
||||
let mut pair = state.offset.clone();
|
||||
pair[field as usize] = v;
|
||||
msg(PdfDialogMsg::BgOffset(pair))
|
||||
} else {
|
||||
let mut pair = state.scale.clone();
|
||||
pair[field as usize - 2] = v;
|
||||
msg(PdfDialogMsg::BgScale(pair))
|
||||
}
|
||||
});
|
||||
}
|
||||
let arrow = |up: bool| {
|
||||
let mut b = button(crate::ui::icons::themed_arrow_toggle(up, 7.0))
|
||||
.style(button_style(false))
|
||||
.padding([1, 4]);
|
||||
if enabled {
|
||||
b = b.on_press(msg(PdfDialogMsg::BgStep(field, if up { 1 } else { -1 })));
|
||||
}
|
||||
b
|
||||
};
|
||||
row![input, column![arrow(true), arrow(false)].spacing(1)].spacing(2).align_y(iced::Center).into()
|
||||
};
|
||||
let axis = |name: &'static str| text(name).size(11).style(dim);
|
||||
let line = |label: String, a: u8, b: u8, unit: bool| -> Element<'a, Message> {
|
||||
let mut r = row![
|
||||
text(label).size(11).style(dim).width(Length::Fixed(72.0)),
|
||||
axis("X"),
|
||||
spin(a),
|
||||
axis("Y"),
|
||||
spin(b),
|
||||
]
|
||||
.spacing(6)
|
||||
.align_y(iced::Center);
|
||||
if unit {
|
||||
r = r.push(text(crate::tr!("view-background", "pixels")).size(11).style(dim));
|
||||
}
|
||||
r.into()
|
||||
};
|
||||
let mut reset = button(text(crate::tr!("view-background", "reset")).size(11))
|
||||
.style(button_style(false))
|
||||
.padding([3, 10]);
|
||||
if enabled {
|
||||
reset = reset.on_press(msg(PdfDialogMsg::BgReset));
|
||||
}
|
||||
container(
|
||||
column![
|
||||
row![
|
||||
text(crate::tr!("view-background", "adjust").to_uppercase()).size(10).style(move |theme: &Theme| {
|
||||
if enabled { accent_text(theme) } else { dim(theme) }
|
||||
}),
|
||||
Space::new().width(Fill),
|
||||
reset,
|
||||
]
|
||||
.align_y(iced::Center),
|
||||
line(crate::tr!("view-background", "offset"), 0, 1, true),
|
||||
line(crate::tr!("view-background", "scale"), 2, 3, false),
|
||||
]
|
||||
.spacing(8),
|
||||
)
|
||||
.padding([10, 12])
|
||||
.width(Fill)
|
||||
.style(card_style)
|
||||
.into()
|
||||
}
|
||||
Reference in new issue
Block a user