From 9fe0b9ecc956f99787a30f3d521404efa843e0e9 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 13 Nov 2026 14:28:58 -0800 Subject: [PATCH 001/102] i18n: Spanish translates 1,840 of the status and error messages the untranslated report lists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Spanish catalog lacked a row for 1,842 of the status and error messages that the untranslated report finds in the sources, so the status bar showed those messages in English. - es.tsv gains 1,840 `@msg` rows: the errors of commands and their parameter checks, scripts, file import and export, effects and plug-ins. The translations are VectorCraft's own, written from the English meaning in the catalog's neutral Spanish and its existing feature names. Placeholders, backticked names, quoted values, bare true, false and null, and command ids stay as the English writes them. - Two messages have no row and are still shown in English: "unknown parameter `{within}{key}`; {why}" and "{name} must be {lo}–{hi}{unit} (got {v})". Each has two placeholders in a row, and the catalog does not load a row for such a message. The untranslated report still lists both for Spanish. - Menu strings, `tl!` literals, undo labels and swatch names are unchanged. - A test checks that Spanish shows rendered messages from the script engine, the parameter checks, the importers, the 3D effects and the trim add-on in Spanish with their values kept. - The Spanish row of docs/localization-parity.md gives the catalog's current message counts. Docs: docs/target-app-parity.md, docs/localization-parity.md. --- crates/ui-egui/src/i18n/es.tsv | 1840 ++++++++++++++++++++++++++++++ crates/ui-egui/src/i18n/tests.rs | 25 + docs/localization-parity.md | 2 +- docs/target-app-parity.md | 1 + 4 files changed, 1867 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index f3d98e0518..d26258c501 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -7395,3 +7395,1843 @@ breakText Glyphs Glifos Margin Margen Box Caja Swatch Muestra +@msg 'caller', 'callee' and 'arguments' cannot be used on strict mode functions 'caller', 'callee' y 'arguments' no se pueden usar en funciones en modo estricto +@msg Boolean.prototype.{name} was called on a value that is not a Boolean Se llamó a Boolean.prototype.{name} con un valor que no es un Boolean +@msg CMYK images whose samples couldn't be read in CMYK were imported in RGB Las imágenes CMYK cuyas muestras no se pudieron leer en CMYK se importaron en RGB +@msg Cannot write to the location of “{name}”; choose where to save it No se puede escribir en la ubicación de “{name}”; elige dónde guardarlo +@msg DCS files can only be placed linked: use File › Place with Link on Los archivos DCS solo se pueden colocar vinculados: usa Archivo › Colocar con Vincular activado +@msg Date.prototype method called on a value that is not a Date object Se llamó a un método de Date.prototype con un valor que no es un objeto Date +@msg Error.prototype.toString was called on a value that is not an object Se llamó a Error.prototype.toString con un valor que no es un objeto +@msg Function.prototype.toString was called on a value that is not a function Se llamó a Function.prototype.toString con un valor que no es una función +@msg Import SVG Filter reads SVG files, not SVGZ Importar filtro SVG lee archivos SVG, no SVGZ +@msg JSON.parse: {why} (at offset {at}) JSON.parse: {why} (en el desplazamiento {at}) +@msg JSON.stringify cannot write a structure that contains itself JSON.stringify no puede escribir una estructura que se contiene a sí misma +@msg Namespace.prototype.toString needs a Namespace Namespace.prototype.toString necesita un Namespace +@msg New Document profiles need the preferences folder, which this run doesn't have Los perfiles de Nuevo documento necesitan la carpeta de preferencias, que esta ejecución no tiene +@msg Number.prototype.{name} was called on a value that is not a number Se llamó a Number.prototype.{name} con un valor que no es un número +@msg Object.create's prototype must be an object or null El prototipo de Object.create debe ser un objeto o null +@msg Object.{function} was given a value that is not an object Object.{function} recibió un valor que no es un objeto +@msg QName.prototype.toString needs a QName QName.prototype.toString necesita un QName +@msg RegExp.prototype.{name} was called on a value that is not a RegExp object Se llamó a RegExp.prototype.{name} con un valor que no es un objeto RegExp +@msg Stencil Bridges: the selected art is too large or too detailed to bridge Puentes de plantilla: la ilustración seleccionada es demasiado grande o detallada para unirla con puentes +@msg String.prototype.toString was called on a value that is not a string Se llamó a String.prototype.toString con un valor que no es una cadena +@msg The {name} profile could not be read, so the new document has the default settings: {reason} No se pudo leer el perfil {name}, así que el nuevo documento tiene los ajustes predeterminados: {reason} +@msg Trap: more than {_1} pairs of objects lie close enough to trap, or too many objects share a horizontal range; trap fewer objects at a time Reventar: más de {_1} pares de objetos están lo bastante cerca para reventarse, o demasiados objetos comparten un intervalo horizontal; reventa menos objetos a la vez +@msg Weed Box and Lines: no weeding line fits outside the art, and the weed box is off Caja y líneas de pelado: ninguna línea de pelado cabe fuera de la ilustración y la caja de pelado está desactivada +@msg \\ at end of pattern \\ al final del patrón +@msg `alignOn` cannot be empty `alignOn` no puede estar vacío +@msg `alignOn` must be a string `alignOn` debe ser una cadena +@msg `align` must be a string `align` debe ser una cadena +@msg `answer` for this {kind} dialog must be one of: {_1} `answer` para este cuadro de diálogo {kind} debe ser uno de: {_1} +@msg `answers` has more than {MAX_ANSWERS} answers `answers` tiene más de {MAX_ANSWERS} respuestas +@msg `answers` is larger than 1 MiB `answers` ocupa más de 1 MiB +@msg `answers` must be a list of answers `answers` debe ser una lista de respuestas +@msg `artboard` must be the index of an artboard of the document `artboard` debe ser el índice de una mesa de trabajo del documento +@msg `artboardsAt` must be [x, y] `artboardsAt` debe ser [x, y] +@msg `artboards` names an artboard the document does not have `artboards` nombra una mesa de trabajo que el documento no tiene +@msg `artboards` names an artboard twice `artboards` nombra dos veces la misma mesa de trabajo +@msg `at` must be [x, y] (got {at}) `at` debe ser [x, y] (se recibió {at}) +@msg `beside` needs `side` `beside` necesita `side` +@msg `code` must be a whole number `code` debe ser un número entero +@msg `colorMode` must be one of rgb, cmyk `colorMode` debe ser uno de rgb, cmyk +@msg `colors` does not apply to the {name} reduction `colors` no se aplica a la reducción {name} +@msg `colors` must be a whole number from 2 to 256 `colors` debe ser un número entero entre 2 y 256 +@msg `colors` must be at least 9 for the uniform reduction `colors` debe ser al menos 9 para la reducción uniforme +@msg `colors` must be between 1 and {MAX_THEME_COLORS} (got {n}) `colors` debe estar entre 1 y {MAX_THEME_COLORS} (se recibió {n}) +@msg `count` must be a whole number from 0 to {MAX_COUNT} `count` debe ser un número entero entre 0 y {MAX_COUNT} +@msg `ditherAmount` must be a number from 0 to 100 `ditherAmount` debe ser un número entre 0 y 100 +@msg `fidelity` must be from {lo} to {hi} pt `fidelity` debe estar entre {lo} y {hi} pt +@msg `focal` and `radius` cannot be used together `focal` y `radius` no se pueden usar juntos +@msg `focal` must be an array of [subpath, anchor] pairs `focal` debe ser una lista de pares [subpath, anchor] +@msg `focal` names [{si}, {ai}], which is not an anchor of the path `focal` nombra [{si}, {ai}], que no es un punto de ancla del trazado +@msg `glyphAlternate` takes only null, which takes a glyph choice away (text.setGlyphAlternate makes one) `glyphAlternate` solo acepta null, que quita una elección de glifo (text.setGlyphAlternate crea una) +@msg `group` must be one of {_1} `group` debe ser uno de {_1} +@msg `group` must be the Objects on Path group of `member` and `target` `group` debe ser el grupo de Objetos en trazado de `member` y `target` +@msg `id` is an object id, not {v} `id` es un id de objeto, no {v} +@msg `item` needs `index` `item` necesita `index` +@msg `kerningBefore` belongs to a line's first character, not to a character style (text.setRangeStyle sets it) `kerningBefore` corresponde al primer carácter de una línea, no a un estilo de carácter (lo establece text.setRangeStyle) +@msg `kinsokuType` must be "pushInFirst", "pushOutFirst" or "pushOutOnly" `kinsokuType` debe ser "pushInFirst", "pushOutFirst" o "pushOutOnly" +@msg `leader` must be a string `leader` debe ser una cadena +@msg `max` must be 1 to {MAX_SUGGESTIONS} `max` debe estar entre 1 y {MAX_SUGGESTIONS} +@msg `name` must be a name that is not empty `name` debe ser un nombre que no esté vacío +@msg `name` must not be empty `name` no debe estar vacío +@msg `origin` must be [x, y] in points `origin` debe ser [x, y] en puntos +@msg `picks` must be an array (got {v}) `picks` debe ser una lista (se recibió {v}) +@msg `picks` must hold 1 to {MAX_PICKS} picks (got {_1}) `picks` debe contener entre 1 y {MAX_PICKS} elecciones (se recibió {_1}) +@msg `radius` must be 0 or more `radius` debe ser 0 o más +@msg `rect` must be [x0, y0, x1, y1] (got {r}) `rect` debe ser [x0, y0, x1, y1] (se recibió {r}) +@msg `replace` must be a string `replace` debe ser una cadena +@msg `rows` must be lists of numbers or nulls, not {r} `rows` deben ser listas de números o valores null, no {r} +@msg `scale` must be a number from 0.001 to 1000 `scale` debe ser un número entre 0.001 y 1000 +@msg `scope.{key}` must be a non-empty array `scope.{key}` debe ser una lista que no esté vacía +@msg `scope` must be "document", {artboards} or {layers} `scope` debe ser "document", {artboards} o {layers} +@msg `side` must be "left", "right", "top" or "bottom" `side` debe ser "left", "right", "top" o "bottom" +@msg `side` places the artboard: leave out x, y, width and height `side` coloca la mesa de trabajo: omite x, y, width y height +@msg `source` is the only path in series group `target` `source` es el único trazado del grupo de serie `target` +@msg `spacing` makes more than {MAX_COUNT} lines across the box `spacing` genera más de {MAX_COUNT} líneas a lo ancho de la caja +@msg `spacing` must be more than 0 and at most {MAX_DISTANCE} pt `spacing` debe ser mayor que 0 y como máximo {MAX_DISTANCE} pt +@msg `target` must be an object of the same Objects on Path group as `member` `target` debe ser un objeto del mismo grupo de Objetos en trazado que `member` +@msg `version` must be 0 or {_1} `version` debe ser 0 o {_1} +@msg `version` must be 0 or {newest} `version` debe ser 0 o {newest} +@msg `weight` must be from 0.01 to 1000 pt `weight` debe estar entre 0.01 y 1000 pt +@msg `weights` must be a list of {_1} numbers, one per row (got {v}) `weights` debe ser una lista de {_1} números, uno por fila (se recibió {v}) +@msg `xml` must be a string `xml` debe ser una cadena +@msg `{KEY}` entry {n} gives the paragraph at byte {start} of {_1} other indents than an entry before it la entrada {n} de `{KEY}` da al párrafo del byte {start} de {_1} otras sangrías que una entrada anterior +@msg `{KEY}` entry {n} must be an object la entrada {n} de `{KEY}` debe ser un objeto +@msg `{KEY}` entry {n} sets neither `leftIndent` nor `firstLineIndent` la entrada {n} de `{KEY}` no establece ni `leftIndent` ni `firstLineIndent` +@msg `{KEY}` entry {n}: `id` must be an object id entrada {n} de `{KEY}`: `id` debe ser un id de objeto +@msg `{KEY}` entry {n}: `start` must be a byte offset entrada {n} de `{KEY}`: `start` debe ser un desplazamiento en bytes +@msg `{KEY}` entry {n}: `{k}` must be a number from -{MAX_PARA} to {MAX_PARA} pt entrada {n} de `{KEY}`: `{k}` debe ser un número entre -{MAX_PARA} y {MAX_PARA} pt +@msg `{KEY}` entry {n}: no paragraph of {_1} starts at byte {start} entrada {n} de `{KEY}`: ningún párrafo de {_1} empieza en el byte {start} +@msg `{KEY}` entry {n}: unknown key `{k}` entrada {n} de `{KEY}`: clave desconocida `{k}` +@msg `{KEY}` entry {n}: {_1} is not a type object entrada {n} de `{KEY}`: {_1} no es un objeto de texto +@msg `{KEY}` is empty `{KEY}` está vacío +@msg `{KEY}` must be a list `{KEY}` debe ser una lista +@msg `{KEY}` takes at most {MAX_PARAGRAPH_INDENTS} entries (got {_1}) `{KEY}` acepta como máximo {MAX_PARAGRAPH_INDENTS} entradas (se recibió {_1}) +@msg `{KEY}` takes no `{other}` beside it `{KEY}` no acepta `{other}` junto a él +@msg `{_1}` can't name a composite font `{_1}` no puede nombrar una fuente compuesta +@msg `{_1}` is the name of an installed font `{_1}` es el nombre de una fuente instalada +@msg `{_1}`: {_2} is set in `{font}`, a composite font `{_1}`: {_2} está compuesto en `{font}`, una fuente compuesta +@msg `{base}` is larger than {_1} MB `{base}` ocupa más de {_1} MB +@msg `{base}` is not in the DCS file's folder `{base}` no está en la carpeta del archivo DCS +@msg `{key}` holds more than {MAX_EDIT_WORDS} words `{key}` contiene más de {MAX_EDIT_WORDS} palabras +@msg `{key}` must be 0 or more `{key}` debe ser 0 o más +@msg `{key}` must be [x, y] numbers `{key}` debe ser [x, y] con números +@msg `{key}` must be a list of words `{key}` debe ser una lista de palabras +@msg `{key}` must be a list, not {v} `{key}` debe ser una lista, no {v} +@msg `{key}` must be a number or null, not {v} `{key}` debe ser un número o null, no {v} +@msg `{key}` must be a whole number of 0 or more `{key}` debe ser un número entero de 0 o más +@msg `{key}` must be from 0 to {MAX_DISTANCE} pt `{key}` debe estar entre 0 y {MAX_DISTANCE} pt +@msg `{key}` must be from {lo} to {hi}, not {v} `{key}` debe estar entre {lo} y {hi}, no {v} +@msg `{key}` must be one of auto, always, never `{key}` debe ser uno de auto, always, never +@msg `{key}` must be one of miter, round, bevel `{key}` debe ser uno de miter, round, bevel +@msg `{key}` must be one word of at most {_1} characters `{key}` debe ser una sola palabra de como máximo {_1} caracteres +@msg `{key}` must hold single words of at most {_1} characters `{key}` debe contener palabras sueltas de como máximo {_1} caracteres +@msg `{key}` must name an object attached to the path of an Objects on Path group `{key}` debe nombrar un objeto unido al trazado de un grupo de Objetos en trazado +@msg `{key}` names an object that is hidden or locked `{key}` nombra un objeto que está oculto o bloqueado +@msg `{name}` is a file of its own, which can only be found next to the DCS file's path `{name}` es un archivo independiente, que solo se puede encontrar junto a la ruta del archivo DCS +@msg `{name}`: give the kanji part `{name}`: indica la parte kanji +@msg `{name}`: parts must be an object `{name}`: las partes deben ser un objeto +@msg `{name}`: unknown class `{k}`; the classes are kanji, kana, punctuation, symbols, roman and numerals `{name}`: clase desconocida `{k}`; las clases son kanji, kana, punctuation, symbols, roman y numerals +@msg `{name}`: unknown key `{k}` in {_1} `{name}`: clave desconocida `{k}` en {_1} +@msg `{name}`: {_1} must be an object `{name}`: {_1} debe ser un objeto +@msg `{name}`: {_1}: {e} `{name}`: {_1}: {e} +@msg `{raw}` can't name a composite font (1 to {COMPOSITE_NAME_MAX} characters, no control characters) `{raw}` no puede nombrar una fuente compuesta (de 1 a {COMPOSITE_NAME_MAX} caracteres, sin caracteres de control) +@msg `{u}` is no Unicode character `{u}` no es un carácter Unicode +@msg `{word}` isn't in the custom dictionary `{word}` no está en el diccionario personalizado +@msg a CMap has too many mappings un CMap tiene demasiadas asignaciones +@msg a \\u escape needs four hexadecimal digits un escape \\u necesita cuatro dígitos hexadecimales +@msg a comma in an XPath expression must separate function arguments una coma en una expresión XPath debe separar argumentos de función +@msg a document holds at most {_1} SVG filters un documento contiene como máximo {_1} filtros SVG +@msg a document keeps at most {COMPOSITE_FONTS_MAX} composite fonts un documento guarda como máximo {COMPOSITE_FONTS_MAX} fuentes compuestas +@msg a document with unsaved changes has no recovery copy un documento con cambios sin guardar no tiene copia de recuperación +@msg a font's data is too large los datos de una fuente son demasiado grandes +@msg a font's subroutines are too large las subrutinas de una fuente son demasiado grandes +@msg a function declaration without a name una declaración de función sin nombre +@msg a host value has too many entries un valor del host tiene demasiadas entradas +@msg a host value is nested too deep un valor del host está anidado a demasiada profundidad +@msg a namespace declaration uses a reserved prefix or URI una declaración de espacio de nombres usa un prefijo o URI reservado +@msg a namespace qualifier is undefined un calificador de espacio de nombres no está definido +@msg a namespace with an empty URI cannot have a prefix un espacio de nombres con un URI vacío no puede tener prefijo +@msg a number has no digits un número no tiene dígitos +@msg a number's exponent has no digits el exponente de un número no tiene dígitos +@msg a number's fraction has no digits la parte fraccionaria de un número no tiene dígitos +@msg a property descriptor cannot have both a value or writable and a get or set un descriptor de propiedad no puede tener a la vez value o writable y get o set +@msg a property descriptor must be an object un descriptor de propiedad debe ser un objeto +@msg a property's {name} must be a function or undefined el {name} de una propiedad debe ser una función o undefined +@msg a stream in it would decode to more than 256 MB, or its decode parameters can't be applied un flujo que contiene se descodificaría en más de 256 MB, o no se pueden aplicar sus parámetros de descodificación +@msg a string holds a control character una cadena contiene un carácter de control +@msg a string holds an escape sequence JSON does not have una cadena contiene una secuencia de escape que JSON no tiene +@msg a string is not closed una cadena no está cerrada +@msg an SVG filter is named by its id: give `xml` with `name` un filtro SVG se nombra por su id: indica `xml` con `name` +@msg an XML element has two attributes with the same name un elemento XML tiene dos atributos con el mismo nombre +@msg an XML value cannot be inserted into itself or its descendants un valor XML no se puede insertar en sí mismo ni en sus descendientes +@msg an XML value's children cannot be assigned by position los hijos de un valor XML no se pueden asignar por posición +@msg an XML value's children cannot be deleted by position los hijos de un valor XML no se pueden eliminar por posición +@msg an XMLList converts to XML only when it has one item un XMLList solo se convierte en XML cuando tiene un elemento +@msg an XPath node test is missing falta una prueba de nodo XPath +@msg an XPath operand is missing falta un operando XPath +@msg an XPath operator is missing falta un operador XPath +@msg an XPath predicate or step cannot follow here aquí no puede seguir un predicado ni un paso XPath +@msg an XPath predicate or step follows a value that is not a node-set un predicado o paso XPath sigue a un valor que no es un conjunto de nodos +@msg an XPath step is missing falta un paso XPath +@msg an image couldn't be decoded and is missing from the picture no se pudo descodificar una imagen y falta en la imagen resultante +@msg an image of {w} × {h} pixels is too large to convert (at most {_1} pixels) una imagen de {w} × {h} píxeles es demasiado grande para convertirla (como máximo {_1} píxeles) +@msg apply was called on a value that is not a function se llamó a apply con un valor que no es una función +@msg area type in a thread cannot use Dynamic Text: {frames} el texto de área en un enlace no puede usar Texto dinámico: {frames} +@msg array literal too long literal de matriz demasiado largo +@msg assignment to a constant binding asignación a un enlace constante +@msg at least one row that isn't excluded needs a weight above 0 al menos una fila que no esté excluida necesita un peso mayor que 0 +@msg blend must be a mode name blend debe ser el nombre de un modo +@msg both sides of an XPath | must select nodes ambos lados de un | de XPath deben seleccionar nodos +@msg canceled cancelado +@msg cannot convert the object to a primitive value no se puede convertir el objeto en un valor primitivo +@msg cannot convert undefined or null to an object no se puede convertir undefined o null en un objeto +@msg character dimensions cannot be represented with the source text transform las dimensiones de los caracteres no se pueden representar con la transformación del texto de origen +@msg character dimensions cannot be represented with the target text transform las dimensiones de los caracteres no se pueden representar con la transformación del texto de destino +@msg continuation must be an array of path chunks continuation debe ser una lista de fragmentos de trazado +@msg continuation requires points continuation requiere points +@msg dataBase64 is not base64 dataBase64 no está en base64 +@msg each font must be {name, parts} cada fuente debe ser {name, parts} +@msg each font needs a name cada fuente necesita un nombre +@msg each path chunk must contain 1 to 4096 points cada fragmento de trazado debe contener entre 1 y 4096 puntos +@msg each pick is {{at: [x, y]}} or {{rect: [x0, y0, x1, y1]}} (got {v}) cada elección es {{at: [x, y]}} o {{rect: [x0, y0, x1, y1]}} (se recibió {v}) +@msg each weight must be a number of 0 or more (got {v}) cada peso debe ser un número de 0 o más (se recibió {v}) +@msg finally table {t} out of range tabla finally {t} fuera de rango +@msg flags cannot be given with a RegExp object no se pueden indicar indicadores con un objeto RegExp +@msg fonts must be a list of composite fonts fonts debe ser una lista de fuentes compuestas +@msg function declaration index out of range índice de declaración de función fuera de rango +@msg give `char`, `text`, `code` or `unicode` indica `char`, `text`, `code` o `unicode` +@msg give `count` or `spacing`, not both indica `count` o `spacing`, no ambos +@msg give `name`, an SVG filter's name indica `name`, el nombre de un filtro SVG +@msg give `path`, an SVG file, or `svg`, SVG text indica `path`, un archivo SVG, o `svg`, texto SVG +@msg give `xml`, one SVG element indica `xml`, un elemento SVG +@msg give exactly one of `path`, `data` and `dataBase64` indica exactamente uno de `path`, `data` y `dataBase64` +@msg give fonts: [{name, parts}…] indica fonts: [{name, parts}…] +@msg give index or indexes, not both indica index o indexes, no ambos +@msg give one element indica un elemento +@msg give one of path, data or dataBase64 indica uno de path, data o dataBase64 +@msg give opacity or blend indica opacity o blend +@msg handler at {_1} expects {_2} values but its range starts with {d} el controlador en {_1} espera {_2} valores, pero su rango empieza con {d} +@msg handler depth too large profundidad de controlador demasiado grande +@msg handler range {_1}..{_2} out of range rango de controlador {_1}..{_2} fuera de rango +@msg hiddenLayers must be true or false hiddenLayers debe ser true o false +@msg hvcC hvcC +@msg images in a spot ink whose samples couldn't be read were imported in RGB las imágenes en una tinta plana cuyas muestras no se pudieron leer se importaron en RGB +@msg images past the most pixels one file may hold were left out se omitieron las imágenes que superaban el máximo de píxeles que puede contener un archivo +@msg images too large to read were left out se omitieron las imágenes demasiado grandes para leerlas +@msg indexes may hold at most {MAX_GUIDE_INDEXES} entries indexes puede contener como máximo {MAX_GUIDE_INDEXES} entradas +@msg indexes must be an array of guide indexes indexes debe ser una lista de índices de guías +@msg instruction out of range instrucción fuera de rango +@msg instruction {pc} ({op}) pops below the stack la instrucción {pc} ({op}) extrae por debajo de la pila +@msg instruction {pc} reached with stack depths {seen} and {d} se llegó a la instrucción {pc} con profundidades de pila {seen} y {d} +@msg invalid array length longitud de matriz no válida +@msg invalid group grupo no válido +@msg invalid object id {v}: expected a non-negative integer id de objeto no válido {v}: se esperaba un entero no negativo +@msg invalid regular expression flag '{_1}' indicador de expresión regular no válido '{_1}' +@msg invalid regular expression: {m} expresión regular no válida: {m} +@msg invalid time value valor de tiempo no válido +@msg is a confirm's answer, whose `value` must be true or false es la respuesta de un confirm, cuyo `value` debe ser true o false +@msg is a prompt's answer, whose `value` must be a string or null es la respuesta de un prompt, cuyo `value` debe ser una cadena o null +@msg is an alert's answer, whose `value` must be "ok" es la respuesta de un alert, cuyo `value` debe ser "ok" +@msg is longer than 16 KiB ocupa más de 16 KiB +@msg it draws its image through a clipping path dibuja su imagen a través de un trazado de recorte +@msg it draws no image no dibuja ninguna imagen +@msg it is larger than {MAX_DICTIONARY_FILE_BYTES} bytes ocupa más de {MAX_DICTIONARY_FILE_BYTES} bytes +@msg it isn't a file no es un archivo +@msg it names {_1} plates, and at most {MAX_PLATES} are read nombra {_1} planchas, y se leen como máximo {MAX_PLATES} +@msg its art is too long or too detailed for a head su ilustración es demasiado larga o detallada para una cabeza +@msg its art paints nothing su ilustración no pinta nada +@msg its image is too large to read su imagen es demasiado grande para leerla +@msg its plates are too large: more than {MAX_SAMPLES} pixels together sus planchas son demasiado grandes: más de {MAX_SAMPLES} píxeles en total +@msg its plates are too large: {_1} plates of {w} × {h} pixels sus planchas son demasiado grandes: {_1} planchas de {w} × {h} píxeles +@msg its plates can't be kept together sus planchas no se pueden mantener juntas +@msg its shapes could not be combined into one sus formas no se pudieron combinar en una +@msg jump to {pc}, past the end salto a {pc}, más allá del final +@msg legacyNameEncoding must be one of {_1} legacyNameEncoding debe ser uno de {_1} +@msg localize: the first argument must be a localization object or a string localize: el primer argumento debe ser un objeto de localización o una cadena +@msg missing `picks` falta `picks` +@msg missing `word` falta `word` +@msg must be an object with `kind` and `value` debe ser un objeto con `kind` y `value` +@msg must have `kind` alert, confirm or prompt debe tener `kind` alert, confirm o prompt +@msg must have exactly `kind` and `value` debe tener exactamente `kind` y `value` +@msg names must be a list of names names debe ser una lista de nombres +@msg names must be strings names deben ser cadenas +@msg needs a closing quote after the name necesita unas comillas de cierre después del nombre +@msg needs a name necesita un nombre +@msg needs a name of at most 64 bytes necesita un nombre de como máximo 64 bytes +@msg needs a name of letters, digits and _, or a quoted name necesita un nombre de letras, dígitos y _, o un nombre entre comillas +@msg needs a name without control characters necesita un nombre sin caracteres de control +@msg nesting too deep anidamiento demasiado profundo +@msg no HP-GL format no tiene formato HP-GL +@msg no New Document profile called `{shown}` ({_1}) no hay ningún perfil de Nuevo documento llamado `{shown}` ({_1}) +@msg no SVG filter at index {k} no hay ningún filtro SVG en el índice {k} +@msg no arrowheads file here aquí no hay ningún archivo de puntas de flecha +@msg no character has code {code} ningún carácter tiene el código {code} +@msg no composite font no hay ninguna fuente compuesta +@msg no composite font named `{n}` no hay ninguna fuente compuesta llamada `{n}` +@msg no composite fonts to export no hay fuentes compuestas que exportar +@msg no custom arrowhead {name} (see stroke.arrowheads.list) no existe la punta de flecha personalizada {name} (consulta stroke.arrowheads.list) +@msg no file to open no hay ningún archivo que abrir +@msg no instructions sin instrucciones +@msg no layer to rename no hay ninguna capa que cambiar de nombre +@msg no random numbers ({e}) no hay números aleatorios ({e}) +@msg no selected or given object has a visible 3D effect ningún objeto seleccionado o indicado tiene un efecto 3D visible +@msg no such artboard {v} no existe la mesa de trabajo {v} +@msg no symbol named `{_1}` no hay ningún símbolo llamado `{_1}` +@msg node {_1} already has the text variable `{_2}` el nodo {_1} ya tiene la variable de texto `{_2}` +@msg not a DCS file no es un archivo DCS +@msg not a RegExp object no es un objeto RegExp +@msg not a composite fonts file: no compositeFonts list no es un archivo de fuentes compuestas: no hay lista compositeFonts +@msg not a composite fonts file: {e} no es un archivo de fuentes compuestas: {e} +@msg not a regular expression no es una expresión regular +@msg not an action set: the text doesn't start with /version and a number no es un conjunto de acciones: el texto no empieza con /version y un número +@msg nothing to repeat nada que repetir +@msg numbers out of order in {_1} quantifier números desordenados en el cuantificador {_1} +@msg object {_1} needs a 3D effect el objeto {_1} necesita un efecto 3D +@msg object {_1}: a hollow Extrude & Bevel has no caps: turn on Cap to map a graphic objeto {_1}: una Extrusión y biselado hueca no tiene extremos: activa Extremo para asignar un gráfico +@msg object {_1}: with a depth of 0 the object has one face: map its graphics onto the front objeto {_1}: con una profundidad de 0 el objeto tiene una sola cara: asigna sus gráficos a la parte frontal +@msg object {_1}: {_2} objeto {_1}: {_2} +@msg object {_1}: {e} objeto {_1}: {e} +@msg object {_1}: {name} at index {index} has no lighting presets; set its lights with effect.setParams objeto {_1}: {name} en el índice {index} no tiene preajustes de iluminación; define sus luces con effect.setParams +@msg opacity must be a number opacity debe ser un número +@msg operand too large operando demasiado grande +@msg order is a whole number from 0 to {others}, not `{v}` order es un número entero entre 0 y {others}, no `{v}` +@msg path chunks must share their boundary point los fragmentos de trazado deben compartir su punto límite +@msg path is empty el trazado está vacío +@msg pdfCompatible: false needs the artboards to keep the editable artwork when useArtboards is false pdfCompatible: false necesita que las mesas de trabajo conserven la ilustración editable cuando useArtboards es false +@msg point x must be a number el punto x debe ser un número +@msg point y must be a number el punto y debe ser un número +@msg points must be [x,y] pairs points deben ser pares [x,y] +@msg points must be finite canvas points points deben ser puntos finitos del lienzo +@msg range out of order in character class rango desordenado en la clase de caracteres +@msg reduce of an empty array with no initial value reduce de una matriz vacía sin valor inicial +@msg regular expression flag '{_1}' given twice indicador de expresión regular '{_1}' indicado dos veces +@msg sampled text would exceed the canvas (coordinates out of range) el texto muestreado superaría el lienzo (coordenadas fuera de rango) +@msg select an SVG filter selecciona un filtro SVG +@msg select an object with a 3D effect selecciona un objeto con un efecto 3D +@msg select an object with a 3D effect, or give its id in ids selecciona un objeto con un efecto 3D o indica su id en ids +@msg select one layer, group or object to rename selecciona una capa, un grupo o un objeto para cambiarle el nombre +@msg select the art to weed selecciona la ilustración que quieres pelar +@msg select type on a path or area type selecciona texto en trazado o texto de área +@msg side is left or right, not `{v}` side es left o right, no `{v}` +@msg source text transform is collapsed or unrepresentable la transformación del texto de origen está colapsada o no se puede representar +@msg table must be true or false table debe ser true o false +@msg takes one name acepta un nombre +@msg target text transform is collapsed or unrepresentable la transformación del texto de destino está colapsada o no se puede representar +@msg that makes too many pieces (at most 100000) or dash steps: simplify the dash pattern or make the dashes longer eso genera demasiadas piezas (como máximo 100000) o pasos de guion: simplifica el patrón de guiones o alarga los guiones +@msg the Layers panel is not shown el panel Capas no se muestra +@msg the Layers panel's search, filter or Show Layers Only hides its row la búsqueda, el filtro o Mostrar solo capas del panel Capas ocultan su fila +@msg the Objects on Path group is hidden or locked el grupo de Objetos en trazado está oculto o bloqueado +@msg the SVG file is larger than {MAX_IMPORT_BYTES} bytes el archivo SVG ocupa más de {MAX_IMPORT_BYTES} bytes +@msg the XML operation needs an XML or XMLList value la operación XML necesita un valor XML o XMLList +@msg the XPath expression does not evaluate to a node-set la expresión XPath no se evalúa como un conjunto de nodos +@msg the XPath expression ends early la expresión XPath termina antes de tiempo +@msg the XPath expression has an unmatched ) la expresión XPath tiene un ) sin pareja +@msg the XPath expression has an unmatched ] la expresión XPath tiene un ] sin pareja +@msg the XPath expression has an unmatched closing bracket la expresión XPath tiene un corchete de cierre sin pareja +@msg the XPath expression selects a namespace node, which is not an XML value la expresión XPath selecciona un nodo de espacio de nombres, que no es un valor XML +@msg the XPath expression selects the root node, which is not an XML value la expresión XPath selecciona el nodo raíz, que no es un valor XML +@msg the XPath function {name} needs a node-set la función XPath {name} necesita un conjunto de nodos +@msg the XPath function {name} takes the wrong number of arguments la función XPath {name} recibe un número incorrecto de argumentos +@msg the XPath name functions need a node-set las funciones de nombre de XPath necesitan un conjunto de nodos +@msg the XPath prefix {shown} is not bound to a namespace el prefijo XPath {shown} no está vinculado a un espacio de nombres +@msg the XPath variable ${shown} is not bound la variable XPath ${shown} no está vinculada +@msg the argument list is not an object la lista de argumentos no es un objeto +@msg the artwork is too large for EPS: what follows 256 MB of PostScript was left out la ilustración es demasiado grande para EPS: se omitió lo que sigue a 256 MB de PostScript +@msg the bitmaps hold more pixels than one file may los mapas de bits contienen más píxeles de los que puede tener un archivo +@msg the code runs past its last instruction el código continúa más allá de su última instrucción +@msg the curve tolerance must be from 0.01 to 10 points la tolerancia de curva debe estar entre 0.01 y 10 puntos +@msg the custom dictionary couldn't be saved to {_1}: {e} no se pudo guardar el diccionario personalizado en {_1}: {e} +@msg the custom dictionary {_1} can't be read ({why}), so it is left as it is no se puede leer el diccionario personalizado {_1} ({why}), así que se deja como está +@msg the document already has an SVG filter named {name} el documento ya tiene un filtro SVG llamado {name} +@msg the document has another SVG filter named {name}: use svgFilter.apply, or svgFilter.define with `replace` to edit it el documento tiene otro filtro SVG llamado {name}: usa svgFilter.apply, o svgFilter.define con `replace` para editarlo +@msg the document has no SVG filter named {name} el documento no tiene ningún filtro SVG llamado {name} +@msg the document has no SVG filter named {r} el documento no tiene ningún filtro SVG llamado {r} +@msg the document has no color swatches el documento no tiene muestras de color +@msg the document's swatches hold {_1} colors; the document reduction takes at most 255 las muestras del documento contienen {_1} colores; la reducción del documento acepta como máximo 255 +@msg the file holds more than {COMPOSITE_FONTS_MAX} composite fonts el archivo contiene más de {COMPOSITE_FONTS_MAX} fuentes compuestas +@msg the file holds no composite fonts el archivo no contiene fuentes compuestas +@msg the file holds two composite fonts named `{_1}` el archivo contiene dos fuentes compuestas llamadas `{_1}` +@msg the file is larger than 4 MB el archivo ocupa más de 4 MB +@msg the file isn't valid SVG: {e} el archivo no es un SVG válido: {e} +@msg the file names no plate el archivo no nombra ninguna plancha +@msg the function's prototype is not an object el prototipo de la función no es un objeto +@msg the guide is hidden or locked la guía está oculta o bloqueada +@msg the library's file is outside the read roots el archivo de la biblioteca está fuera de las raíces de lectura +@msg the method needs an XML value el método necesita un valor XML +@msg the paint is not a freeform gradient (apply one with paint.editGradient {kind}) la pintura no es un degradado de forma libre (aplica uno con paint.editGradient {kind}) +@msg the parameters or body do not form one function los parámetros o el cuerpo no forman una sola función +@msg the pasted SVG filter {name} draws differently from the document's filter of that name, and no free name fits it el filtro SVG pegado {name} dibuja de forma distinta al filtro del documento con ese nombre, y no hay ningún nombre libre para él +@msg the pen table holds more than 255 pens la tabla de plumillas contiene más de 255 plumillas +@msg the plates can't be kept no se pueden conservar las planchas +@msg the position table does not match the instructions la tabla de posiciones no coincide con las instrucciones +@msg the prompt's text is longer than {MAX_PROMPT_BYTES} bytes el texto del prompt ocupa más de {MAX_PROMPT_BYTES} bytes +@msg the radix must be between 2 and 36 la base debe estar entre 2 y 36 +@msg the right side of 'in' is not an object el lado derecho de 'in' no es un objeto +@msg the right side of 'instanceof' is not a function el lado derecho de 'instanceof' no es una función +@msg the selected art is nested more than {MAX_DEPTH} levels deep la ilustración seleccionada está anidada a más de {MAX_DEPTH} niveles de profundidad +@msg the selected art is too large to measure la ilustración seleccionada es demasiado grande para medirla +@msg the selection has no outlines to weed around la selección no tiene contornos alrededor de los que pelar +@msg the value bind was called on is not a function el valor con el que se llamó a bind no es una función +@msg the value is not a constructor el valor no es un constructor +@msg the value is not a function el valor no es una función +@msg the value is not a valid XML name el valor no es un nombre XML válido +@msg the value is not an XML attribute name el valor no es un nombre de atributo XML +@msg the value is not an XML name el valor no es un nombre XML +@msg the weeding lines cross the art's outlines too many times to measure; use fewer lines las líneas de pelado cruzan los contornos de la ilustración demasiadas veces para medirlas; usa menos líneas +@msg the weeding lines pass too close to too many outline segments to measure; use fewer lines or a smaller gap las líneas de pelado pasan demasiado cerca de demasiados segmentos de contorno para medirlas; usa menos líneas o un hueco más pequeño +@msg the weeding lines would be more than {max_pieces} pieces las líneas de pelado tendrían más de {max_pieces} piezas +@msg the {_1} plate lies outside the file la plancha {_1} está fuera del archivo +@msg this is a binary DXF file, which can't be read: save it from the CAD app as an ASCII DXF and open that este es un archivo DXF binario, que no se puede leer: guárdalo desde la aplicación CAD como DXF ASCII y abre ese +@msg this warp's points can't be edited: use Reset with Mesh first los puntos de esta deformación no se pueden editar: usa antes Restablecer con malla +@msg toExponential() digits must be between 0 and 20 los dígitos de toExponential() deben estar entre 0 y 20 +@msg toFixed() digits must be between 0 and 20 los dígitos de toFixed() deben estar entre 0 y 20 +@msg toISOString is not a function toISOString no es una función +@msg toPrecision() argument must be between 1 and 21 el argumento de toPrecision() debe estar entre 1 y 21 +@msg toSource: a getter cannot be written as source toSource: un getter no se puede escribir como código fuente +@msg toSource: an array with properties besides its elements, a property that is not enumerable or another prototype cannot be written as source toSource: una matriz con propiedades además de sus elementos, una propiedad que no es enumerable u otro prototipo no se puede escribir como código fuente +@msg toSource: an object with a property that is not enumerable, or whose prototype is not Object.prototype, cannot be written as source toSource: un objeto con una propiedad que no es enumerable, o cuyo prototipo no es Object.prototype, no se puede escribir como código fuente +@msg toSource: the source is too long toSource: el código fuente es demasiado largo +@msg toSource: the value contains itself toSource: el valor se contiene a sí mismo +@msg toSource: the value has too many entries toSource: el valor tiene demasiadas entradas +@msg toSource: the value is nested too deep toSource: el valor está anidado a demasiada profundidad +@msg toString is not a function toString no es una función +@msg too many arguments demasiados argumentos +@msg too many quantifiers demasiados cuantificadores +@msg two composite fonts are named `{_1}` dos fuentes compuestas se llaman `{_1}` +@msg unknown OpenType feature `{t}` (liga, calt, dlig, smcp, frac, onum, tnum, ordn, swsh, ss01–ss20, salt, titl, pnum, lnum, sups, subs, numr, dnom, aalt; prefix - to turn off; swsh, ss01–ss20, salt, titl, pnum, lnum, sups, subs, numr, dnom and aalt take an alternate's number as `tag=N` with N from 0 to {_1}, as `salt=2`) función OpenType desconocida `{t}` (liga, calt, dlig, smcp, frac, onum, tnum, ordn, swsh, ss01–ss20, salt, titl, pnum, lnum, sups, subs, numr, dnom, aalt; antepón - para desactivarla; swsh, ss01–ss20, salt, titl, pnum, lnum, sups, subs, numr, dnom y aalt aceptan el número de una alternativa como `tag=N` con N entre 0 y {_1}, como `salt=2`) +@msg unknown dither `{d}` (diffusion, pattern, noise or none) tramado desconocido `{d}` (diffusion, pattern, noise o none) +@msg unknown key `{k}`; a font takes name and parts clave desconocida `{k}`; una fuente acepta name y parts +@msg unknown panel `{panel}` panel desconocido `{panel}` +@msg unknown parameter `{key}` parámetro desconocido `{key}` +@msg unknown parameter `{within}settings.{format}`; {why} parámetro desconocido `{within}settings.{format}`; {why} +@msg unknown reduction `{reduction}` (selective, perceptual, adaptive, web, gray, blackWhite, uniform or document) reducción desconocida `{reduction}` (selective, perceptual, adaptive, web, gray, blackWhite, uniform o document) +@msg unmatched ')' ')' sin pareja +@msg unterminated character class clase de caracteres sin terminar +@msg unterminated group grupo sin terminar +@msg wordGap and lineGap need area type in the selection wordGap y lineGap necesitan texto de área en la selección +@msg xpath needs its variables as an object xpath necesita sus variables como un objeto +@msg xpath needs the expression as a string xpath necesita la expresión como una cadena +@msg {GRANT_NOT_REMOVED}, and its settings and cache can't be moved back from {_1} to {_2}: {e} {GRANT_NOT_REMOVED}, y sus ajustes y su caché no se pueden devolver de {_1} a {_2}: {e} +@msg {_1} is not a folder: {e} {_1} no es una carpeta: {e} +@msg {_1}: {_2} and {_3} are in the way {_1}: {_2} y {_3} estorban +@msg {code}: {0} {code}: {0} +@msg {dir}: {e} {dir}: {e} +@msg {file} names more than one linked JavaScript file {file} nombra más de un archivo JavaScript vinculado +@msg {k}: a custom arrowhead's path needs an area to fill and at most {most} anchors and {most} subpaths, each anchor within {far} head units of its tip {k}: el trazado de una punta de flecha personalizada necesita un área que rellenar y como máximo {most} puntos de ancla y {most} subtrazados, cada punto de ancla a no más de {far} unidades de cabeza de su punta +@msg {k}: bad custom arrowhead path: {e} {k}: trazado de punta de flecha personalizada incorrecto: {e} +@msg {k}: bad custom arrowhead: {e} {k}: punta de flecha personalizada incorrecta: {e} +@msg {k}: baseline must be {_1} to {_2}% {k}: baseline debe estar entre {_1} y {_2}% +@msg {k}: custom must be a name {k}: custom debe ser un nombre +@msg {k}: give a font {k}: indica una fuente +@msg {k}: only kana can be scaled at the center {k}: solo el kana se puede escalar desde el centro +@msg {k}: only kana, roman and numerals can be scaled {k}: solo se pueden escalar kana, roman y numerals +@msg {k}: scale must be {_1} to {_2}% {k}: scale debe estar entre {_1} y {_2}% +@msg {k}: size must be {_1} to {_2}% {k}: size debe estar entre {_1} y {_2}% +@msg {path}: copy takes a DCS file only when its plates are inside it; relink to it where its plate files are {path}: copy solo acepta un archivo DCS cuando sus planchas están dentro de él; vuelve a vincularlo donde estén sus archivos de planchas +@msg {path}: larger than {_1} MB {path}: ocupa más de {_1} MB +@msg {shown} is not an XPath 1.0 function {shown} no es una función de XPath 1.0 +@msg {v} names no layer or sublayer {v} no nombra ninguna capa ni subcapa +@msg {what} is not a function {what} no es una función +@msg {what} would print more than {MAX_COPIES_PER_SHEET} copies on a sheet: scale it up {what} imprimiría más de {MAX_COPIES_PER_SHEET} copias en una hoja: amplíalo +@msg {what} {i} out of range {what} {i} fuera de rango +@msg A profile supports one Revolve effect. Edit the existing effect's options instead. Un perfil admite un solo efecto Revolución. Edita en su lugar las opciones del efecto existente. +@msg Add Points at Crossings: a path went missing Agregar puntos en los cruces: falta un trazado +@msg CSS options: {e} Opciones de CSS: {e} +@msg CSV has a header but no data rows El CSV tiene encabezado pero ninguna fila de datos +@msg CSV holds NUL bytes: save it as UTF-8, or as UTF-16 with a byte-order mark El CSV contiene bytes NUL: guárdalo como UTF-8, o como UTF-16 con marca de orden de bytes +@msg CSV is empty El CSV está vacío +@msg CSV is larger than {MAX_CSV_BYTES} bytes El CSV ocupa más de {MAX_CSV_BYTES} bytes +@msg CSV is not UTF-16 El CSV no está en UTF-16 +@msg CSV is not UTF-8 El CSV no está en UTF-8 +@msg CSV would be larger than {MAX_CSV_BYTES} bytes El CSV ocuparía más de {MAX_CSV_BYTES} bytes +@msg Choose original artwork, not a dimension's generated paths Elige la ilustración original, no los trazados generados de una cota +@msg Contour: select paths or shapes Contorno: selecciona trazados o formas +@msg Contour: the Offset Path effect is not available Contorno: el efecto Desplazar trazado no está disponible +@msg Create needs fills, strokes or both Crear necesita rellenos, trazos o ambos +@msg DXF options: {e} Opciones de DXF: {e} +@msg DXF scale must be a positive number up to {_1}, not {scale} La escala de DXF debe ser un número positivo de hasta {_1}, no {scale} +@msg DXF {field} `{s}`: {allowed} DXF {field} `{s}`: {allowed} +@msg Dimension is locked or hidden La cota está bloqueada u oculta +@msg Dimension mode does not match its source El modo de la cota no coincide con su origen +@msg Draw Inside needs exactly one selected path, compound path or text Dibujar dentro necesita exactamente un trazado, trazado compuesto o texto seleccionado +@msg EPS Save writes all artwork: use document.export for selected-only EPS Guardar EPS escribe toda la ilustración: usa document.export para un EPS solo con lo seleccionado +@msg EPS flattener: {e} Acoplador de EPS: {e} +@msg EPS options: {e} Opciones de EPS: {e} +@msg EPS {field} `{s}`: {allowed} EPS {field} `{s}`: {allowed} +@msg Export for Screens writes png, png8, jpg, webp, gif, tiff, bmp, tga, psd, svg, svgz, pdf, eps, ai or vectorcraft Exportar para pantallas escribe png, png8, jpg, webp, gif, tiff, bmp, tga, psd, svg, svgz, pdf, eps, ai o vectorcraft +@msg Flare click coordinates must be finite numbers Las coordenadas del clic de destello deben ser números finitos +@msg HTML Text applies to object slices of type only Texto HTML solo se aplica a sectores de objeto de texto +@msg Identify Objects By is XML ID: the name must be a valid XML ID (start with a letter, underscore or colon; no spaces) Identificar objetos por está en ID de XML: el nombre debe ser un ID de XML válido (empieza con una letra, un guion bajo o dos puntos; sin espacios) +@msg Image Trace failed: internal error: its thread stopped (please report this bug) Error de Calco de imagen: error interno: su hilo se detuvo (informa de este error) +@msg Image Trace failed: {e} Error de Calco de imagen: {e} +@msg Image Trace finished, but its document was closed Calco de imagen terminó, pero su documento se cerró +@msg Image Trace finished, but the image or its settings changed meanwhile: trace it again Calco de imagen terminó, pero la imagen o sus ajustes cambiaron mientras tanto: cálcala de nuevo +@msg Invalid dimension offset Desplazamiento de cota no válido +@msg Invalid point Punto no válido +@msg Join: a subpath went missing Unir: falta un subtrazado +@msg Lock Workspace is not available in VectorCraft Bloquear espacio de trabajo no está disponible en VectorCraft +@msg Move Panel to New Window is not available: floating panels stay in the main window Mover panel a una ventana nueva no está disponible: los paneles flotantes permanecen en la ventana principal +@msg Offset Path: the path is too complex to offset Desplazar trazado: el trazado es demasiado complejo para desplazarlo +@msg Offset Path: {e} Desplazar trazado: {e} +@msg PDF content is incomplete or exceeds the reader's limits; no document was imported El contenido del PDF está incompleto o supera los límites del lector; no se importó ningún documento +@msg PDF flattener: {e} Acoplador de PDF: {e} +@msg PDF options: {e} Opciones de PDF: {e} +@msg Recolor Artwork is no longer open Volver a colorear ilustración ya no está abierto +@msg SVG is not UTF-8, UTF-16 or ISO 8859-1 El SVG no está en UTF-8, UTF-16 ni ISO 8859-1 +@msg Save writes one artboard: name one, or export several with document.export Guardar escribe una sola mesa de trabajo: nombra una o exporta varias con document.export +@msg Select a dimension first Selecciona primero una cota +@msg Select dimensions to update Selecciona las cotas que quieres actualizar +@msg Select only dimensions Selecciona solo cotas +@msg Select two or more objects, or a group Selecciona dos o más objetos, o un grupo +@msg Shaper needs 1–64 source paths Shaper necesita de 1 a 64 trazados de origen +@msg Switch x/y is for scatter graphs Cambiar x/y es para gráficos de dispersión +@msg Text options: {e} Opciones de texto: {e} +@msg `align` is start, center or end `align` es start, center o end +@msg `anchors` must be an array of [subpath, anchor] pairs `anchors` debe ser una lista de pares [subpath, anchor] +@msg `anchors` must list anchor indices (0, 1, 2…), not {k} `anchors` debe enumerar índices de puntos de ancla (0, 1, 2…), no {k} +@msg `anchors` must list anchor indices (0, 1, 2…), not {v} `anchors` debe enumerar índices de puntos de ancla (0, 1, 2…), no {v} +@msg `artboards` must be a list of artboard indices `artboards` debe ser una lista de índices de mesas de trabajo +@msg `asset` is the asset id (see assets.list) `asset` es el id del recurso (consulta assets.list) +@msg `at` must be a byte offset `at` debe ser un desplazamiento en bytes +@msg `autoLeading` must be a number `autoLeading` debe ser un número +@msg `background` must be "", "matte" or #rrggbb `background` debe ser "", "matte" o #rrggbb +@msg `burasagari` must be "none", "standard" or "forced" `burasagari` debe ser "none", "standard" o "forced" +@msg `center` must be [x, y] `center` debe ser [x, y] +@msg `charAlign` must be "romanBaseline", "emBoxTop", "emBoxCenter", "emBoxBottom", "icfTop" or "icfBottom" `charAlign` debe ser "romanBaseline", "emBoxTop", "emBoxCenter", "emBoxBottom", "icfTop" o "icfBottom" +@msg `charDirection` must be "default", "leftToRight" or "rightToLeft" `charDirection` debe ser "default", "leftToRight" o "rightToLeft" +@msg `clearStroke` requires `stroke: false`, `ids: []` and no `stop` `clearStroke` requiere `stroke: false`, `ids: []` y ningún `stop` +@msg `clear` must be a list of type object ids, not {v} `clear` debe ser una lista de ids de objetos de texto, no {v} +@msg `clear` must list type objects; {_1} is not one `clear` debe enumerar objetos de texto; {_1} no lo es +@msg `clear` must not list `id` `clear` no debe enumerar `id` +@msg `color` needs a `rule` to make the theme from `color` necesita una `rule` a partir de la que crear el tema +@msg `colors` is empty `colors` está vacío +@msg `columnType` is vertical, uniform, repeating or sliding `columnType` es vertical, uniform, repeating o sliding +@msg `columns` must be a whole number 1..50 `columns` debe ser un número entero 1..50 +@msg `commands` must not be empty `commands` no debe estar vacío +@msg `contents` goes with `to` `contents` va con `to` +@msg `corners` must be sharp, round or square, not `{other}` `corners` debe ser sharp, round o square, no `{other}` +@msg `corners` must list anchor indices (0, 1, 2…), not {v} `corners` debe enumerar índices de puntos de ancla (0, 1, 2…), no {v} +@msg `count` must be a whole number from 1 to 100 `count` debe ser un número entero entre 1 y 100 +@msg `dataBase64` is larger than the module limit `dataBase64` supera el límite de módulos +@msg `dataBase64` is not valid base64 `dataBase64` no es base64 válido +@msg `defaultsOnly` cannot be combined with `ids`, `reverse` or `append` `defaultsOnly` no se puede combinar con `ids`, `reverse` ni `append` +@msg `depth` and `childLimit` slice the summary: pass `summary: true` `depth` y `childLimit` recortan el resumen: pasa `summary: true` +@msg `design` is a design name, or null for plain columns `design` es el nombre de un diseño, o null para columnas simples +@msg `design` is a design name, or null for the default marker `design` es el nombre de un diseño, o null para el marcador predeterminado +@msg `destinationFolder` is required when destination is `folder` `destinationFolder` es obligatorio cuando el destino es `folder` +@msg `destination` must be `none`, `saveAndClose` or `folder` `destination` debe ser `none`, `saveAndClose` o `folder` +@msg `diameter` must be from 0.1 to 2500 pt `diameter` debe estar entre 0.1 y 2500 pt +@msg `digits` must be one of {_1} `digits` debe ser uno de {_1} +@msg `dimImages` is a percentage or false `dimImages` es un porcentaje o false +@msg `direction` must be "auto", "leftToRight" or "rightToLeft" `direction` debe ser "auto", "leftToRight" o "rightToLeft" +@msg `each` is the value one design stands for, more than 0 `each` es el valor que representa un diseño, mayor que 0 +@msg `end` must be "start" or "end" `end` debe ser "start" o "end" +@msg `ends` applies to joining exactly two paths `ends` se aplica al unir exactamente dos trazados +@msg `event` must be one of {_1} `event` debe ser uno de {_1} +@msg `every` must be "all", "odd" or "even", not {v} `every` debe ser "all", "odd" o "even", no {v} +@msg `expand` must be true or false `expand` debe ser true o false +@msg `files` must be 1 to 1000 paths of font files the last text.findFontFiles search found `files` debe ser de 1 a 1000 rutas de archivos de fuentes que encontró la última búsqueda de text.findFontFiles +@msg `folder` must be an absolute folder path `folder` debe ser una ruta de carpeta absoluta +@msg `fontAxes` must be an object of axis tags and values, such as {"wght"} `fontAxes` debe ser un objeto de etiquetas de eje y valores, como {"wght"} +@msg `format` must be a string `format` debe ser una cadena +@msg `format` must be one of {_1} `format` debe ser uno de {_1} +@msg `fractions` is chop or scale `fractions` es chop o scale +@msg `from` and `to` must differ `from` y `to` deben ser distintos +@msg `from` has an empty frame `from` tiene un marco vacío +@msg `from` must be a non-negative integer `from` debe ser un entero no negativo +@msg `from` must be area type or type on a path `from` debe ser texto de área o texto en trazado +@msg `gid` must be a glyph id, not {v} `gid` debe ser un id de glifo, no {v} +@msg `glyphAlternate` belongs to one character, not to a character style (text.setGlyphAlternate sets it) `glyphAlternate` corresponde a un solo carácter, no a un estilo de carácter (lo establece text.setGlyphAlternate) +@msg `guide` must be a guide index (guide.list) `guide` debe ser un índice de guía (guide.list) +@msg `hAlign` must be default, left, center or right `hAlign` debe ser default, left, center o right +@msg `id` must be a node id `id` debe ser un id de nodo +@msg `id` must be an object id, not {v} `id` debe ser un id de objeto, no {v} +@msg `ids` must name Objects on Path groups or objects in them `ids` debe nombrar grupos de Objetos en trazado u objetos que contengan +@msg `ids` takes at most {MAX_INSPECT_IDS} ids `ids` acepta como máximo {MAX_INSPECT_IDS} ids +@msg `imageMap` must be none, rectangle or polygon `imageMap` debe ser none, rectangle o polygon +@msg `includeArtboardFill` must be true or false `includeArtboardFill` debe ser true o false +@msg `includeSubdirs` must be true or false `includeSubdirs` debe ser true o false +@msg `index` must be a point index `index` debe ser un índice de punto +@msg `index` must be a whole number or null `index` debe ser un número entero o null +@msg `indices` must be a non-empty array of item indices `indices` debe ser una lista no vacía de índices de elementos +@msg `items` is a list of {kind, item} `items` es una lista de {kind, item} +@msg `items` is empty `items` está vacío +@msg `items` must be a list of {id, points} `items` debe ser una lista de {id, points} +@msg `items` must be a list of {{id, anchors?}}, not {v} `items` debe ser una lista de {{id, anchors?}}, no {v} +@msg `items` must be an array of {id, anchors} `items` debe ser una lista de {id, anchors} +@msg `items` must be an array of {{id, corners?}}, not {v} `items` debe ser una lista de {{id, corners?}}, no {v} +@msg `kashida` must be "none", "short", "medium", "long" or "stylistic" `kashida` debe ser "none", "short", "medium", "long" o "stylistic" +@msg `kind` is one of {_1} `kind` es uno de {_1} +@msg `kind` must be "round", "invertedRound" or "chamfer", not {v} `kind` debe ser "round", "invertedRound" o "chamfer", no {v} +@msg `kind` must be `text`, `visibility`, `image` or `graph` `kind` debe ser `text`, `visibility`, `image` o `graph` +@msg `kind` must be a string `kind` debe ser una cadena +@msg `kind` must be image, noImage or htmlText `kind` debe ser image, noImage o htmlText +@msg `kinsoku` must be "none", "hard" or "soft" `kinsoku` debe ser "none", "hard" o "soft" +@msg `label` must be a non-empty name of at most 200 characters `label` debe ser un nombre no vacío de como máximo 200 caracteres +@msg `language` must be a language name or tag, such as "Turkish" or "tr" `language` debe ser un nombre o una etiqueta de idioma, como "Turkish" o "tr" +@msg `leadingModel` must be "romanBaseline" or "emBoxTop" `leadingModel` debe ser "romanBaseline" o "emBoxTop" +@msg `leading` must be from 0.1 to 5000, or null for Auto `leading` debe estar entre 0.1 y 5000, o null para Automático +@msg `length` must be a number of at most 1000000 pt either way `length` debe ser un número de como máximo 1000000 pt en cualquier sentido +@msg `line` must be true or false `line` debe ser true o false +@msg `minAngle` ({min_angle}°) can't be more than `maxAngle` ({max_angle}°) `minAngle` ({min_angle}°) no puede ser mayor que `maxAngle` ({max_angle}°) +@msg `mode` must be "handles", "straight" or "smooth" `mode` debe ser "handles", "straight" o "smooth" +@msg `mode` must be "straight", "bezier" or "arc" `mode` debe ser "straight", "bezier" o "arc" +@msg `mode` must be one of {_1} `mode` debe ser uno de {_1} +@msg `mojikumi` must be "none", "yakumonoHankaku", "gyomatsuYakumonoHankaku", "gyomatsuYakumonoZenkaku", "yakumonoZenkaku" or "lineEndHalf" `mojikumi` debe ser "none", "yakumonoHankaku", "gyomatsuYakumonoHankaku", "gyomatsuYakumonoZenkaku", "yakumonoZenkaku" o "lineEndHalf" +@msg `names` is a list of preset names `names` es una lista de nombres de preajustes +@msg `names` lists preset names `names` enumera nombres de preajustes +@msg `names` must be a list of names `names` debe ser una lista de nombres +@msg `names` must be a list of swatch names `names` debe ser una lista de nombres de muestras +@msg `names` must be an array of style names `names` debe ser una lista de nombres de estilos +@msg `new` is a design name, or true `new` es el nombre de un diseño, o true +@msg `path` must be a folder `path` debe ser una carpeta +@msg `path` must be a path object `path` debe ser un objeto de trazado +@msg `pivot` must be a whole number from 0 to 8 `pivot` debe ser un número entero entre 0 y 8 +@msg `points` must be a list of [x, y] points `points` debe ser una lista de puntos [x, y] +@msg `points` must be a list of point indexes `points` debe ser una lista de índices de puntos +@msg `points` must be an array of point indices `points` debe ser una lista de índices de puntos +@msg `points` must be point indexes `points` deben ser índices de puntos +@msg `port` must be "in" or "out" `port` debe ser "in" u "out" +@msg `position` is above or below `position` es above o below +@msg `preset` must be a string `preset` debe ser una cadena +@msg `ratio` must be from 0.1 to 0.5 `ratio` debe estar entre 0.1 y 0.5 +@msg `rect` must be [x, y, width, height] with a positive size `rect` debe ser [x, y, width, height] con un tamaño positivo +@msg `relation` must be overlap, inside or outside `relation` debe ser overlap, inside u outside +@msg `reversed` must be true or false `reversed` debe ser true o false +@msg `rotate` must be a finite number `rotate` debe ser un número finito +@msg `rule` must be nonZero or evenOdd `rule` debe ser nonZero o evenOdd +@msg `scale` must be a number in (0, 100] `scale` debe ser un número en (0, 100] +@msg `scope` must be "selection" or "document", not {other} `scope` debe ser "selection" o "document", no {other} +@msg `script` must be a string `script` debe ser una cadena +@msg `seriesIndexes` is a non-empty list of series indexes `seriesIndexes` es una lista no vacía de índices de series +@msg `seriesIndexes` needs a `type` or a `valueAxis` `seriesIndexes` necesita un `type` o un `valueAxis` +@msg `shift` must be a number of points `shift` debe ser un número de puntos +@msg `showCenter` must be true or false `showCenter` debe ser true o false +@msg `singleWordJustification` must be "fullJustify", "alignLeft", "alignCenter" or "alignRight" `singleWordJustification` debe ser "fullJustify", "alignLeft", "alignCenter" o "alignRight" +@msg `size` is a percentage of the base text's size, 1 to 100 `size` es un porcentaje del tamaño del texto base, de 1 a 100 +@msg `source` and `target` are the same object `source` y `target` son el mismo objeto +@msg `source` must be `folder` or `datasets` `source` debe ser `folder` o `datasets` +@msg `spacing` must be a number `spacing` debe ser un número +@msg `spacing` must be a number of points, 0 or more, or "auto" `spacing` debe ser un número de puntos, 0 o más, o "auto" +@msg `start` must be a finite number `start` debe ser un número finito +@msg `starts` must be an array of anchor indices (or nulls) `starts` debe ser una lista de índices de puntos de ancla (o valores null) +@msg `status` must be linked, embedded, missing or modified, or a list of them `status` debe ser linked, embedded, missing o modified, o una lista de ellos +@msg `stop` must be a stop index `stop` debe ser un índice de parada +@msg `story` styles the whole story: give no `start` or `end` `story` aplica estilo a todo el artículo: no indiques `start` ni `end` +@msg `story` takes the whole story: give no `start` or `end` `story` abarca todo el artículo: no indiques `start` ni `end` +@msg `strokeMode` applies to strokes (stroke: true) `strokeMode` se aplica a los trazos (stroke: true) +@msg `style` must be roman or japanese `style` debe ser roman o japanese +@msg `subpaths` must be two integer indices `subpaths` deben ser dos índices enteros +@msg `symbol` must be a symbol name `symbol` debe ser el nombre de un símbolo +@msg `target` must be "object" or "contents", not {v} `target` debe ser "object" o "contents", no {v} +@msg `tint` applies to global and spot colours `tint` se aplica a colores globales y tintas planas +@msg `tint` goes with a global or spot `swatch` `tint` va con un `swatch` global o de tinta plana +@msg `tint` must be a number (%) `tint` debe ser un número (%) +@msg `tint` needs a global or spot colour `tint` necesita un color global o una tinta plana +@msg `to` is already threaded `to` ya está enlazado +@msg `to` is the design's new name `to` es el nuevo nombre del diseño +@msg `to` must be [x, y] `to` debe ser [x, y] +@msg `to` must be a closed path, area type or type on a path other than `from` `to` debe ser un trazado cerrado, texto de área o texto en trazado distinto de `from` +@msg `to` must be a whole number `to` debe ser un número entero +@msg `to` takes the rows of one object's stack, not aligned rows `to` acepta las filas de la pila de un objeto, no filas alineadas +@msg `useLab` must be true or false `useLab` debe ser true o false +@msg `vAlign` must be default, top, middle, baseline or bottom `vAlign` debe ser default, top, middle, baseline o bottom +@msg `values` must be a list `values` debe ser una lista +@msg `values` must be an object `values` debe ser un objeto +@msg `values` must name hex, rgb, cmyk, lab or gray `values` debe nombrar hex, rgb, cmyk, lab o gray +@msg `values` names a kind twice `values` nombra dos veces el mismo tipo +@msg `{_1}` can't be edited or removed `{_1}` no se puede editar ni eliminar +@msg `{_1}` is built in and always listed `{_1}` está integrado y siempre aparece en la lista +@msg `{_1}` is not a font file the last text.findFontFiles search found `{_1}` no es un archivo de fuente que haya encontrado la última búsqueda de text.findFontFiles +@msg `{_1}` would be overwritten by the package: choose a different folder or name el paquete sobrescribiría `{_1}`: elige otra carpeta u otro nombre +@msg `{file}` has no art to place `{file}` no tiene ilustración que colocar +@msg `{file}` is over {_1} MB `{file}` ocupa más de {_1} MB +@msg `{f}` belongs to a VectorCraft that is running `{f}` pertenece a un VectorCraft que se está ejecutando +@msg `{f}` is the copy of a document open now `{f}` es la copia de un documento abierto ahora +@msg `{id}` is no writable format (see document.formats) `{id}` no es un formato con escritura (consulta document.formats) +@msg `{id}` isn't a loaded library `{id}` no es una biblioteca cargada +@msg `{key}` has no colours `{key}` no tiene colores +@msg `{key}` is a design name `{key}` es el nombre de un diseño +@msg `{key}` is a design name or a list of them `{key}` es el nombre de un diseño o una lista de ellos +@msg `{key}` is longer than {MAX_NAME} characters `{key}` tiene más de {MAX_NAME} caracteres +@msg `{key}` is out of range `{key}` está fuera de rango +@msg `{key}` must be [min, desired, max] or {{min?, desired?, max?}}, in percent `{key}` debe ser [min, desired, max] o {{min?, desired?, max?}}, en porcentaje +@msg `{key}` must be a non-negative integer `{key}` debe ser un entero no negativo +@msg `{key}` must be a number {_1}..{_2} `{key}` debe ser un número {_1}..{_2} +@msg `{key}` must be a whole number of at least 0, not {n} `{key}` debe ser un número entero de al menos 0, no {n} +@msg `{key}` must be an appearance item index (paint order) or null `{key}` debe ser un índice de elemento de apariencia (orden de pintura) o null +@msg `{key}` must be an array of asset ids (see assets.list) `{key}` debe ser una lista de ids de recursos (consulta assets.list) +@msg `{key}` must be from 0 to 180 degrees, not {a} `{key}` debe estar entre 0 y 180 grados, no {a} +@msg `{key}` must be from {_1} to {shift_max} `{key}` debe estar entre {_1} y {shift_max} +@msg `{key}`: not a colour: {v} `{key}`: no es un color: {v} +@msg `{k}.family` is required `{k}.family` es obligatorio +@msg `{k}` is a number 0..1 `{k}` es un número 0..1 +@msg `{k}` is true or false `{k}` es true o false +@msg `{k}` isn't an export setting: {_1} `{k}` no es un ajuste de exportación: {_1} +@msg `{k}` must be a byte offset `{k}` debe ser un desplazamiento en bytes +@msg `{k}` must be a number `{k}` debe ser un número +@msg `{k}` must be a number of points `{k}` debe ser un número de puntos +@msg `{k}` must be a string `{k}` debe ser una cadena +@msg `{k}` must be a whole number `{k}` debe ser un número entero +@msg `{k}` must be from {lo} to {hi} for {key} `{k}` debe estar entre {lo} y {hi} para {key} +@msg `{k}` must be {what}, not {v} `{k}` debe ser {what}, no {v} +@msg `{l}` isn't a global or spot colour `{l}` no es un color global ni una tinta plana +@msg `{m}` isn't a bitmap: use clipboard.importSvg, importPdf or importText `{m}` no es un mapa de bits: usa clipboard.importSvg, importPdf o importText +@msg `{name}` can't be deleted `{name}` no se puede eliminar +@msg `{name}` can't be duplicated `{name}` no se puede duplicar +@msg `{name}` can't be edited `{name}` no se puede editar +@msg `{name}` can't be edited this way `{name}` no se puede editar de esta forma +@msg `{name}` can't be renamed `{name}` no se puede cambiar de nombre +@msg `{name}` can't name a folder `{name}` no puede nombrar una carpeta +@msg `{name}` has no art to place `{name}` no tiene ilustración que colocar +@msg `{name}` has no text to place `{name}` no tiene texto que colocar +@msg `{name}` in the Word document is not UTF-8 or UTF-16 text `{name}` en el documento de Word no es texto UTF-8 ni UTF-16 +@msg `{name}` in the Word document is not well-formed XML: {e} `{name}` en el documento de Word no es XML bien formado: {e} +@msg `{name}` in the Word document nests elements more than {MAX_NESTING} deep `{name}` en el documento de Word anida elementos a más de {MAX_NESTING} niveles +@msg `{name}` is a built-in preset and is read-only: save it under another name `{name}` es un preajuste integrado y es de solo lectura: guárdalo con otro nombre +@msg `{name}` is a built-in preset: save under another name `{name}` es un preajuste integrado: guarda con otro nombre +@msg `{name}` is a built-in profile and stays `{name}` es un perfil integrado y se conserva +@msg `{name}` is a tint of `{base}`: edit `{base}` (a tint swatch only takes a new name) `{name}` es un matiz de `{base}`: edita `{base}` (una muestra de matiz solo acepta un nombre nuevo) +@msg `{name}` is a working space: choose another with edit.colorSettings first `{name}` es un espacio de trabajo de color: elige antes otro con edit.colorSettings +@msg `{name}` is built in and stays `{name}` está integrado y se conserva +@msg `{name}` takes a paint of its own kind (colour, gradient or pattern) `{name}` acepta una pintura de su mismo tipo (color, degradado o motivo) +@msg `{name}`: Minimum must not exceed Desired, nor Desired Maximum `{name}`: Mínimo no debe superar a Deseado, ni Deseado a Máximo +@msg `{n}` can't be deleted `{n}` no se puede eliminar +@msg `{n}` can't be merged `{n}` no se puede combinar +@msg `{n}` can't be moved `{n}` no se puede mover +@msg `{n}` is not a colour swatch `{n}` no es una muestra de color +@msg `{n}` isn't a solid colour `{n}` no es un color sólido +@msg `{n}`: colour groups hold solid colours only `{n}`: los grupos de colores solo contienen colores sólidos +@msg `{other}` doesn't trace an image `{other}` no calca una imagen +@msg `{s}`: the step's references copy in more than {_1} MB of values `{s}`: las referencias del paso copian más de {_1} MB de valores +@msg `{tag}` is not an axis tag: a tag is four characters, such as "wght" `{tag}` no es una etiqueta de eje: una etiqueta tiene cuatro caracteres, como "wght" +@msg `{to}` is empty or already used `{to}` está vacío o ya se usa +@msg `{what}` is longer than {MAX_TEXT} bytes `{what}` ocupa más de {MAX_TEXT} bytes +@msg `{what}` must be text `{what}` debe ser texto +@msg a DXF drawing has one origin: pass useArtboards: true for one drawing per artboard un dibujo DXF tiene un solo origen: pasa useArtboards: true para un dibujo por mesa de trabajo +@msg a PDF presets file with over {_1} presets un archivo de preajustes de PDF con más de {_1} preajustes +@msg a batch preview cannot switch documents una vista previa por lotes no puede cambiar de documento +@msg a brush named `{nn}` exists ya existe un pincel llamado `{nn}` +@msg a container of the listed objects is gone ya no existe un contenedor de los objetos enumerados +@msg a content stream can't be read no se puede leer un flujo de contenido +@msg a content stream isn't a stream un flujo de contenido no es un flujo +@msg a design holds at most {_1} objects un diseño contiene como máximo {_1} objetos +@msg a design needs a name un diseño necesita un nombre +@msg a dictionary grew too large un diccionario creció demasiado +@msg a document keeps at most {_1} graph designs un documento guarda como máximo {_1} diseños de gráfico +@msg a document keeps at most {_1} saved selections un documento guarda como máximo {_1} selecciones guardadas +@msg a document keeps at most {_1} views un documento guarda como máximo {_1} vistas +@msg a document links at most {MAX_SVG_SCRIPTS} JavaScript files un documento vincula como máximo {MAX_SVG_SCRIPTS} archivos JavaScript +@msg a feConvolveMatrix filter's order is {x}×{y}, which overflows the kernel-size multiply usvg makes el orden de un filtro feConvolveMatrix es {x}×{y}, lo que desborda la multiplicación del tamaño del núcleo que hace usvg +@msg a gradient preset is already called {n} ya hay un preajuste de degradado llamado {n} +@msg a graph has at most {_1} series, so it transposes with at most that many categories un gráfico tiene como máximo {_1} series, así que se transpone con como máximo esa cantidad de categorías +@msg a layer can't be merged into its own sublayer una capa no se puede combinar en su propia subcapa +@msg a layer's form box isn't an array el cuadro del formulario de una capa no es una matriz +@msg a layer's form can't be read no se puede leer el formulario de una capa +@msg a layer's form has no box el formulario de una capa no tiene cuadro +@msg a layer's form has no dictionary el formulario de una capa no tiene diccionario +@msg a legend draws at most {MAX_CHIPS} swatches una leyenda dibuja como máximo {MAX_CHIPS} muestras +@msg a name names one asset: give multiple: false, or one object un nombre nombra un solo recurso: indica multiple: false, o un solo objeto +@msg a page can't be read no se puede leer una página +@msg a page object is used by something else otro elemento usa un objeto de página +@msg a page thumbnail must be RGB pixels, 1 to {THUMBNAIL_SIZE} a side (got {w} × {h}) una miniatura de página debe ser de píxeles RGB, de 1 a {THUMBNAIL_SIZE} por lado (se recibió {w} × {h}) +@msg a pattern layer doesn't end what it starts una capa de motivo no termina lo que empieza +@msg a pattern layer's colors hold something else los colores de una capa de motivo contienen otra cosa +@msg a pattern named `{n}` exists ya existe un motivo llamado `{n}` +@msg a plug-in with id {_1} is already installed ya hay instalado un plugin con el id {_1} +@msg a preset named `{n}` exists ya existe un preajuste llamado `{n}` +@msg a print presets file with over {_1} presets un archivo de preajustes de impresión con más de {_1} preajustes +@msg a profile is already called {n} ya hay un perfil llamado {n} +@msg a row can't go into itself una fila no puede entrar en sí misma +@msg a series goes on the left or the right value axis una serie va en el eje de valores izquierdo o derecho +@msg a start must be an anchor index ≥ 0 or null un inicio debe ser un índice de punto de ancla ≥ 0 o null +@msg a style named `{name}` already exists ya existe un estilo llamado `{name}` +@msg a style named `{to}` already exists ya existe un estilo llamado `{to}` +@msg a swatch needs a colour, gradient or pattern una muestra necesita un color, un degradado o un motivo +@msg a symbol named `{n}` already exists ya existe un símbolo llamado `{n}` +@msg a theme has 1 to {THEME_SIZE} colours un tema tiene de 1 a {THEME_SIZE} colores +@msg a theme is already called {name} (replace: "{name}" overwrites it) ya hay un tema llamado {name} (replace: "{name}" lo sobrescribe) +@msg a toolbar name has at most {MAX_NAME} characters el nombre de una barra de herramientas tiene como máximo {MAX_NAME} caracteres +@msg a view named `{_1}` exists ya existe una vista llamada `{_1}` +@msg a view named `{name}` exists ya existe una vista llamada `{name}` +@msg a workspace keeps at most {MAX} toolbars un espacio de trabajo guarda como máximo {MAX} barras de herramientas +@msg a {_1} series can't go in a {_2} graph una serie {_1} no puede ir en un gráfico {_2} +@msg aiVersion {v}: "pdf" (PDF-compatible, the default) or "7" (legacy .ai, version 7) aiVersion {v}: "pdf" (compatible con PDF, el predeterminado) o "7" (.ai heredado, versión 7) +@msg already editing an opacity mask ya se está editando una máscara de opacidad +@msg already editing another object's opacity mask ya se está editando la máscara de opacidad de otro objeto +@msg already in pattern editing mode ya está en el modo de edición de motivos +@msg an artboard is listed twice una mesa de trabajo aparece dos veces en la lista +@msg an empty artboard has no width or height to scale to una mesa de trabajo vacía no tiene anchura ni altura a la que escalar +@msg an image is too large for DXF and was left out una imagen es demasiado grande para DXF y se omitió +@msg an image of {_1} MB, at most {_2} MB una imagen de {_1} MB, como máximo {_2} MB +@msg an image of {declared_w} × {declared_h} pixels is too large to draw una imagen de {declared_w} × {declared_h} píxeles es demasiado grande para dibujarla +@msg an image of {width} × {height} pixels is too large to draw una imagen de {width} × {height} píxeles es demasiado grande para dibujarla +@msg an index must be a whole number un índice debe ser un número entero +@msg an inline graphic has no glyphs un gráfico en línea no tiene glifos +@msg an invisible text form can't be read no se puede leer un formulario de texto invisible +@msg an object is missing falta un objeto +@msg an object's header is missing falta el encabezado de un objeto +@msg an overprinting form can't be read no se puede leer un formulario con sobreimpresión +@msg an unread object has no readable bounds un objeto no leído no tiene límites legibles +@msg an unread object holds a frame of threaded type un objeto no leído contiene un marco de texto enlazado +@msg an unread object is missing from its layer falta un objeto no leído en su capa +@msg anchor `smooth` must be true or false `smooth` del punto de ancla debe ser true o false +@msg anchor `{key}` must be [x, y] `{key}` del punto de ancla debe ser [x, y] +@msg anchor `{key}` must be a number `{key}` del punto de ancla debe ser un número +@msg angle and roundness must be finite angle y roundness deben ser finitos +@msg angles must be a list as long as pins (degrees or null) angles debe ser una lista tan larga como pins (grados o null) +@msg appearance must be flat|center|edge appearance debe ser flat|center|edge +@msg apply is "fill" or "stroke", not `{other}` apply es "fill" o "stroke", no `{other}` +@msg area must be a closed polygon of 3 to 100000 [x, y] points area debe ser un polígono cerrado de 3 a 100000 puntos [x, y] +@msg area type needs a path that encloses an area el texto de área necesita un trazado que encierre un área +@msg area type {_1} is named twice el texto de área {_1} se nombra dos veces +@msg arrowAlign must be extend|tip, got {o} arrowAlign debe ser extend|tip, se recibió {o} +@msg arrowScale must be [start, end] arrowScale debe ser [start, end] +@msg artboard is a 0-based index artboard es un índice que empieza en 0 +@msg artboard must be a 0-based index artboard debe ser un índice que empieza en 0 +@msg artboard {i} doesn't print la mesa de trabajo {i} no se imprime +@msg artboardLayout must be {layout?, columns?, spacing?, rightToLeft?} artboardLayout debe ser {layout?, columns?, spacing?, rightToLeft?} +@msg artboardLayout.columns must be 1 or more artboardLayout.columns debe ser 1 o más +@msg artboardLayout.layout must be gridByRow, gridByColumn, row or column artboardLayout.layout debe ser gridByRow, gridByColumn, row o column +@msg artboardLayout.rightToLeft must be true or false artboardLayout.rightToLeft debe ser true o false +@msg artboardLayout.spacing must be 0–{MAX_SPACING} pt artboardLayout.spacing debe ser 0–{MAX_SPACING} pt +@msg artboards must be a non-empty list artboards debe ser una lista no vacía +@msg artboards must be a number artboards debe ser un número +@msg asset `{_1}` has no art to export el recurso `{_1}` no tiene ilustración que exportar +@msg at most {MAX_KEYWORDS} keywords como máximo {MAX_KEYWORDS} palabras clave +@msg at most {MAX_MATCHES} matches are kept se conservan como máximo {MAX_MATCHES} coincidencias +@msg at most {MAX_POINTS} points como máximo {MAX_POINTS} puntos +@msg at most {MAX_QUEUE} files como máximo {MAX_QUEUE} archivos +@msg at must be [x, y] at debe ser [x, y] +@msg at/rect lie outside the canvas at/rect quedan fuera del lienzo +@msg attribute must be size|leading|tracking|kerning|baselineShift attribute debe ser size|leading|tracking|kerning|baselineShift +@msg attrs must be an object attrs debe ser un objeto +@msg automation path rejected: the folder's name isn't valid text ruta de automatización rechazada: el nombre de la carpeta no es texto válido +@msg automation path rejected: {_1} isn't valid text ruta de automatización rechazada: {_1} no es texto válido +@msg automation path rejected: {why}: {path} ruta de automatización rechazada: {why}: {path} +@msg axis must be "vertical", "horizontal" or an angle in degrees, not `{given}` axis debe ser "vertical", "horizontal" o un ángulo en grados, no `{given}` +@msg backgroundContents must be transparent or white backgroundContents debe ser transparent o white +@msg bad AES key clave AES incorrecta +@msg bad `runs`: {e} `runs` incorrecto: {e} +@msg bad arrowScale arrowScale incorrecto +@msg bad base64 base64 incorrecto +@msg bad color {c} color incorrecto {c} +@msg bad colour color incorrecto +@msg bad colour in `colors` color incorrecto en `colors` +@msg bad colour {v} color incorrecto {v} +@msg bad colour {v} in groupColors color incorrecto {v} en groupColors +@msg bad cross-reference entry entrada de referencia cruzada incorrecta +@msg bad cross-reference table tabla de referencias cruzadas incorrecta +@msg bad current colour {v} color actual incorrecto {v} +@msg bad dataBase64 dataBase64 incorrecto +@msg bad edit edición incorrecta +@msg bad fill {v} relleno incorrecto {v} +@msg bad fit: {e} ajuste incorrecto: {e} +@msg bad model {other} (keep, new or document) modelo incorrecto {other} (keep, new o document) +@msg bad new colour {v} color nuevo incorrecto {v} +@msg bad object objeto incorrecto +@msg bad object number número de objeto incorrecto +@msg bad offset desplazamiento incorrecto +@msg bad path data: {e} datos de trazado incorrectos: {e} +@msg bad point {v}: expected [x, y] or [x, y, pressure] punto incorrecto {v}: se esperaba [x, y] o [x, y, pressure] +@msg bad reference referencia incorrecta +@msg bad trailer size tamaño de trailer incorrecto +@msg bad {k} colour color {k} incorrecto +@msg batches cannot nest los lotes no se pueden anidar +@msg bind something to a variable first vincula antes algo a una variable +@msg bleed must be 0–{MAX_BLEED} pt: a number, [top, bottom, left, right] or {{top, bottom, left, right}} bleed debe ser 0–{MAX_BLEED} pt: un número, [top, bottom, left, right] o {{top, bottom, left, right}} +@msg brush must be a name or null brush debe ser un nombre o null +@msg by must be a number by debe ser un número +@msg can't add page thumbnails: {why} no se pueden agregar miniaturas de página: {why} +@msg can't add the editing data for other apps: {why} no se pueden agregar los datos de edición para otras aplicaciones: {why} +@msg can't edit the written PDF: {why} no se puede editar el PDF escrito: {why} +@msg can't encrypt the PDF: {why} no se puede cifrar el PDF: {why} +@msg can't linearise the PDF: {why} no se puede linealizar el PDF: {why} +@msg can't open `{_1}`: {_2} no se puede abrir `{_1}`: {_2} +@msg can't open `{_1}`: {e} no se puede abrir `{_1}`: {e} +@msg can't open `{name}`: not a format VectorCraft reads (see document.formats) no se puede abrir `{name}`: no es un formato que VectorCraft lea (consulta document.formats) +@msg can't place `{name}`: not a format VectorCraft reads (see document.formats) no se puede colocar `{name}`: no es un formato que VectorCraft lea (consulta document.formats) +@msg can't read back the written PDF: {e} no se puede volver a leer el PDF escrito: {e} +@msg can't read this Word document: {why} no se puede leer este documento de Word: {why} +@msg can't write .{e} images: use .png, .jpg, .gif, .webp, .tif or .bmp no se pueden escribir imágenes .{e}: usa .png, .jpg, .gif, .webp, .tif o .bmp +@msg can't write PDF layers, overprint or invisible text: {why} no se pueden escribir capas PDF, sobreimpresión ni texto invisible: {why} +@msg can't write the file's copyright: {why} no se puede escribir el copyright del archivo: {why} +@msg can't write the file's modification date: {why} no se puede escribir la fecha de modificación del archivo: {why} +@msg can't write the pages' user units: {why} no se pueden escribir las unidades de usuario de las páginas: {why} +@msg cannot distort a zero-size or non-finite bounding box no se puede distorsionar un cuadro delimitador de tamaño cero o no finito +@msg cannot move an object into itself no se puede mover un objeto dentro de sí mismo +@msg case must be upper|lower|title|sentence case debe ser upper|lower|title|sentence +@msg category `{c}`: one of {_1} categoría `{c}`: una de {_1} +@msg center must be [x, y] center debe ser [x, y] +@msg choose at least one artboard elige al menos una mesa de trabajo +@msg choose at least one status elige al menos un estado +@msg clip must be true or false clip debe ser true o false +@msg clippingMask must be true or false clippingMask debe ser true o false +@msg closed must be a boolean closed debe ser un booleano +@msg collapsed must be true or false collapsed debe ser true o false +@msg color.profile: no RGB or CMYK profile is called “{profile}” color.profile: ningún perfil RGB ni CMYK se llama “{profile}” +@msg colorMode must be rgb or cmyk, not `{m}` colorMode debe ser rgb o cmyk, no `{m}` +@msg colorModel must be {own} (the document's mode), grayscale or bitmap colorModel debe ser {own} (el modo del documento), grayscale o bitmap +@msg colour groups can't go into colour groups los grupos de colores no pueden ir dentro de grupos de colores +@msg colour, mode and spot apply to solid-colour swatches only colour, mode y spot solo se aplican a muestras de color sólido +@msg column {column}: `{cell}` is a `%` column of graph data files, which are not read columna {column}: `{cell}` es una columna `%` de los archivos de datos de gráficos, que no se leen +@msg column {column}: `{cell}` names `{name}`, which is a {_1} variable columna {column}: `{cell}` nombra `{name}`, que es una variable {_1} +@msg column {column}: `{cell}` names no variable columna {column}: `{cell}` no nombra ninguna variable +@msg column {column}: the variable name is longer than {MAX_NAME} characters columna {column}: el nombre de la variable tiene más de {MAX_NAME} caracteres +@msg column: true floats the whole column and takes no onto, above or below column: true hace flotar toda la columna y no acepta onto, above ni below +@msg command must be a shape.* command command debe ser un comando shape.* +@msg commands[{i}]: missing `command` commands[{i}]: falta `command` +@msg composer must be "singleLine" or "everyLine" composer debe ser "singleLine" o "everyLine" +@msg compound shapes take paths, compound paths, groups, compound shapes, type, blends and envelopes las formas compuestas aceptan trazados, trazados compuestos, grupos, formas compuestas, texto, fusiones y envolventes +@msg compound {_1} must contain exactly one open path to join el compuesto {_1} debe contener exactamente un trazado abierto para unir +@msg connect end must be "start" or "end" el extremo de connect debe ser "start" o "end" +@msg connect needs a path other than the one extended connect necesita un trazado distinto del que se extiende +@msg connect needs id connect necesita id +@msg connect path has no open end el trazado de connect no tiene ningún extremo abierto +@msg copy needs path: the file to copy into the document's folder copy necesita path: el archivo que se copia en la carpeta del documento +@msg copy takes images only: relink placed documents where their files are copy solo acepta imágenes: vuelve a vincular los documentos colocados donde estén sus archivos +@msg copying a file isn't available on the web copiar un archivo no está disponible en la web +@msg copyrightStatus must be unknown, copyrighted or publicDomain copyrightStatus debe ser unknown, copyrighted o publicDomain +@msg copyrightUrl must be a URL (no spaces, at most 2048 characters) copyrightUrl debe ser una URL (sin espacios, como máximo 2048 caracteres) +@msg corners must be 4 [x, y] points (TL, TR, BR, BL) corners debe ser 4 puntos [x, y] (TL, TR, BR, BL) +@msg counterPer `{c}`: item or file counterPer `{c}`: item o file +@msg crop `{_1}`: only PDF pages have art, trim, bleed and media boxes; use "crop" or "bounding" crop `{_1}`: solo las páginas PDF tienen cuadros de ilustración, recorte, sangrado y medios; usa "crop" o "bounding" +@msg crop rectangle doesn't overlap the image el rectángulo de recorte no se superpone a la imagen +@msg cross-reference and object streams aren't supported no se admiten los flujos de referencias cruzadas ni de objetos +@msg damaged compressed data: {e} datos comprimidos dañados: {e} +@msg dash lengths must be numbers, got {v} las longitudes de guion deben ser números, se recibió {v} +@msg dash must be a list of lengths or null, got {v} dash debe ser una lista de longitudes o null, se recibió {v} +@msg data key `{k}`: letters, digits, -, _ and . (not name or vc-…) clave de datos `{k}`: letras, dígitos, -, _ y . (no name ni vc-…) +@msg data must be an object of key: value, not {v} data debe ser un objeto de key: value, no {v} +@msg data set `{name}` holds a value for `{var}`, which the library doesn't declare el conjunto de datos `{name}` contiene un valor para `{var}`, que la biblioteca no declara +@msg data set `{name}` holds two values for `{var}` el conjunto de datos `{name}` contiene dos valores para `{var}` +@msg data set `{name}` is declared twice el conjunto de datos `{name}` se declara dos veces +@msg data takes at most {MAX_DATA} keys at once data acepta como máximo {MAX_DATA} claves a la vez +@msg dataset `{name}` already exists ya existe el conjunto de datos `{name}` +@msg dataset `{to}` already exists ya existe el conjunto de datos `{to}` +@msg date `{d}`: YYYY-MM-DD fecha `{d}`: YYYY-MM-DD +@msg decoded data is too large los datos descodificados son demasiado grandes +@msg define a variable first define antes una variable +@msg detect must be true or false detect debe ser true o false +@msg direct-select anchor points of a path selecciona con Selección directa los puntos de ancla de un trazado +@msg distance must be > 0 distance debe ser > 0 +@msg dx and dy give the arrow's direction dx y dy indican la dirección de la flecha +@msg dx and dy must be numbers dx y dy deben ser números +@msg dxf fitTo must be [width, height], positive fitTo de dxf debe ser [width, height], positivo +@msg dxf must be an object of DXF import options dxf debe ser un objeto de opciones de importación de DXF +@msg dxf scale must be a positive number up to {_1}, not {s} scale de dxf debe ser un número positivo de hasta {_1}, no {s} +@msg dxf unit `{u}`: a unit such as mm, cm, in or pt unidad de dxf `{u}`: una unidad como mm, cm, in o pt +@msg dxf: {e} dxf: {e} +@msg each format is an object {format, scale?, suffix?} cada formato es un objeto {format, scale?, suffix?} +@msg each item needs an id cada elemento necesita un id +@msg each match needs `kind` cada coincidencia necesita `kind` +@msg each match needs a `name` cada coincidencia necesita un `name` +@msg each of `fonts` is {family, style?}; 1 to 1000 of them cada elemento de `fonts` es {family, style?}; de 1 a 1000 +@msg each of `items` is {kind, item} cada elemento de `items` es {kind, item} +@msg each of `items` is {{id, corners?}} with an object id, not {it} cada elemento de `items` es {{id, corners?}} con un id de objeto, no {it} +@msg each row needs `from` cada fila necesita `from` +@msg each stop needs a position cada parada necesita una posición +@msg each subpath needs an anchors array cada subtrazado necesita una matriz anchors +@msg easingType must be easeIn, easeOut, easeInOut or easeOutIn easingType debe ser easeIn, easeOut, easeInOut o easeOutIn +@msg editingData must be true or false editingData debe ser true o false +@msg editingData must be true, false or "always" editingData debe ser true, false o "always" +@msg edits overlap las ediciones se superponen +@msg effects of objects whose appearances differ can't be moved together los efectos de objetos cuyas apariencias difieren no se pueden mover juntos +@msg empty header in column {_1} encabezado vacío en la columna {_1} +@msg encoding `{_1}`: utf8 or utf16 codificación `{_1}`: utf8 o utf16 +@msg ends must be two of "first" and "last" ends debe ser dos de "first" y "last" +@msg every numbered name for the result is taken todos los nombres numerados para el resultado están ocupados +@msg expanded SVG styles exceed the import size limit los estilos SVG expandidos superan el límite de tamaño de importación +@msg export presets file is larger than {MAX_PRESET_FILE_BYTES} bytes el archivo de preajustes de exportación ocupa más de {MAX_PRESET_FILE_BYTES} bytes +@msg exportText must be editable or appearance exportText debe ser editable o appearance +@msg exportType must be movieClip or graphic, not `{s}` exportType debe ser movieClip o graphic, no `{s}` +@msg extend needs id extend necesita id +@msg featureChanges lists at most {MAX_FEATURE_CHANGES} tags featureChanges enumera como máximo {MAX_FEATURE_CHANGES} etiquetas +@msg featureChanges must be a list of tags featureChanges debe ser una lista de etiquetas +@msg features must be a list of tags features debe ser una lista de etiquetas +@msg fidelity must be 0..100 fidelity debe ser 0..100 +@msg files must be {name, dataBase64} files debe ser {name, dataBase64} +@msg fit must be none|autoHeight|shrinkText|block, got {id} fit debe ser none|autoHeight|shrinkText|block, se recibió {id} +@msg flattener: {e} acoplador: {e} +@msg flattenerPreset `{name}`: high, medium, low or a saved one (see flattener.presets.list) flattenerPreset `{name}`: high, medium, low o uno guardado (consulta flattener.presets.list) +@msg flipProfile must be along|across, got {o} flipProfile debe ser along|across, se recibió {o} +@msg folders `{f}`: none, rows, format, item or itemFormat folders `{f}`: none, rows, format, item o itemFormat +@msg folders deeper than {MAX_BATCH_DEPTH} levels carpetas con más de {MAX_BATCH_DEPTH} niveles de profundidad +@msg folders deeper than {MAX_DEPTH} levels carpetas con más de {MAX_DEPTH} niveles de profundidad +@msg font family `{family}` is not available la familia de fuentes `{family}` no está disponible +@msg font family `{tf}` is not available la familia de fuentes `{tf}` no está disponible +@msg format `{f}`: pdf or postscript formato `{f}`: pdf o postscript +@msg format `{f}`: text or json formato `{f}`: text o json +@msg format is `{format}` el formato es `{format}` +@msg formats must be an array of rows, not {v} formats debe ser una lista de filas, no {v} +@msg frequency must be between 1 and 300 lines per inch frequency debe estar entre 1 y 300 líneas por pulgada +@msg from and to must be finite from y to deben ser finitos +@msg from must be [x0, y0, x1, y1] from debe ser [x0, y0, x1, y1] +@msg give `before` or `after`, not both indica `before` o `after`, no ambos +@msg give `colors`, or `color` and `rule` indica `colors`, o `color` y `rule` +@msg give `event`, such as onclick indica `event`, como onclick +@msg give `file`, the JavaScript file's path or URL indica `file`, la ruta o URL del archivo JavaScript +@msg give `fill` and/or `stroke` indica `fill` y/o `stroke` +@msg give `fill`, `stroke` or both indica `fill`, `stroke` o ambos +@msg give `folder` indica `folder` +@msg give `fonts`, or open a document indica `fonts` o abre un documento +@msg give `from` or `indices`, not both indica `from` o `indices`, no ambos +@msg give `id` (no text is being edited) indica `id` (no se está editando ningún texto) +@msg give `id` and `anchors`, or `items`, not both indica `id` y `anchors`, o `items`, no ambos +@msg give `id` or `guide`, not both indica `id` o `guide`, no ambos +@msg give `length` or `to` indica `length` o `to` +@msg give `matches`: [{kind, name, target}] indica `matches`: [{kind, name, target}] +@msg give `name` (or edit a pattern) indica `name` (o edita un motivo) +@msg give `name` or `names` indica `name` o `names` +@msg give `path` (a .wasm file) or `dataBase64` (the module) indica `path` (un archivo .wasm) o `dataBase64` (el módulo) +@msg give `path`, `data` or `dataBase64` indica `path`, `data` o `dataBase64` +@msg give `path`, `data`, `dataBase64` or `csv` indica `path`, `data`, `dataBase64` o `csv` +@msg give `path`, `xml` or `dataBase64` indica `path`, `xml` o `dataBase64` +@msg give `script`, the JavaScript the event runs ("" removes the event) indica `script`, el JavaScript que ejecuta el evento ("" elimina el evento) +@msg give `text` (the reading) or `remove` indica `text` (la lectura) o `remove` +@msg give `x` and `y` (and a `tolerance` of 0 or more) indica `x` e `y` (y una `tolerance` de 0 o más) +@msg give a mode or r/g/b, c/m/y/k, gray or tint adjustments indica un modo o ajustes de r/g/b, c/m/y/k, gray o tint +@msg give a name, or paint the active proxy with a saved preset indica un nombre o pinta el proxy activo con un preajuste guardado +@msg give a name, or select a stroke with a saved profile indica un nombre o selecciona un trazo con un perfil guardado +@msg give a pattern name or select an object painted with a pattern indica el nombre de un motivo o selecciona un objeto pintado con un motivo +@msg give at least one of clip, invert, disabled, linked indica al menos uno de clip, invert, disabled, linked +@msg give color, none, swatch or gradient indica color, none, swatch o gradient +@msg give dataBase64 indica dataBase64 +@msg give either at (a click) or area (a path drawn around the overlaps) indica at (un clic) o area (un trazado dibujado alrededor de las superposiciones) +@msg give formats or a preset, not both indica formats o un preajuste, no ambos +@msg give newName or delete indica newName o delete +@msg give offset or by indica offset o by +@msg give one of `to`, `rect` or `at` indica uno de `to`, `rect` o `at` +@msg give one of assets, layers, selection or fullDocument indica uno de assets, layers, selection o fullDocument +@msg give only one of onto, above, below, icon and a column place indica solo uno de onto, above, below, icon y una posición de columna +@msg give origin: [x, y], or reset: true indica origin: [x, y], o reset: true +@msg give overprintFill, overprintStroke, showCenter, imageMap, url or note indica overprintFill, overprintStroke, showCenter, imageMap, url o note +@msg give path (a file) or folder indica path (un archivo) o folder +@msg give path, or name and dataBase64 indica path, o name y dataBase64 +@msg give paths or files indica paths o files +@msg give rows, rowHeight, columns or columnWidth indica rows, rowHeight, columns o columnWidth +@msg give svg, or dataBase64 of an SVG or SVGZ file indica svg, o dataBase64 de un archivo SVG o SVGZ +@msg give text indica text +@msg give the asset a name ponle un nombre al recurso +@msg give the preset a `name` ponle un `name` al preajuste +@msg give the preset a name ponle un nombre al preajuste +@msg give the preset a name (1–64 characters) ponle un nombre al preajuste (de 1 a 64 caracteres) +@msg give the settings to change, e.g. {"formats"}]} indica los ajustes que quieres cambiar, p. ej. {"formats"}]} +@msg give the style a name ponle un nombre al estilo +@msg give two or more style `names` indica dos o más `names` de estilos +@msg give two or more swatches indica dos o más muestras +@msg give x, y, or a handle's length or angle indica x, y, o la longitud o el ángulo de un manejador +@msg give {key, value} or {values} indica {key, value} o {values} +@msg global must be true or false global debe ser true o false +@msg glyph {_1} is not drawn for {ch} with the character's style (such as All Caps, Small Caps or a numeral system) el glifo {_1} no se dibuja para {ch} con el estilo del carácter (como Todo mayúsculas, Versalitas o un sistema de numeración) +@msg glyph {g} is not an alternate of {ch} in {_1} {_2} el glifo {g} no es una alternativa de {ch} en {_1} {_2} +@msg gradient must be "objects" or "mesh" gradient debe ser "objects" o "mesh" +@msg grays must be "profile" or "black", not `{g}` grays debe ser "profile" o "black", no `{g}` +@msg gridColors must be a preset name or two colours gridColors debe ser el nombre de un preajuste o dos colores +@msg gridSize must be small, medium or large gridSize debe ser small, medium o large +@msg guide {g} is not selected la guía {g} no está seleccionada +@msg handle must be 0..3 handle debe ser 0..3 +@msg hiddenObjects {v}: "layer" (the default), "omit" or "visible" hiddenObjects {v}: "layer" (el predeterminado), "omit" o "visible" +@msg highlight a layer to merge into resalta una capa en la que combinar +@msg highlight two or more rows in one layer or group resalta dos o más filas en una misma capa o grupo +@msg highlight two or more rows to merge resalta dos o más filas para combinarlas +@msg icon docks a panel in the icon column: use window.panel.dock icon acopla un panel en la columna de iconos: usa window.panel.dock +@msg id must be a dimension id id debe ser el id de una cota +@msg image has no bounds la imagen no tiene límites +@msg image {_1} is linked already la imagen {_1} ya está vinculada +@msg imageMap `{m}`: none, client or server imageMap `{m}`: none, client o server +@msg index out of range índice fuera de rango +@msg instances must be 1..1000 instances debe ser 1..1000 +@msg invalid `color` `color` no válido +@msg invalid anchor index {v}: expected a non-negative integer índice de punto de ancla no válido {v}: se esperaba un entero no negativo +@msg invalid anchor reference {v}: expected [subpath, anchor] referencia de punto de ancla no válida {v}: se esperaba [subpath, anchor] +@msg invalid angle ángulo no válido +@msg invalid brush: {e} pincel no válido: {e} +@msg invalid color color no válido +@msg invalid colour {c} color no válido {c} +@msg invalid delta delta no válido +@msg invalid point punto no válido +@msg invalid size tamaño no válido +@msg invalid t t no válido +@msg invalid tolerance tolerancia no válida +@msg its artboards all lie beyond the canvas (more than {_1} pt from the origin) todas sus mesas de trabajo quedan fuera del lienzo (a más de {_1} pt del origen) +@msg its clipping masks are nested too deeply sus máscaras de recorte están anidadas a demasiada profundidad +@msg its metadata has no description sus metadatos no tienen descripción +@msg its metadata has no direct length sus metadatos no tienen longitud directa +@msg join two different paths une dos trazados distintos +@msg justify must be auto|left|center|right|justifyAll justify debe ser auto|left|center|right|justifyAll +@msg kbps must be a positive number, not {kbps} kbps debe ser un número positivo, no {kbps} +@msg keywords must be a list of words or a comma-separated string keywords debe ser una lista de palabras o una cadena separada por comas +@msg keywords must be at most {MAX_KEYWORD} characters, without control characters keywords debe tener como máximo {MAX_KEYWORD} caracteres, sin caracteres de control +@msg kind must be 1, 2 or 3, or give a preset `name` (see perspective.presets.list) kind debe ser 1, 2 o 3, o indica un `name` de preajuste (consulta perspective.presets.list) +@msg kind must be graphic, fillColor, strokeColor, fillGradient, strokeGradient, fillPattern, strokePattern, charStyle or paraStyle kind debe ser graphic, fillColor, strokeColor, fillGradient, strokeGradient, fillPattern, strokePattern, charStyle o paraStyle +@msg knockout must be "on", "off", "neutral" or a bool, not {v} knockout debe ser "on", "off", "neutral" o un bool, no {v} +@msg layer `{name}` has no art to export la capa `{name}` no tiene ilustración que exportar +@msg layer must name a layer or sublayer layer debe nombrar una capa o subcapa +@msg layers can't be intertwined: select the objects in them las capas no se pueden entrelazar: selecciona los objetos que contienen +@msg layers go only at the top level or in layers, objects in layers and groups las capas solo van en el nivel superior o dentro de capas, y los objetos en capas y grupos +@msg layers must be true or false layers debe ser true o false +@msg layout must be gridByRow, gridByColumn, row or column layout debe ser gridByRow, gridByColumn, row o column +@msg leading must be a number or "auto" leading debe ser un número o "auto" +@msg left/right must be non-negative widths left/right deben ser anchuras no negativas +@msg level `{t}`: 2 or 3 nivel `{t}`: 2 o 3 +@msg line {line}: more than {MAX_CSV_COLS} columns línea {line}: más de {MAX_CSV_COLS} columnas +@msg line {line}: unclosed quote línea {line}: comillas sin cerrar +@msg line {line}: value for `{var}` must match its variable kind línea {line}: el valor de `{var}` debe coincidir con el tipo de su variable +@msg lineEndings `{other}`: lf or crlf lineEndings `{other}`: lf o crlf +@msg loading profiles from disk isn't available in the browser cargar perfiles desde el disco no está disponible en el navegador +@msg margin: a {m} pt margin leaves no imageable area on the paper margin: un margen de {m} pt no deja área imprimible en el papel +@msg matrix must be finite and invertible, depth finite matrix debe ser finita e invertible, y depth finita +@msg matte: {e} matte: {e} +@msg member is for order front, forward, backward or back member es para order front, forward, backward o back +@msg missing `artboards` falta `artboards` +@msg missing `at` [x, y] falta `at` [x, y] +@msg missing `attrs` falta `attrs` +@msg missing `color` or `opacity` falta `color` u `opacity` +@msg missing `colors` falta `colors` +@msg missing `commands` falta `commands` +@msg missing `destinationFolder` falta `destinationFolder` +@msg missing `effect` id falta el id de `effect` +@msg missing `family` falta `family` +@msg missing `find` falta `find` +@msg missing `gid` (a glyph id, or null for the default glyph) falta `gid` (un id de glifo, o null para el glifo predeterminado) +@msg missing `group` falta `group` +@msg missing `id` falta `id` +@msg missing `id`: give one, or select one type object falta `id`: indica uno o selecciona un objeto de texto +@msg missing `index` (a point index, or null to clear) falta `index` (un índice de punto, o null para borrar) +@msg missing `index` (a stop index, or null to clear) falta `index` (un índice de parada, o null para borrar) +@msg missing `index` (an item index or null) falta `index` (un índice de elemento o null) +@msg missing `item` falta `item` +@msg missing `library` falta `library` +@msg missing `library` (see graphicStyle.libraries) falta `library` (consulta graphicStyle.libraries) +@msg missing `library` (see swatch.library.list) falta `library` (consulta swatch.library.list) +@msg missing `map` (rows [{from, to}] or {current}) falta `map` (filas [{from, to}] o {current}) +@msg missing `matrix` [a,b,c,d,e,f] falta `matrix` [a,b,c,d,e,f] +@msg missing `name` (see gradient.presets.list) falta `name` (consulta gradient.presets.list) +@msg missing `offset` (a distance in points) falta `offset` (una distancia en puntos) +@msg missing `path` falta `path` +@msg missing `path` (a path object id) falta `path` (un id de objeto de trazado) +@msg missing `rule` falta `rule` +@msg missing `source` id falta el id de `source` +@msg missing `start` (the byte offset of a character) falta `start` (el desplazamiento en bytes de un carácter) +@msg missing `status`: linked, embedded, missing or modified falta `status`: linked, embedded, missing o modified +@msg missing `target` id falta el id de `target` +@msg missing `text` falta `text` +@msg missing `to` falta `to` +@msg missing `to` (an index) falta `to` (un índice) +@msg missing `to`: a non-negative integer falta `to`: un entero no negativo +@msg missing `type` falta `type` +@msg missing `value` falta `value` +@msg missing `{key}` falta `{key}` +@msg missing `{k}` falta `{k}` +@msg missing anchor falta anchor +@msg missing anchors falta anchors +@msg missing anchors [[subpath, anchor]…] falta anchors [[subpath, anchor]…] +@msg missing array `{key}` falta la matriz `{key}` +@msg missing case falta case +@msg missing color falta color +@msg missing commands falta commands +@msg missing destination folder falta la carpeta de destino +@msg missing from falta from +@msg missing group falta group +@msg missing id or ids falta id o ids +@msg missing ids falta ids +@msg missing indexes falta indexes +@msg missing matrix [a,b,c,d,e,f] falta matrix [a,b,c,d,e,f] +@msg missing name falta name +@msg missing op falta op +@msg missing or invalid `color` `color` falta o no es válido +@msg missing or unknown `tool` `tool` falta o es desconocido +@msg missing point falta point +@msg missing point [x,y] falta point [x,y] +@msg missing point `{key}` ([x, y]) falta el punto `{key}` ([x, y]) +@msg missing points falta points +@msg missing points [[x,y]…] falta points [[x,y]…] +@msg missing segment falta segment +@msg missing stops falta stops +@msg missing subpaths falta subpaths +@msg missing target falta target +@msg missing to falta to +@msg missing x, y falta x, y +@msg mode is set, add or toggle, not `{other}` mode es set, add o toggle, no `{other}` +@msg mode must be "cmyk" or "rgb" mode debe ser "cmyk" o "rgb" +@msg mode must be area|onPath, got {o} mode debe ser area|onPath, se recibió {o} +@msg more than 10000 linked files: package dependencies in smaller parts más de 10000 archivos vinculados: empaqueta las dependencias en partes más pequeñas +@msg more than 256 commands más de 256 comandos +@msg more than {MAX_BATCH_FILES} data sets más de {MAX_BATCH_FILES} conjuntos de datos +@msg more than {MAX_BATCH_FILES} files más de {MAX_BATCH_FILES} archivos +@msg more than {MAX_CSV_ROWS} data rows más de {MAX_CSV_ROWS} filas de datos +@msg more than {MAX_FILES} images más de {MAX_FILES} imágenes +@msg more than {MAX_IMPORT} presets más de {MAX_IMPORT} preajustes +@msg moved must be [[x,y]…] moved debe ser [[x,y]…] +@msg name (a toolbar's name) is required name (el nombre de una barra de herramientas) es obligatorio +@msg name (a toolbar's name) must be a string name (el nombre de una barra de herramientas) debe ser una cadena +@msg name must be a toolbar's name name debe ser el nombre de una barra de herramientas +@msg names is empty names está vacío +@msg names must be an array of symbol names names debe ser una lista de nombres de símbolos +@msg need `anchor` or `segment` + `t` se necesita `anchor` o `segment` + `t` +@msg need at least one anchor se necesita al menos un punto de ancla +@msg need at least one point se necesita al menos un punto +@msg need at least two points se necesitan al menos dos puntos +@msg needs points necesita points +@msg nineSlice must be true or false nineSlice debe ser true o false +@msg nineSliceGuides must be [left, top, right, bottom], each -16..16, with left + right < 1 and top + bottom < 1 nineSliceGuides debe ser [left, top, right, bottom], cada uno -16..16, con left + right < 1 y top + bottom < 1 +@msg no PDF preset named `{n}` no hay ningún preajuste de PDF llamado `{n}` +@msg no action set is current no hay ningún conjunto de acciones actual +@msg no active data set no hay ningún conjunto de datos activo +@msg no appearance item {index} no existe el elemento de apariencia {index} +@msg no artboard {_1} no existe la mesa de trabajo {_1} +@msg no artboard {artboard} (0-based; the document has {_1}) no existe la mesa de trabajo {artboard} (empieza en 0; el documento tiene {_1}) +@msg no asset {id} no existe el recurso {id} +@msg no asset {id} (see assets.list) no existe el recurso {id} (consulta assets.list) +@msg no assets to export no hay recursos que exportar +@msg no assets yet: collect art for export first (assets.add) todavía no hay recursos: reúne antes ilustraciones para exportar (assets.add) +@msg no brush named `{n}` no hay ningún pincel llamado `{n}` +@msg no character at byte {start} no hay ningún carácter en el byte {start} +@msg no colour sin color +@msg no colour group `{group}` no existe el grupo de colores `{group}` +@msg no colour group `{name}` no existe el grupo de colores `{name}` +@msg no data sets no hay conjuntos de datos +@msg no dataset named `{from}` no hay ningún conjunto de datos llamado `{from}` +@msg no dataset named `{name}` no hay ningún conjunto de datos llamado `{name}` +@msg no datasets no hay conjuntos de datos +@msg no design named `{name}` no hay ningún diseño llamado `{name}` +@msg no design named `{n}` no hay ningún diseño llamado `{n}` +@msg no design named `{old}` no hay ningún diseño llamado `{old}` +@msg no encoder for {_1} yet todavía no hay codificador para {_1} +@msg no export preset `{name}` (see document.exportPresets.list) no existe el preajuste de exportación `{name}` (consulta document.exportPresets.list) +@msg no folder: pass `path` or set Preferences › Plug-ins & Scratch Disks › Additional Plug-ins Folder no hay carpeta: pasa `path` o define Preferencias › Plugins & Discos de memoria virtual › Carpeta de plugins adicionales +@msg no fonts to look for: they are all available no hay fuentes que buscar: todas están disponibles +@msg no formats to export no hay formatos que exportar +@msg no gradient preset `{name}` (see gradient.presets.list) no existe el preajuste de degradado `{name}` (consulta gradient.presets.list) +@msg no graphic style `{n}` in `{_1}` no existe el estilo gráfico `{n}` en `{_1}` +@msg no graphic style library `{key}` (see graphicStyle.libraries) no existe la biblioteca de estilos gráficos `{key}` (consulta graphicStyle.libraries) +@msg no guide selected no hay ninguna guía seleccionada +@msg no guide selected (or give an index) no hay ninguna guía seleccionada (o indica un índice) +@msg no guide {i} no existe la guía {i} +@msg no images in the folder no hay imágenes en la carpeta +@msg no item at index {_1} no hay ningún elemento en el índice {_1} +@msg no item at index {from} no hay ningún elemento en el índice {from} +@msg no item at one of the indices {idx} no hay ningún elemento en uno de los índices {idx} +@msg no layer no hay capa +@msg no layer {id} (see layer.list) no existe la capa {id} (consulta layer.list) +@msg no layers to export no hay capas que exportar +@msg no library `{key}` no existe la biblioteca `{key}` +@msg no metafile format no tiene formato de metarchivo +@msg no object {_1} no existe el objeto {_1} +@msg no objects no hay objetos +@msg no parent layer no hay capa principal +@msg no perspective grid preset named `{b}` (see perspective.presets.list) no hay ningún preajuste de cuadrícula de perspectiva llamado `{b}` (consulta perspective.presets.list) +@msg no perspective grid preset named `{n}` no hay ningún preajuste de cuadrícula de perspectiva llamado `{n}` +@msg no point selected (give `index`) no hay ningún punto seleccionado (indica `index`) +@msg no preset called `{from}` (see file.newPresets) no hay ningún preajuste llamado `{from}` (consulta file.newPresets) +@msg no preset called `{name}` (see file.newPresets) no hay ningún preajuste llamado `{name}` (consulta file.newPresets) +@msg no preset named `{n}` no hay ningún preajuste llamado `{n}` +@msg no print preset named `{b}` (see print.presets.list) no hay ningún preajuste de impresión llamado `{b}` (consulta print.presets.list) +@msg no print preset named `{name}` (presets: {_1}) no hay ningún preajuste de impresión llamado `{name}` (preajustes: {_1}) +@msg no print preset named `{n}` no hay ningún preajuste de impresión llamado `{n}` +@msg no profile named `{name}` no hay ningún perfil llamado `{name}` +@msg no readable files in the folder no hay archivos legibles en la carpeta +@msg no recovery copy `{f}` (see file.recovery.list) no existe la copia de recuperación `{f}` (consulta file.recovery.list) +@msg no rows no hay filas +@msg no saved PDF preset named `{name}` no hay ningún preajuste de PDF guardado llamado `{name}` +@msg no saved export preset `{name}` no existe el preajuste de exportación guardado `{name}` +@msg no saved gradient preset called {name} no hay ningún preajuste de degradado guardado llamado {name} +@msg no saved gradient presets no hay preajustes de degradado guardados +@msg no saved preset called `{name}` no hay ningún preajuste guardado llamado `{name}` +@msg no saved presets to export (name [Default] in `names` to export it) no hay preajustes guardados que exportar (nombra [Default] en `names` para exportarlo) +@msg no saved presets to export (name built-in ones in `names`) no hay preajustes guardados que exportar (nombra los integrados en `names`) +@msg no saved print preset named `{name}` no hay ningún preajuste de impresión guardado llamado `{name}` +@msg no saved profile called {name} no hay ningún perfil guardado llamado {name} +@msg no saved selection `{name}` no existe la selección guardada `{name}` +@msg no saved theme called {name} (see colorTheme.list) no hay ningún tema guardado llamado {name} (consulta colorTheme.list) +@msg no saved views no hay vistas guardadas +@msg no series {i} no existe la serie {i} +@msg no slice {n} in the image (see slice.list) no existe el sector {n} en la imagen (consulta slice.list) +@msg no source art no hay ilustración de origen +@msg no stop {i} (the gradient has {n}) no existe la parada {i} (el degradado tiene {n}) +@msg no style `{name}` no existe el estilo `{name}` +@msg no such assets (see assets.list) no existen esos recursos (consulta assets.list) +@msg no such frame anchor, or the frame would reach past the canvas no existe ese punto de ancla del marco, o el marco sobrepasaría el lienzo +@msg no such objects no existen esos objetos +@msg no such path anchor, or the path would reach past the canvas no existe ese punto de ancla del trazado, o el trazado sobrepasaría el lienzo +@msg no such rows no existen esas filas +@msg no swatch `{keep}` no existe la muestra `{keep}` +@msg no swatch `{n}` no existe la muestra `{n}` +@msg no swatch `{n}` (swatches and colour groups move separately) no existe la muestra `{n}` (las muestras y los grupos de colores se mueven por separado) +@msg no swatch library `{key}` (see swatch.library.list) no existe la biblioteca de muestras `{key}` (consulta swatch.library.list) +@msg no swatch library `{key}` (see swatch.library.list; "document": the document's swatches) no existe la biblioteca de muestras `{key}` (consulta swatch.library.list; "document": las muestras del documento) +@msg no swatch library `{key}` (see swatch.library.list; "{DOCUMENT_SWATCHES}": the document's swatches) no existe la biblioteca de muestras `{key}` (consulta swatch.library.list; "{DOCUMENT_SWATCHES}": las muestras del documento) +@msg no swatch named `{n}` no hay ninguna muestra llamada `{n}` +@msg no swatch or colour group `{n}` no existe la muestra ni el grupo de colores `{n}` +@msg no swatch or colour group `{n}` in `{_1}` no existe la muestra ni el grupo de colores `{n}` en `{_1}` +@msg no symbol named `{name}` no hay ningún símbolo llamado `{name}` +@msg no text objects selected no hay objetos de texto seleccionados +@msg no toolbar named `{_1}` no hay ninguna barra de herramientas llamada `{_1}` +@msg no toolbar named `{name}` no hay ninguna barra de herramientas llamada `{name}` +@msg no tracing preset `{preset}` (see imageTrace.presets) no existe el preajuste de calco `{preset}` (consulta imageTrace.presets) +@msg no user library folder here (save with a path, or without one to get the data) aquí no hay carpeta de bibliotecas de usuario (guarda con una ruta, o sin ella para obtener los datos) +@msg no variable named `{from}` no hay ninguna variable llamada `{from}` +@msg no variable named `{name}` no hay ninguna variable llamada `{name}` +@msg no variable named `{var}` no hay ninguna variable llamada `{var}` +@msg no variable named `{v}` no hay ninguna variable llamada `{v}` +@msg no view named `{name}` no hay ninguna vista llamada `{name}` +@msg node {_1} is not a graph el nodo {_1} no es un gráfico +@msg node {_1} is not an image el nodo {_1} no es una imagen +@msg node {_1} is not type el nodo {_1} no es texto +@msg not a PDF presets file (format `{_1}`) no es un archivo de preajustes de PDF (formato `{_1}`) +@msg not a PDF presets file: {e} no es un archivo de preajustes de PDF: {e} +@msg not a Word document: its WordDocument stream doesn't start with a file information block no es un documento de Word: su flujo WordDocument no empieza con un bloque de información de archivo +@msg not a Word document: its compound file has no WordDocument stream no es un documento de Word: su archivo compuesto no tiene flujo WordDocument +@msg not a Word document: its main part is not a WordprocessingML document no es un documento de Word: su parte principal no es un documento WordprocessingML +@msg not a Word document: its package has no main document part no es un documento de Word: su paquete no tiene parte de documento principal +@msg not a closed path no es un trazado cerrado +@msg not a flattener presets file (format `{_1}`) no es un archivo de preajustes de acoplador (formato `{_1}`) +@msg not a flattener presets file: {e} no es un archivo de preajustes de acoplador: {e} +@msg not a layer or group no es una capa ni un grupo +@msg not a library file: {e} no es un archivo de biblioteca: {e} +@msg not a mesh envelope point no es un punto de envolvente de malla +@msg not a perspective grid presets file (format `{_1}`) no es un archivo de preajustes de cuadrícula de perspectiva (formato `{_1}`) +@msg not a perspective grid presets file: {e} no es un archivo de preajustes de cuadrícula de perspectiva: {e} +@msg not a print presets file (format `{_1}`) no es un archivo de preajustes de impresión (formato `{_1}`) +@msg not a print presets file: {e} no es un archivo de preajustes de impresión: {e} +@msg not a stored or deflated central record no es un registro central almacenado ni comprimido con deflate +@msg not a valid SVGZ file: {e} no es un archivo SVGZ válido: {e} +@msg not an RTF file: it doesn't start with {\\rtf no es un archivo RTF: no empieza con {\\rtf +@msg not an image VectorCraft reads (see document.formats) no es una imagen que VectorCraft lea (consulta document.formats) +@msg not area type (text in a frame) outside perspective no es texto de área (texto en un marco) fuera de la perspectiva +@msg not editing an opacity mask no se está editando una máscara de opacidad +@msg not type on a path outside perspective no es texto en trazado fuera de la perspectiva +@msg nothing prints no se imprime nada +@msg nothing to bind nada que vincular +@msg nothing to change nada que cambiar +@msg nothing to change: give dx, dy, hScale, vScale or rotation nada que cambiar: indica dx, dy, hScale, vScale o rotation +@msg nothing to crop nada que recortar +@msg nothing to export nada que exportar +@msg nothing to export: the document has no visible art nada que exportar: el documento no tiene ilustración visible +@msg nothing to mark nada que marcar +@msg nothing to print: every artboard picked is blank nada que imprimir: todas las mesas de trabajo elegidas están en blanco +@msg nothing to print: the document has no art that prints nada que imprimir: el documento no tiene ilustración que se imprima +@msg object is not a path el objeto no es un trazado +@msg object transparency cannot be sampled onto highlighted characters; disable Transparency in Eyedropper Options or select the whole object la transparencia del objeto no se puede muestrear en los caracteres resaltados; desactiva Transparencia en Opciones de cuentagotas o selecciona el objeto completo +@msg object {_1} can't be set as point type el objeto {_1} no se puede establecer como texto de punto +@msg object {_1} has lost its file's contents: relink it el objeto {_1} perdió el contenido de su archivo: vuelve a vincularlo +@msg object {_1} has no path el objeto {_1} no tiene trazado +@msg object {_1} has no size el objeto {_1} no tiene tamaño +@msg object {_1} is hidden or locked, or on a locked artboard el objeto {_1} está oculto o bloqueado, o en una mesa de trabajo bloqueada +@msg object {_1} is not a placed document el objeto {_1} no es un documento colocado +@msg object {_1} is not an Intertwine group el objeto {_1} no es un grupo de Entrelazar +@msg object {_1} is not an image el objeto {_1} no es una imagen +@msg object {_1} is not an image or a linked file el objeto {_1} no es una imagen ni un archivo vinculado +@msg object {_1} is not an image or a placed document el objeto {_1} no es una imagen ni un documento colocado +@msg object {_1} is not in this Intertwine group el objeto {_1} no está en este grupo de Entrelazar +@msg object {_1} needs a 3D effect at index {index} el objeto {_1} necesita un efecto 3D en el índice {index} +@msg object {id} has anchors 0–{_1} for `corners`, not {past} el objeto {id} tiene los puntos de ancla 0–{_1} para `corners`, no {past} +@msg object {id} has {n} anchors, so no anchor {past} el objeto {id} tiene {n} puntos de ancla, así que no existe el punto de ancla {past} +@msg objects must be none, move or copy objects debe ser none, move o copy +@msg objects were left out se omitieron objetos +@msg offset out of range desplazamiento fuera de rango +@msg on must be true or false on debe ser true o false +@msg only groups, layers, type and images have a Contents (Characters) row solo los grupos, las capas, el texto y las imágenes tienen una fila Contenido (Caracteres) +@msg only interior mesh lines can be deleted solo se pueden eliminar las líneas de malla interiores +@msg only solid colours can be added (not gradients or patterns) solo se pueden agregar colores sólidos (no degradados ni motivos) +@msg only solid-colour swatches can be spot colours solo las muestras de color sólido pueden ser tintas planas +@msg only this Affinity file's embedded preview could be read: use File › Open to see it with its warning, or export SVG or PDF from Affinity first solo se pudo leer la vista previa incrustada de este archivo de Affinity: usa Archivo › Abrir para verla con su advertencia, o exporta antes SVG o PDF desde Affinity +@msg only this Affinity file's embedded preview could be read; use File › Open to see it with its warning solo se pudo leer la vista previa incrustada de este archivo de Affinity; usa Archivo › Abrir para verla con su advertencia +@msg onto, above, below, icon and a column place belong to window.panel.float and window.panel.dock onto, above, below, icon y una posición de columna corresponden a window.panel.float y window.panel.dock +@msg onto, above, below, icon and a column place take no anchor, side, zone or before onto, above, below, icon y una posición de columna no aceptan anchor, side, zone ni before +@msg onto, above, below, icon and a column place take no x, y, width or height onto, above, below, icon y una posición de columna no aceptan x, y, width ni height +@msg open a document to look for its linked files abre un documento para buscar sus archivos vinculados +@msg options must be an object (see file.formatOptions) options debe ser un objeto (consulta file.formatOptions) +@msg order must be leftToRight or rightToLeft order debe ser leftToRight o rightToLeft +@msg orientation must be portrait or landscape, not `{o}` orientation debe ser portrait o landscape, no `{o}` +@msg outlineText {v}: true or false outlineText {v}: true o false +@msg output intent profile: {e} perfil de calidad de salida: {e} +@msg output.destination: no RGB or CMYK profile is called “{name}” output.destination: ningún perfil RGB ni CMYK se llama “{name}” +@msg output.destination: {_1} files are CMYK, and “{name}” is an RGB profile output.destination: los archivos {_1} son CMYK, y “{name}” es un perfil RGB +@msg output.destination: {e} output.destination: {e} +@msg output.inks: no ink is set to print output.inks: ninguna tinta está configurada para imprimirse +@msg output.outputIntent: no profile is called “{name}”, and a {std} output intent embeds its profile output.outputIntent: ningún perfil se llama “{name}”, y una calidad de salida {std} incrusta su perfil +@msg output.outputIntent: no profile is called “{name}”: a {std} output intent embeds a profile, or names a registered printing condition (outputConditionId and registry) output.outputIntent: ningún perfil se llama “{name}”: una calidad de salida {std} incrusta un perfil o nombra una condición de impresión registrada (outputConditionId y registry) +@msg output.outputIntent: {std} files print in CMYK, and “{name}” is an RGB profile output.outputIntent: los archivos {std} se imprimen en CMYK, y “{name}” es un perfil RGB +@msg output.outputIntent: “{name}” is a grey profile, which can't be a {std} output intent output.outputIntent: “{name}” es un perfil de grises, que no puede ser una calidad de salida {std} +@msg overlap: {o} pt is half a tile or more overlap: {o} pt es medio mosaico o más +@msg overlapping Shaper paths must be in the same layer or group los trazados de Shaper superpuestos deben estar en la misma capa o el mismo grupo +@msg overlapping edits ediciones superpuestas +@msg page art conflicts with image data for {key} la ilustración de la página entra en conflicto con los datos de imagen de {key} +@msg page art conflicts with pattern {name} la ilustración de la página entra en conflicto con el motivo {name} +@msg page art conflicts with swatch {name} la ilustración de la página entra en conflicto con la muestra {name} +@msg page art is missing image data for {key} a la ilustración de la página le faltan los datos de imagen de {key} +@msg page art is missing pattern {name} a la ilustración de la página le falta el motivo {name} +@msg page art is missing swatch {name} a la ilustración de la página le falta la muestra {name} +@msg page must be a whole number from 1 page debe ser un número entero a partir de 1 +@msg page thumbnail: {e} miniatura de página: {e} +@msg page {page} of the PDF has no objects la página {page} del PDF no tiene objetos +@msg page {page}: `{file}` has {n} {artboards} página {page}: `{file}` tiene {n} {artboards} +@msg page {page}: `{name}` has {n} {pages} página {page}: `{name}` tiene {n} {pages} +@msg pages must be a range such as "2-3" or a page number, not {v} pages debe ser un intervalo como "2-3" o un número de página, no {v} +@msg pages: {e} pages: {e} +@msg panel position must be finite la posición del panel debe ser finita +@msg parameters must be an object los parámetros deben ser un objeto +@msg params must be an object params debe ser un objeto +@msg passwords can have up to {MAX_PASSWORD} bytes las contraseñas pueden tener hasta {MAX_PASSWORD} bytes +@msg path has no open end el trazado no tiene ningún extremo abierto +@msg paths must be strings paths deben ser cadenas +@msg pdfCompatible: false needs every artboard to keep the editable artwork pdfCompatible: false necesita que cada mesa de trabajo conserve la ilustración editable +@msg pdfs `{m}`: single or multiple pdfs `{m}`: single o multiple +@msg pickColorFrom is "artwork" or "swatches", not {v} pickColorFrom es "artwork" o "swatches", no {v} +@msg pins and moved must be non-empty lists of the same length pins y moved deben ser listas no vacías de la misma longitud +@msg pins must be [[x,y]…] pins debe ser [[x,y]…] +@msg pins must be finite pins deben ser finitos +@msg place is above, below or inside, not `{other}` place es above, below o inside, no `{other}` +@msg plane must be left|right|ground plane debe ser left|right|ground +@msg plane must be left|right|ground|none plane debe ser left|right|ground|none +@msg point is outside the mesh el punto está fuera de la malla +@msg points must be [t, left, right] with non-negative widths points debe ser [t, left, right] con anchuras no negativas +@msg points must be a non-empty [[x,y,pressure?]…] list points debe ser una lista [[x,y,pressure?]…] no vacía +@msg points must be a non-empty list of finite [x,y] points debe ser una lista no vacía de [x,y] finitos +@msg points must be an array or null points debe ser una matriz o null +@msg points must be finite points deben ser finitos +@msg points must be finite [x,y] pairs points deben ser pares [x,y] finitos +@msg points must contain 1–4096 coordinates points debe contener 1–4096 coordenadas +@msg position must be normal, superscript or subscript position debe ser normal, superscript o subscript +@msg position must be topLeft, topRight, bottomLeft or bottomRight position debe ser topLeft, topRight, bottomLeft o bottomRight +@msg positions must be between 0 and 100000 pt las posiciones deben estar entre 0 y 100000 pt +@msg ppi must be a positive number, not {ppi} ppi debe ser un número positivo, no {ppi} +@msg ppi must be between 1 and 2400 ppi debe estar entre 1 y 2400 +@msg preserve `{v}` is not transforms|bounds|fileDimensions|fit|fill preserve `{v}` no es transforms|bounds|fileDimensions|fit|fill +@msg preserveShape must be clippingMask|transparency preserveShape debe ser clippingMask|transparency +@msg preset `{id}`: mobile or density preajuste `{id}`: mobile o density +@msg preset must be standard, diffuse, topLeft or right preset debe ser standard, diffuse, topLeft o right +@msg preset must be the name of a print preset preset debe ser el nombre de un preajuste de impresión +@msg previewMode must be default, pixel or overprint previewMode debe ser default, pixel u overprint +@msg print settings: {e} ajustes de impresión: {e} +@msg procedures nest too deeply los procedimientos se anidan a demasiada profundidad +@msg procedures nested too deeply procedimientos anidados a demasiada profundidad +@msg quotes must be {double?, single?} quotes debe ser {double?, single?} +@msg quotes.{k} must be an opening and a closing quote, e.g. "“”" quotes.{k} debe ser unas comillas de apertura y de cierre, p. ej. "“”" +@msg rasterEffectsPpi must be 1–2400 (72 screen, 150 medium, 300 high) rasterEffectsPpi debe ser 1–2400 (72 pantalla, 150 media, 300 alta) +@msg rating must be a whole number from 0 to {MAX_RATING} rating debe ser un número entero entre 0 y {MAX_RATING} +@msg rect and {k} contradict each other: give the area or the artboards rect y {k} se contradicen: indica el área o las mesas de trabajo +@msg rect applies to raster formats, not {_1} rect se aplica a formatos rasterizados, no a {_1} +@msg rect is [x, y, width, height] in points rect es [x, y, width, height] en puntos +@msg rect must be [x, y, width, height] rect debe ser [x, y, width, height] +@msg rect must be [x, y, width, height] with a positive width and height rect debe ser [x, y, width, height] con anchura y altura positivas +@msg rect needs finite numbers and a positive width and height rect necesita números finitos y anchura y altura positivas +@msg redraw needs id redraw necesita id +@msg redraw within must be a finite distance of 0 or more within de redraw debe ser una distancia finita de 0 o más +@msg registration must be 0..8 registration debe ser 0..8 +@msg release a layer or a group suelta una capa o un grupo +@msg replace keeps the replaced object's place and transform: drop template, at and rect replace conserva la posición y la transformación del objeto sustituido: quita template, at y rect +@msg replace: select the one object to replace replace: selecciona el objeto que quieres sustituir +@msg resolution must be a number or screen|medium|high resolution debe ser un número o screen|medium|high +@msg resolution must be between 1 and 2400 ppi resolution debe estar entre 1 y 2400 ppi +@msg rotation must be a number of degrees rotation debe ser un número de grados +@msg rotation must be finite rotation debe ser finito +@msg rows and cols must be 1..50 rows y cols deben ser 1..50 +@msg rows and columns must be 1..500 rows y columns deben ser 1..500 +@msg rows of objects whose appearances differ can't be reordered together las filas de objetos cuyas apariencias difieren no se pueden reordenar juntas +@msg save the document first: Package collects a saved document guarda antes el documento: Empaquetar reúne un documento guardado +@msg save the document first: copy puts the file in its folder guarda antes el documento: copy pone el archivo en su carpeta +@msg savedPreset: {e} savedPreset: {e} +@msg scale `{s}`: a factor such as 2x, a width (100w), a height (100h) or a resolution (72ppi) scale `{s}`: un factor como 2x, una anchura (100w), una altura (100h) o una resolución (72ppi) +@msg scale must be a number above 0, at most 64 scale debe ser un número mayor que 0 y como máximo 64 +@msg scale must be non-zero scale no debe ser cero +@msg scope must be selection or all (got {other}) scope debe ser selection o all (se recibió {other}) +@msg scribble is too long el garabato es demasiado largo +@msg segment does not exist el segmento no existe +@msg select a Shaper group selecciona un grupo de Shaper +@msg select a blend to set easing or color shift selecciona una fusión para definir la aceleración o el cambio de color +@msg select a compound shape selecciona una forma compuesta +@msg select a graph selecciona un gráfico +@msg select a group or layer with visible, unlocked members selecciona un grupo o una capa con miembros visibles y desbloqueados +@msg select a layer selecciona una capa +@msg select a path selecciona un trazado +@msg select a text object selecciona un objeto de texto +@msg select an image (or an Image Trace group) selecciona una imagen (o un grupo de Calco de imagen) +@msg select an image, or pass id selecciona una imagen o pasa id +@msg select an object (or pass `id`) selecciona un objeto (o pasa `id`) +@msg select an object with a freeform gradient selecciona un objeto con un degradado de forma libre +@msg select an object with an opacity mask selecciona un objeto con una máscara de opacidad +@msg select area type selecciona texto de área +@msg select area type (text in a frame) selecciona texto de área (texto en un marco) +@msg select area type and closed paths (at least one area type object) selecciona texto de área y trazados cerrados (al menos un objeto de texto de área) +@msg select area type whose first line can fit its frame selecciona texto de área cuya primera línea quepa en su marco +@msg select artwork to add its colours selecciona ilustraciones para agregar sus colores +@msg select artwork to make a group of its colours selecciona ilustraciones para crear un grupo con sus colores +@msg select artwork to recolour, or give a colour `group` selecciona ilustraciones para volver a colorear, o indica un `group` de colores +@msg select exactly two path ends to join selecciona exactamente dos extremos de trazado para unirlos +@msg select members of a compound shape selecciona miembros de una forma compuesta +@msg select objects or give ids selecciona objetos o indica ids +@msg select objects to align to the guide selecciona objetos para alinearlos con la guía +@msg select one Intertwine group selecciona un grupo de Entrelazar +@msg select one image or pass id selecciona una imagen o pasa id +@msg select paths selecciona trazados +@msg select paths or compound paths selecciona trazados o trazados compuestos +@msg select rows or objects to collect selecciona filas u objetos para reunirlos +@msg select something to export selecciona algo que exportar +@msg select something to export (or turn off selectedOnly) selecciona algo que exportar (o desactiva selectedOnly) +@msg select text to redefine the style from selecciona el texto a partir del que redefinir el estilo +@msg select the art and, on top of it, the mask object selecciona la ilustración y, encima de ella, el objeto de máscara +@msg select the art for the design selecciona la ilustración para el diseño +@msg select the art for the pattern tile selecciona la ilustración para el mosaico del motivo +@msg select the art to add first selecciona antes la ilustración que quieres agregar +@msg select the art to collect (or give its ids) selecciona la ilustración que quieres reunir (o indica sus ids) +@msg select the content and a path on top selecciona el contenido y un trazado encima +@msg select the images to relink, or pass ids selecciona las imágenes que quieres volver a vincular o pasa ids +@msg select the images, or pass ids selecciona las imágenes o pasa ids +@msg select the linked images or placed documents, or pass ids selecciona las imágenes vinculadas o los documentos colocados, o pasa ids +@msg select the object to copy from selecciona el objeto desde el que copiar +@msg select the objects (or give their ids) selecciona los objetos (o indica sus ids) +@msg select the objects to attach to the path selecciona los objetos que quieres unir al trazado +@msg select the objects to bind selecciona los objetos que quieres vincular +@msg select two or more objects to intertwine selecciona dos o más objetos para entrelazarlos +@msg select two or more slices to combine selecciona dos o más sectores para combinarlos +@msg select type on a path selecciona texto en trazado +@msg selection `{m}`: one or each selección `{m}`: one o each +@msg settings is an object of document.exportForScreens params settings es un objeto de parámetros de document.exportForScreens +@msg settings must be an object settings debe ser un objeto +@msg show `{show}`: all, missing, modified or embedded show `{show}`: all, missing, modified o embedded +@msg show must be true or false show debe ser true o false +@msg size must be "small", "medium", "large" or a number of points over 0 up to {_1} size debe ser "small", "medium", "large" o un número de puntos mayor que 0 y de hasta {_1} +@msg size must be positive size debe ser positivo +@msg sizeMode is "fixed" or "pressure", not `{other}` sizeMode es "fixed" o "pressure", no `{other}` +@msg sizeMode is "fixed" or "pressure", not {other} sizeMode es "fixed" o "pressure", no {other} +@msg sizeVariation must be 0 or more sizeVariation debe ser 0 o más +@msg smallCaps must be true or false smallCaps debe ser true o false +@msg sort `{x}`: name, kind or status sort `{x}`: name, kind o status +@msg source paths are too large for Shaper los trazados de origen son demasiado grandes para Shaper +@msg spot, mode and group apply to solid colours only spot, mode y group solo se aplican a colores sólidos +@msg status `{s}`: linked, embedded, missing or modified status `{s}`: linked, embedded, missing o modified +@msg steps must be 1..1000 steps debe ser 1..1000 +@msg steps must be 1..{MAX_STEPS} steps debe ser 1..{MAX_STEPS} +@msg stop {i}: `plates` must be four numbers from 0 to 1 (C, M, Y, K) parada {i}: `plates` debe ser cuatro números entre 0 y 1 (C, M, Y, K) +@msg stopped before the archive was finished se detuvo antes de terminar el archivo comprimido +@msg strokeMode must be within|along|across, got {m} strokeMode debe ser within|along|across, se recibió {m} +@msg strokeOptions must be an object of stroke.set options strokeOptions debe ser un objeto de opciones de stroke.set +@msg strokeWidth must be a positive number of pixels strokeWidth debe ser un número positivo de píxeles +@msg subpath {si} is not an open subpath el subtrazado {si} no es un subtrazado abierto +@msg subpaths required when joining the same path se requieren subpaths al unir el mismo trazado +@msg swatchConflict must be "merge" or "add", not {v} swatchConflict debe ser "merge" o "add", no {v} +@msg text must be {characterSet?, platform?, removeLineReturns?, removeParagraphReturns?, replaceSpaces?} text debe ser {characterSet?, platform?, removeLineReturns?, removeParagraphReturns?, replaceSpaces?} +@msg text transform is collapsed or unrepresentable la transformación del texto está colapsada o no se puede representar +@msg text.replaceSpaces must be a whole number from 2 to 100 text.replaceSpaces debe ser un número entero entre 2 y 100 +@msg text.{key} `{v}`: use "{_1}" or "{_2}" text.{key} `{v}`: usa "{_1}" o "{_2}" +@msg textureImage: give {path} or {name, dataBase64} of an image file, or a texture as effect.list gives it textureImage: indica {path} o {name, dataBase64} de un archivo de imagen, o una textura tal como la da effect.list +@msg textureImage: {e} textureImage: {e} +@msg that makes more than {MAX_PIECES} slices eso genera más de {MAX_PIECES} sectores +@msg that object is not in the overlap ese objeto no está en la superposición +@msg the Affinity document has no page with a size el documento de Affinity no tiene ninguna página con tamaño +@msg the CMYK image couldn't be written no se pudo escribir la imagen CMYK +@msg the PDF security settings were saved without their passwords: give openPassword or permissionsPassword again, or security without passwordRequired to export unprotected los ajustes de seguridad del PDF se guardaron sin sus contraseñas: indica de nuevo openPassword o permissionsPassword, o security sin passwordRequired para exportar sin protección +@msg the RTF file has too many paragraphs or formatting changes to place as type (at most {MAX_PARAGRAPHS} paragraphs and {MAX_RUNS} runs) el archivo RTF tiene demasiados párrafos o cambios de formato para colocarlo como texto (como máximo {MAX_PARAGRAPHS} párrafos y {MAX_RUNS} tramos) +@msg the RTF file is too large to place as type (at most {_1} MB) el archivo RTF es demasiado grande para colocarlo como texto (como máximo {_1} MB) +@msg the SVG expands to more than {0} nested SVG images el SVG se expande en más de {0} imágenes SVG anidadas +@msg the SVG expands to more than {0} objects el SVG se expande en más de {0} objetos +@msg the SVG has no drawable objects el SVG no tiene objetos que se puedan dibujar +@msg the SVGZ file unpacks to more than {_1} MB el archivo SVGZ se descomprime en más de {_1} MB +@msg the Word document has more than {MAX_PAGES} pages of properties, too many to place el documento de Word tiene más de {MAX_PAGES} páginas de propiedades, demasiadas para colocarlo +@msg the Word document has more than {MAX_RUNS} runs of character or paragraph properties, too many to place el documento de Word tiene más de {MAX_RUNS} tramos de propiedades de carácter o de párrafo, demasiados para colocarlo +@msg the Word document has more than {_1} MB of formatting properties, too many to place el documento de Word tiene más de {_1} MB de propiedades de formato, demasiadas para colocarlo +@msg the Word document has too much text or formatting to place as type (at most {MAX_PARAGRAPHS} paragraphs, {MAX_RUNS} runs and {_1} MB of text) el documento de Word tiene demasiado texto o formato para colocarlo como texto (como máximo {MAX_PARAGRAPHS} párrafos, {MAX_RUNS} tramos y {_1} MB de texto) +@msg the Word document has too much text to place as type (at most {_1} MB) el documento de Word tiene demasiado texto para colocarlo como texto (como máximo {_1} MB) +@msg the Word document is encrypted or protected with a password; save it without one to place it el documento de Word está cifrado o protegido con contraseña; guárdalo sin ella para colocarlo +@msg the Word document is too large to place (its {name} stream holds more than {_1} MB) el documento de Word es demasiado grande para colocarlo (su flujo {name} contiene más de {_1} MB) +@msg the Word document was last saved with fast save, which VectorCraft doesn't read; save it again with fast save turned off el documento de Word se guardó por última vez con guardado rápido, que VectorCraft no lee; guárdalo de nuevo con el guardado rápido desactivado +@msg the Word document was saved by Word 6.0 or Word 95, which VectorCraft doesn't read; save it as a Word 97-2003 document el documento de Word se guardó con Word 6.0 o Word 95, que VectorCraft no lee; guárdalo como documento de Word 97-2003 +@msg the Word document's text is made of more than {MAX_PIECES} pieces, too many to place el texto del documento de Word consta de más de {MAX_PIECES} piezas, demasiadas para colocarlo +@msg the action set ids are not a list los ids de los conjuntos de acciones no son una lista +@msg the active paint is not a gradient la pintura activa no es un degradado +@msg the artboards don't fit on the canvas: fewer artboards, less spacing or a smaller size las mesas de trabajo no caben en el lienzo: usa menos mesas de trabajo, menos espaciado o un tamaño más pequeño +@msg the character's size can't be measured no se puede medir el tamaño del carácter +@msg the compound shape is too complex to expand la forma compuesta es demasiado compleja para expandirla +@msg the container of the listed objects is gone ya no existe el contenedor de los objetos enumerados +@msg the copy `{user_id}` can't be read as a library la copia `{user_id}` no se puede leer como biblioteca +@msg the copy would leave the canvas la copia saldría del lienzo +@msg the cut cannot be made on this art: {e} no se puede hacer el corte en esta ilustración: {e} +@msg the data isn't an EMF or WMF picture los datos no son una imagen EMF ni WMF +@msg the data isn't an EPS or PostScript picture los datos no son una imagen EPS ni PostScript +@msg the deferred paste is no longer available el pegado diferido ya no está disponible +@msg the design is too big to draw at every data point of this graph el diseño es demasiado grande para dibujarlo en cada punto de datos de este gráfico +@msg the design is too big to draw in every column of this graph el diseño es demasiado grande para dibujarlo en cada columna de este gráfico +@msg the dialog it was opened over is no longer open el cuadro de diálogo sobre el que se abrió ya no está abierto +@msg the dictionary stack overflowed la pila de diccionarios se desbordó +@msg the editing data's hash has no place el hash de los datos de edición no tiene lugar +@msg the entities the document declares expand to too much text las entidades que declara el documento se expanden en demasiado texto +@msg the envelope's content has no bounds el contenido de la envolvente no tiene límites +@msg the envelope's mesh is malformed la malla de la envolvente está mal formada +@msg the file holds no `variableSets` element el archivo no contiene ningún elemento `variableSets` +@msg the file is larger than {_1} MB el archivo ocupa más de {_1} MB +@msg the file is too large el archivo es demasiado grande +@msg the file was updated or encrypted already el archivo ya se actualizó o cifró +@msg the first character of a line has no character before it to kern: it moves only up and down (dy) el primer carácter de una línea no tiene ningún carácter delante con el que aplicar kerning: solo se mueve hacia arriba y hacia abajo (dy) +@msg the font {_1} is not available la fuente {_1} no está disponible +@msg the format has no file extension el formato no tiene extensión de archivo +@msg the graphic can't be read: {e} no se puede leer el gráfico: {e} +@msg the graphic is empty el gráfico está vacío +@msg the graphic's data is damaged los datos del gráfico están dañados +@msg the graphic's document has no artboard el documento del gráfico no tiene mesa de trabajo +@msg the header `{cell}` for `{name}` would read back as the variable `{other}`: rename one of them el encabezado `{cell}` de `{name}` se volvería a leer como la variable `{other}`: cambia el nombre de uno de ellos +@msg the image `{path}` isn't followed: {r} no se sigue la imagen `{path}`: {r} +@msg the image has no embedded pixels la imagen no tiene píxeles incrustados +@msg the image is empty la imagen está vacía +@msg the image is fully transparent la imagen es totalmente transparente +@msg the image is not on an artboard; pass rect la imagen no está en una mesa de trabajo; pasa rect +@msg the image's pixels are missing faltan los píxeles de la imagen +@msg the image's pixels aren't in the document los píxeles de la imagen no están en el documento +@msg the image's pixels can't be read: {e} no se pueden leer los píxeles de la imagen: {e} +@msg the image's transparency doesn't fit it la transparencia de la imagen no se ajusta a ella +@msg the job would print more than {MAX_PAGES} pages el trabajo imprimiría más de {MAX_PAGES} páginas +@msg the job would print more than {_1} pages el trabajo imprimiría más de {_1} páginas +@msg the layers hold no art to mask las capas no contienen ilustración que enmascarar +@msg the layout moved el diseño se movió +@msg the library has a group `{name}` already la biblioteca ya tiene un grupo `{name}` +@msg the library has no group `{name}` la biblioteca no tiene ningún grupo `{name}` +@msg the library has no item `{item}` la biblioteca no tiene ningún elemento `{item}` +@msg the library has no item `{other}` la biblioteca no tiene ningún elemento `{other}` +@msg the library holds {MAX_GROUPS} groups already la biblioteca ya contiene {MAX_GROUPS} grupos +@msg the library holds {MAX_ITEMS} items of this kind already la biblioteca ya contiene {MAX_ITEMS} elementos de este tipo +@msg the name is empty el nombre está vacío +@msg the object has no fill, stroke or effect el objeto no tiene relleno, trazo ni efecto +@msg the object has no graphic style (pass `name`) el objeto no tiene estilo gráfico (pasa `name`) +@msg the objects don't match the plan los objetos no coinciden con el plan +@msg the open and permissions passwords must differ las contraseñas de apertura y de permisos deben ser distintas +@msg the operand stack overflowed la pila de operandos se desbordó +@msg the page has no area la página no tiene área +@msg the page's type in an unread object's box isn't in its page art el texto de la página en el cuadro de un objeto no leído no está en la ilustración de su página +@msg the paint behind the proxy is not a gradient la pintura detrás del proxy no es un degradado +@msg the parent must be a layer or sublayer el elemento principal debe ser una capa o subcapa +@msg the path can't be extended el trazado no se puede extender +@msg the path can't be inside one of the objects to attach el trazado no puede estar dentro de uno de los objetos que se van a unir +@msg the path has no segments to measure el trazado no tiene segmentos que medir +@msg the path is empty el trazado está vacío +@msg the path is too short to shorten that much el trazado es demasiado corto para acortarlo tanto +@msg the picture has no objects la imagen no tiene objetos +@msg the program runs too long el programa se ejecuta durante demasiado tiempo +@msg the program uses too much memory el programa usa demasiada memoria +@msg the rectangle must have a width and a height el rectángulo debe tener anchura y altura +@msg the rectangle needs a size and must lie on the canvas el rectángulo necesita un tamaño y debe estar en el lienzo +@msg the selected art has no width la ilustración seleccionada no tiene anchura +@msg the selection draws nothing la selección no dibuja nada +@msg the selection has no area la selección no tiene área +@msg the selection has no art to export la selección no tiene ilustración que exportar +@msg the selection has no bounds la selección no tiene límites +@msg the selection has no graphic style la selección no tiene estilo gráfico +@msg the slice would leave the canvas el sector saldría del lienzo +@msg the spot colour couldn't be added no se pudo agregar la tinta plana +@msg the subpath has no ends to extend (it is closed or a single point) el subtrazado no tiene extremos que extender (está cerrado o es un solo punto) +@msg the symbols are nested too deeply to expand their instances los símbolos están anidados a demasiada profundidad para expandir sus instancias +@msg the text file is too large to place as type (at most {_1} MB) el archivo de texto es demasiado grande para colocarlo como texto (como máximo {_1} MB) +@msg the text is empty el texto está vacío +@msg the text is over {_1} MB el texto ocupa más de {_1} MB +@msg the top object must be a path el objeto superior debe ser un trazado +@msg the trace was cancelled se canceló el calco +@msg the trailer has no size el trailer no tiene tamaño +@msg the type object is flattened to nothing el objeto de texto se acopla en nada +@msg the value of axis `{tag}` must be a number or null el valor del eje `{tag}` debe ser un número o null +@msg the variable library declares more than {MAX_LIBRARY_DATASETS} data sets la biblioteca de variables declara más de {MAX_LIBRARY_DATASETS} conjuntos de datos +@msg the variable library declares more than {MAX_LIBRARY_ENTITIES} entities la biblioteca de variables declara más de {MAX_LIBRARY_ENTITIES} entidades +@msg the variable library declares more than {MAX_LIBRARY_VARIABLES} variables la biblioteca de variables declara más de {MAX_LIBRARY_VARIABLES} variables +@msg the variable library declares no variables la biblioteca de variables no declara variables +@msg the variable library is larger than {MAX_LIBRARY_BYTES} bytes la biblioteca de variables ocupa más de {MAX_LIBRARY_BYTES} bytes +@msg the variable library is not UTF-8 la biblioteca de variables no está en UTF-8 +@msg the variable library is not well-formed XML: {e} la biblioteca de variables no es XML bien formado: {e} +@msg the variable library nests elements more than {MAX_LIBRARY_NESTING} deep la biblioteca de variables anida elementos a más de {MAX_LIBRARY_NESTING} niveles +@msg the variable library's document type declaration holds something other than entities of plain text la declaración de tipo de documento de la biblioteca de variables contiene algo distinto de entidades de texto sin formato +@msg the variable library's entities expand to more than {MAX_LIBRARY_BYTES} bytes las entidades de la biblioteca de variables se expanden en más de {MAX_LIBRARY_BYTES} bytes +@msg the window has no dock la ventana no tiene acoplamiento +@msg the written PDF has no catalog el PDF escrito no tiene catálogo +@msg the written PDF has no cross-reference table el PDF escrito no tiene tabla de referencias cruzadas +@msg the written PDF's metadata can't be edited no se pueden editar los metadatos del PDF escrito +@msg there are no colour swatches to draw no hay muestras de color que dibujar +@msg there is already a design named `{name}` ya hay un diseño llamado `{name}` +@msg there is already a design named `{to}` ya hay un diseño llamado `{to}` +@msg there is already a toolbar named `{name}` ya hay una barra de herramientas llamada `{name}` +@msg there is already a toolbar named `{to}` ya hay una barra de herramientas llamada `{to}` +@msg there is no library: create one first no hay ninguna biblioteca: crea antes una +@msg these paths are too degenerate for Shaper estos trazados están demasiado degenerados para Shaper +@msg thumbnail: no page {v} (the {what} has {count}) miniatura: no existe la página {v} ({what} tiene {count}) +@msg tileRange of {what}: {e} tileRange de {what}: {e} +@msg title can't be empty title no puede estar vacío +@msg to (the new name) is required to (el nombre nuevo) es obligatorio +@msg to must be fill or stroke to debe ser fill o stroke +@msg to must be smooth or corner to debe ser smooth o corner +@msg too large for a zip archive: package to a folder demasiado grande para un archivo zip: empaqueta en una carpeta +@msg too many Shaper edits demasiadas ediciones de Shaper +@msg too many `points` (at most 100000) demasiados `points` (como máximo 100000) +@msg too many characters: at most {MAX_CHARS} demasiados caracteres: como máximo {MAX_CHARS} +@msg too many dots for this size: lower the frequency demasiados puntos para este tamaño: reduce la frecuencia +@msg too many filters over one file demasiados filtros sobre un archivo +@msg too many overlapping paths for Shaper demasiados trazados superpuestos para Shaper +@msg too many saved clips demasiados recortes guardados +@msg too many saved graphics states demasiados estados gráficos guardados +@msg toolbar (a toolbar's name) must be a string toolbar (el nombre de una barra de herramientas) debe ser una cadena +@msg toolbar name can't be empty el nombre de la barra de herramientas no puede estar vacío +@msg transparentImages {v}: "flatten" (the default) or "omit" transparentImages {v}: "flatten" (el predeterminado) u "omit" +@msg two saved selections would be named `{_1}` dos selecciones guardadas se llamarían `{_1}` +@msg type dimension cannot be represented with this text transform la dimensión del texto no se puede representar con esta transformación de texto +@msg type dimension must be finite la dimensión del texto debe ser finita +@msg unexpected resources recursos inesperados +@msg unknown CMYK profile `{name}` perfil CMYK desconocido `{name}` +@msg unknown File Info field `{k}` campo de Información de archivo desconocido `{k}` +@msg unknown OpenType feature `{t}` in featureChanges (the tags `features` takes) función OpenType desconocida `{t}` en featureChanges (las etiquetas que acepta `features`) +@msg unknown PDF preset `{name}` (presets: {_1}) preajuste de PDF desconocido `{name}` (preajustes: {_1}) +@msg unknown Warp style estilo de Deformación desconocido +@msg unknown alignToPath `{a}` alignToPath desconocido `{a}` +@msg unknown arrowhead {v} punta de flecha desconocida {v} +@msg unknown artboardLayout key `{k}` (layout, columns, spacing, rightToLeft) clave de artboardLayout desconocida `{k}` (layout, columns, spacing, rightToLeft) +@msg unknown attribute `{attribute}` atributo desconocido `{attribute}` +@msg unknown attribute `{k}` atributo desconocido `{k}` +@msg unknown axis `{other}` (vertical|horizontal|free) eje desconocido `{other}` (vertical|horizontal|free) +@msg unknown blend mode `{b}` modo de fusión desconocido `{b}` +@msg unknown blend mode {b} modo de fusión desconocido {b} +@msg unknown brush type `{o}` tipo de pincel desconocido `{o}` +@msg unknown category `{c}` categoría desconocida `{c}` +@msg unknown category `{c}` ({_1}) categoría desconocida `{c}` ({_1}) +@msg unknown character `{c}` carácter desconocido `{c}` +@msg unknown character style number field campo numérico de estilo de carácter desconocido +@msg unknown effect `{e}` efecto desconocido `{e}` +@msg unknown end {e} extremo desconocido {e} +@msg unknown flattenerPreset `{name}` (High Resolution, Medium Resolution, Low Resolution or a saved one: see flattener.presets.list) flattenerPreset desconocido `{name}` (High Resolution, Medium Resolution, Low Resolution o uno guardado: consulta flattener.presets.list) +@msg unknown format `{f}` (vcswatches, gpl, ase or css) formato desconocido `{f}` (vcswatches, gpl, ase o css) +@msg unknown from {f} from desconocido {f} +@msg unknown graph type `{t}` tipo de gráfico desconocido `{t}` +@msg unknown grid colours `{name}` (one of {_1}) colores de cuadrícula desconocidos `{name}` (uno de {_1}) +@msg unknown gridType `{t}` gridType desconocido `{t}` +@msg unknown highlight `{v}` resaltado desconocido `{v}` +@msg unknown intent `{i}` interpretación desconocida `{i}` +@msg unknown issue kind {id} tipo de problema desconocido {id} +@msg unknown issue kind {v} tipo de problema desconocido {v} +@msg unknown knockout state {k} estado de cobertura desconocido {k} +@msg unknown language `{language}` (one of {_1}) idioma desconocido `{language}` (uno de {_1}) +@msg unknown language `{l}` (one of {_1}) idioma desconocido `{l}` (uno de {_1}) +@msg unknown method `{m}` ({_1}) método desconocido `{m}` ({_1}) +@msg unknown mode `{other}` (gray, rgb, hsb, lab, cmyk or web) modo desconocido `{other}` (gray, rgb, hsb, lab, cmyk o web) +@msg unknown mode `{other}` (mono|cmyk) modo desconocido `{other}` (mono|cmyk) +@msg unknown mode `{other}` (rgb|cmyk|gray|global) modo desconocido `{other}` (rgb|cmyk|gray|global) +@msg unknown mode `{other}` (set, add, subtract) modo desconocido `{other}` (set, add, subtract) +@msg unknown mode `{o}` modo desconocido `{o}` +@msg unknown mode {m} modo desconocido {m} +@msg unknown model `{other}` modelo desconocido `{other}` +@msg unknown model `{other}` (keep, new or document) modelo desconocido `{other}` (keep, new o document) +@msg unknown op {o} op desconocido {o} +@msg unknown order `{o}`: toggle, front, forward, backward or back order desconocido `{o}`: toggle, front, forward, backward o back +@msg unknown overprints `{v}` (preserve, simulate or discard) overprints desconocido `{v}` (preserve, simulate o discard) +@msg unknown panel panel desconocido +@msg unknown pieLegend `{v}` (none, standard or wedges) pieLegend desconocido `{v}` (none, standard o wedges) +@msg unknown piePosition `{v}` (even, ratio or stacked) piePosition desconocido `{v}` (even, ratio o stacked) +@msg unknown pieSort `{v}` (none, all or first) pieSort desconocido `{v}` (none, all o first) +@msg unknown plate `{n}` plancha desconocida `{n}` +@msg unknown preference `{k}` preferencia desconocida `{k}` +@msg unknown profile {id} (see stroke.widthProfile.list) perfil desconocido {id} (consulta stroke.widthProfile.list) +@msg unknown proof target `{t}` destino de prueba desconocido `{t}` +@msg unknown quotes key `{k}` (double, single) clave de quotes desconocida `{k}` (double, single) +@msg unknown resolution `{v}` resolución desconocida `{v}` +@msg unknown rule `{rule}` ({_1}) regla desconocida `{rule}` ({_1}) +@msg unknown rule `{r}` (see color.harmony) regla desconocida `{r}` (consulta color.harmony) +@msg unknown setting `{k}` ajuste desconocido `{k}` +@msg unknown shape `{v}` (circle|ellipse|square|diamond|line) forma desconocida `{v}` (circle|ellipse|square|diamond|line) +@msg unknown spacing `{o}` (smooth|steps|distance) espaciado desconocido `{o}` (smooth|steps|distance) +@msg unknown tileType `{t}` ({_1}) tileType desconocido `{t}` ({_1}) +@msg unknown units unidades desconocidas +@msg unknown units `{u}` unidades desconocidas `{u}` +@msg unknown value axis `{v}` (left, right or both) eje de valores desconocido `{v}` (left, right o both) +@msg unknown variation `{v}` (tintsShades|warmCool|vividMuted) variación desconocida `{v}` (tintsShades|warmCool|vividMuted) +@msg unknown warp style `{s}` estilo de deformación desconocido `{s}` +@msg unknown {key} `{v}` (none, short or full) {key} desconocido `{v}` (none, short o full) +@msg unknown {key} profile `{n}` perfil {key} desconocido `{n}` +@msg unknown {k} key `{key}` (size, position) clave de {k} desconocida `{key}` (size, position) +@msg unreadable object objeto ilegible +@msg unsafe destination file name nombre de archivo de destino no seguro +@msg use paths or compound paths usa trazados o trazados compuestos +@msg useArtboards must be true or false, not {v} useArtboards debe ser true o false, no {v} +@msg value for `{var}` must match its variable kind el valor de `{var}` debe coincidir con el tipo de su variable +@msg variable `{_1}` is already defined la variable `{_1}` ya está definida +@msg variable `{name}` has no `trait` la variable `{name}` no tiene `trait` +@msg variable `{name}` is already defined la variable `{name}` ya está definida +@msg variable `{name}` is declared twice la variable `{name}` se declara dos veces +@msg variable `{to}` already exists ya existe la variable `{to}` +@msg view is required view es obligatorio +@msg view must be one of {_1} view debe ser uno de {_1} +@msg warpStyle can only edit an applied Warp effect warpStyle solo puede editar un efecto Deformación aplicado +@msg width and height must be more than 0 and at most {limit} width y height deben ser mayores que 0 y como máximo {limit} +@msg width factors must be finite los factores de anchura deben ser finitos +@msg width must be positive width debe ser positivo +@msg width out of range width fuera de rango +@msg width/height must be > 0 width/height deben ser > 0 +@msg x and y must be finite numbers x e y deben ser números finitos +@msg x and y must be given together x e y deben indicarse juntos +@msg zone needs an anchor: dock beside a panel with anchor, or in a new dock column with side (Start or End) zone necesita un anchor: acopla junto a un panel con anchor, o en una nueva columna de acoplamiento con side (Start o End) +@msg zoom must be positive zoom debe ser positivo +@msg {C}: no effect at index {list} {C}: no hay ningún efecto en el índice {list} +@msg {DEFAULT_PRESET} is protected and stays {DEFAULT_PRESET} está protegido y se conserva +@msg {DEFAULT_PRESET} is protected: save the settings under another name {DEFAULT_PRESET} está protegido: guarda los ajustes con otro nombre +@msg {LABEL} produced an empty result {LABEL} produjo un resultado vacío +@msg {_1} MB of document, at most {_2} MB {_1} MB de documento, como máximo {_2} MB +@msg {_1} MB of images, at most {_2} MB {_1} MB de imágenes, como máximo {_2} MB +@msg {_1} bytes of RGBA data for a {width} × {height} image {_1} bytes de datos RGBA para una imagen de {width} × {height} +@msg {_1} can't be read, or changed since it was read: relink or update it first {_1} no se puede leer o cambió desde que se leyó: vuelve a vincularlo o actualízalo antes +@msg {_1} can't go into {into} {_1} no puede ir dentro de {into} +@msg {_1} can't limit printing to low resolution: choose PDF 1.4 or later, or allow high-resolution printing {_1} no puede limitar la impresión a baja resolución: elige PDF 1.4 o posterior, o permite la impresión en alta resolución +@msg {_1} files can't be opened yet todavía no se pueden abrir archivos {_1} +@msg {_1} files can't be password-protected: remove the passwords or choose no standard los archivos {_1} no se pueden proteger con contraseña: quita las contraseñas o no elijas ningún estándar +@msg {_1} files can't be {_2} los archivos {_1} no pueden ser {_2} +@msg {_1} files can't carry editing data: turn off preserveEditing los archivos {_1} no pueden contener datos de edición: desactiva preserveEditing +@msg {_1} files can't have PDF layers: turn off createLayers los archivos {_1} no pueden tener capas PDF: desactiva createLayers +@msg {_1} files need a creation date, and this platform has no clock to give one los archivos {_1} necesitan una fecha de creación, y esta plataforma no tiene un reloj que la dé +@msg {_1} isn't a path {_1} no es un trazado +@msg {_1} options: {e} opciones de {_1}: {e} +@msg {_1} paints nothing to rasterize {_1} no pinta nada que rasterizar +@msg {_1} passwords can have up to {MAX_LEGACY_PASSWORD} ASCII characters (PDF 1.7 and later take any) las contraseñas de {_1} pueden tener hasta {MAX_LEGACY_PASSWORD} caracteres ASCII (PDF 1.7 y posteriores aceptan cualquiera) +@msg {_1} with linked images or an image map writes several files: use document.export {_1} con imágenes vinculadas o un mapa de imagen escribe varios archivos: usa document.export +@msg {_1} writes one file per artboard here: use document.export, or name one artboard {_1} escribe aquí un archivo por mesa de trabajo: usa document.export o nombra una mesa de trabajo +@msg {_1} × {_2} pixels is too large for {_3} (at most {max} pixels a side): lower the scale {_1} × {_2} píxeles es demasiado grande para {_3} (como máximo {max} píxeles por lado): reduce la escala +@msg {_1}: belongs to another account {_1}: pertenece a otra cuenta +@msg {_1}: not a folder of its own {_1}: no es una carpeta propia +@msg {_1}: not a plain file {_1}: no es un archivo normal +@msg {dest}: {e} {dest}: {e} +@msg {doc} has no folder {doc} no tiene carpeta +@msg {file} isn't linked {file} no está vinculado +@msg {folder} is not a package folder {folder} no es una carpeta de paquete +@msg {folder}: more than {max} files and folders {folder}: más de {max} archivos y carpetas +@msg {folder}: {e} {folder}: {e} +@msg {g} is not a Live Paint group {g} no es un grupo de Pintura interactiva +@msg {id} is not a slice {id} no es un sector +@msg {key} must be 0–{MAX_ADD_AROUND} pt {key} debe ser 0–{MAX_ADD_AROUND} pt +@msg {key} must be [x,y] {key} debe ser [x,y] +@msg {key} must be a percentage {min}..100 {key} debe ser un porcentaje {min}..100 +@msg {key} must be a positive number, not {n} {key} debe ser un número positivo, no {n} +@msg {key} must be a positive number, not {v} {key} debe ser un número positivo, no {v} +@msg {key} must be one of {_1} {key} debe ser uno de {_1} +@msg {key} must be {_1}, got {s} {key} debe ser {_1}, se recibió {s} +@msg {key} must name a floating panel {key} debe nombrar un panel flotante +@msg {key} must name a panel in another group {key} debe nombrar un panel de otro grupo +@msg {key} must name a panel that shows {key} debe nombrar un panel que se muestre +@msg {key} must name a registered panel {key} debe nombrar un panel registrado +@msg {kind} files have no transparency, and the file would have {what}: flatten it first (object.flattenTransparency) los archivos {kind} no tienen transparencia, y el archivo tendría {what}: acóplalo antes (object.flattenTransparency) +@msg {kind} images can't be opened (see document.formats) las imágenes {kind} no se pueden abrir (consulta document.formats) +@msg {k} `{v}` is not one of the choices {k} `{v}` no es una de las opciones +@msg {k} has control characters{_1} {k} tiene caracteres de control{_1} +@msg {k} is too long (at most {MAX_TEXT} characters) {k} es demasiado largo (como máximo {MAX_TEXT} caracteres) +@msg {k} must be > 0 {k} debe ser > 0 +@msg {k} must be a number (pt) or a length such as "210 mm" {k} debe ser un número (pt) o una longitud como "210 mm" +@msg {k} must be a number from {min} to {max} {k} debe ser un número entre {min} y {max} +@msg {k} must be a number or "auto" {k} debe ser un número o "auto" +@msg {k} must be a string {k} debe ser una cadena +@msg {k} must be text {k} debe ser texto +@msg {k} must be true or false {k} debe ser true o false +@msg {k} must be {{size?, position?}} {k} debe ser {{size?, position?}} +@msg {k}: can't read `{s}` as a length {k}: no se puede leer `{s}` como una longitud +@msg {label} must be a number at most {max} {label} debe ser un número de como máximo {max} +@msg {label} must be a number from -1296 to 1296 {label} debe ser un número entre -1296 y 1296 +@msg {label} must be a number from 1 to 10000 {label} debe ser un número entre 1 y 10000 +@msg {name} `{s}`: {ids} {name} `{s}`: {ids} +@msg {name} is built in and can't be deleted {name} está integrado y no se puede eliminar +@msg {name}: CRC or size mismatch {name}: el CRC o el tamaño no coinciden +@msg {name}: only this Affinity file's embedded preview could be read; use File › Open to see it with its warning, or export SVG or PDF from Affinity before placing {name}: solo se pudo leer la vista previa incrustada de este archivo de Affinity; usa Archivo › Abrir para verla con su advertencia, o exporta SVG o PDF desde Affinity antes de colocarlo +@msg {name}: {e} {name}: {e} +@msg {native}; its embedded preview can't be read either ({e}) {native}; tampoco se puede leer su vista previa incrustada ({e}) +@msg {std} files are CMYK, and the file would have colours in {_1} los archivos {std} son CMYK, y el archivo tendría colores en {_1} +@msg {std} files embed their fonts, and the file would have one that isn't los archivos {std} incrustan sus fuentes, y el archivo tendría una que no lo está +@msg {target} is the file this document was read from, and reading it left things out ({what}): writing over it would lose them for good. Write another file instead, or pass acknowledgeLoss: true to replace it anyway {target} es el archivo desde el que se leyó este documento, y al leerlo se omitieron cosas ({what}): sobrescribirlo las perdería para siempre. Escribe otro archivo en su lugar o pasa acknowledgeLoss: true para sustituirlo de todos modos +@msg {ty} brushes need selected art (or params.{k}) los pinceles {ty} necesitan ilustración seleccionada (o params.{k}) +@msg {v} is not an asset id {v} no es un id de recurso +@msg {what} can't be intertwined {what} no se puede entrelazar +@msg {what} doesn't fit the paper with its bleed and marks {what} no cabe en el papel con su sangrado y sus marcas +@msg {what} would print on more than {MAX_TILES} tiles: scale it down {what} se imprimiría en más de {MAX_TILES} mosaicos: redúcelo +@msg Alignment must be one of the choices Alineación debe ser una de las opciones +@msg Line Gap must be a number Separación entre líneas debe ser un número +@msg `at` must be a point [x, y] `at` debe ser un punto [x, y] +@msg `points` must hold from 2 to 100000 points `points` debe contener entre 2 y 100000 puntos +@msg `rect` must be [x, y, width, height] `rect` debe ser [x, y, width, height] +@msg `tolerance` must be from 0 to 100 pt `tolerance` debe estar entre 0 y 100 pt +@msg `warichuAlign` must be one of {_1} `warichuAlign` debe ser uno de estos: {_1} +@msg `warichuLines` must be a whole number from {_1} to {_2} `warichuLines` debe ser un número entero entre {_1} y {_2} +@msg bad point {v}: expected [x, y] punto incorrecto {v}: se esperaba [x, y] +@msg give exactly one of `at`, `rect` and `points` indica exactamente uno de `at`, `rect` y `points` +@msg the line is too long, or the paths it passes too many, to check la línea es demasiado larga, o pasa por demasiados trazados, para comprobarla +@msg the paths are too many or too tangled to find where they cross hay demasiados trazados, o están demasiado enredados, para hallar sus cruces +@msg the rectangle or line reaches too many paths to check el rectángulo o la línea alcanza demasiados trazados para comprobarlos +@msg {name} must be a number {name} debe ser un número diff --git a/crates/ui-egui/src/i18n/tests.rs b/crates/ui-egui/src/i18n/tests.rs index 43bfd50f1a..77ad0cbff1 100644 --- a/crates/ui-egui/src/i18n/tests.rs +++ b/crates/ui-egui/src/i18n/tests.rs @@ -1866,6 +1866,31 @@ fn messages_translate_by_template_and_their_parts() { assert_eq!(message(Lang::EN, nested), nested); } +/// Spanish shows the status and error messages of the script engine, the parameter checks, the +/// importers and the 3D effects in Spanish, with the values, names and command ids they carry kept. +#[test] +fn spanish_translates_engine_import_and_parameter_messages() { + let es = Lang::from_code("es").expect("registered"); + for (english, spanish) in [ + ("`colors` must be a whole number from 2 to 256", "`colors` debe ser un número entero entre 2 y 256"), + ("JSON.parse: oops (at offset 12)", "JSON.parse: oops (en el desplazamiento 12)"), + ("unknown mode `foo` (set, add, subtract)", "modo desconocido `foo` (set, add, subtract)"), + ( + "the Word document is encrypted or protected with a password; save it without one to place it", + "el documento de Word está cifrado o protegido con contraseña; guárdalo sin ella para colocarlo", + ), + ( + "object 7: with a depth of 0 the object has one face: map its graphics onto the front", + "objeto 7: con una profundidad de 0 el objeto tiene una sola cara: asigna sus gráficos a la parte frontal", + ), + ("no custom arrowhead Fin (see stroke.arrowheads.list)", "no existe la punta de flecha personalizada Fin (consulta stroke.arrowheads.list)"), + ("`warichuLines` must be a whole number from 1 to 6", "`warichuLines` debe ser un número entero entre 1 y 6"), + ("the rectangle or line reaches too many paths to check", "el rectángulo o la línea alcanza demasiados trazados para comprobarlos"), + ] { + assert_eq!(message(es, english), spanish); + } +} + /// The note `recolor.apply` and the Edit Colors commands give when they leave out locked or hidden /// objects is translated whole, its counts included, in every complete-message language. #[test] diff --git a/docs/localization-parity.md b/docs/localization-parity.md index cd8dc33f30..02f4e96418 100644 --- a/docs/localization-parity.md +++ b/docs/localization-parity.md @@ -28,7 +28,7 @@ Chinese by `imachus`). Only Georgian is recorded as reviewed by a native speaker |---|---|---|---|---|---|---|---| | English | `en` | source, 100% | all | Latin | — | full | — | | Simplified Chinese (Mandarin) | `zh-hans` | 5,102 rows, 791 of them `@msg` (counted 2026-10-21): menus, `tl!` literals and messages complete when counted | all | CJK UI font from craft-fonts (BIZ UDPGothic) when embedded, else a system font; IME with marked text at the caret; vertical type partial ([type-parity.md](type-parity.md)) | no | full | — (review) | -| Spanish | `es` | 4,009 / 4,020 (99.7%) | all (604 messages) | Latin | no | full | — (review) | +| Spanish | `es` | 4,009 / 4,020 (99.7%) | all (3,460 `@msg` and 48 `@msgplural` rows, counted 2026-11-13; the untranslated report lists two messages whose placeholders sit side by side, which no catalog row can match) | Latin | no | full | — (review) | | Hindi | `hi` | 8,782 rows (2026-11-13): 3,014 `@msg`, 47 `@msgplural`, 41 `@plural`; no gaps in the untranslated report | menus, dialogs, tooltips and scanned messages; contributor-approved loanword terminology; agent wording pass | UI and document text shape with HarfRust; installed desktop Devanagari fallback, or a `Deva` craft-fonts face; web font still needed | contributor terminology review; 2026-11-13 wording pass on messages and longer labels, with a glossary-term test; wider proofread welcome | complete catalog, machine-assisted draft | native review, layout and web font | | Arabic | `ar` | 0 | none | document text: bidi layout and Paragraph Direction; interface: no right-to-left layout, no Arabic shaping in egui | no | none | 25–40 | | French | `fr` | 4,020 / 4,020 (100%) | all | Latin | no | full | — (review) | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index e7c1b28726..78746b4499 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -870,6 +870,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - Hindi (2026-11-06): Hindi (`hi`): 7,877-row machine-assisted catalog, zero/one singular plurals, desktop font fallback and optional Devanagari craft-fonts fallback; all 55 translation tests pass; native review and a web font remain; scores and estimates unchanged. [Terminology and limitations](localization-hi.md). - Hindi wording (2026-11-13): rows outside the plug-in messages keep their English's meaning, quantities and clauses, and use the catalog's save, swatch, crop, resolution, path and type terms; a test checks those terms and the point unit in every row; native review remains; scores and estimates unchanged. - Hindi terms (2026-11-13): every row that names a variable (data merge, variable fonts and widths, environment variables) says वेरिएबल, and joining paths, anchor points, point type and lines says जोड़ें instead of शामिल हों, which stays for joining the community; a test checks both terms in every row; scores and estimates unchanged. + - Spanish messages (2026-11-13): the Spanish (`es`) catalog has an `@msg` row for 1,840 of the 1,842 status and error messages the untranslated report listed for it; the other two put two placeholders side by side, which a catalog row can't match, and stay in English; the rows keep their placeholders, backticked names, quoted values and command ids; native review remains; scores and estimates unchanged. - Window › Help Bar shows or hides the tool-help strip at the bottom of the window apart from the status bar (`window.helpBar`). Each setting is kept with the UI preferences and in saved workspaces, and Presentation Mode hides both bars. Layouts saved before the setting existed show the Help Bar where they show the status bar (`help_bar_toggle_is_independent_and_saved_in_workspaces`, `help_bar_and_status_bar_render_independently`, `legacy_help_bar_visibility_follows_each_layouts_status_bar`, `a_help_bar_setting_the_file_lacks_is_saved`). - Czech render-site labels: desktop/web file filters, diagnostics, suggested preset names and contributor tooltips/plurals now use catalog lookups; gradients have Czech adjective agreement and printer marks have a separate context (PDF/Print and Summary). Search, Home, toolbar/panel tooltips and Preferences already look up their labels. Every complete catalog has rows for these labels and for the Roman and Japanese printer mark styles. Evidence: `i18n::tests::czech_render_site_follow_up`, `i18n::tests::complete_catalogs_translate_render_site_labels`, `dialogs::tests_modal::printer_mark_labels_are_distinct_from_language_names`; see [localization-parity.md](localization-parity.md). - The History panel, Edit › Undo and Edit › Redo translate the names of the steps that apply or redefine a character or paragraph style and of the step that redefines a graphic style: each such step keeps its template (`Apply {name}`, `Redefine {name}`, `Redefine Graphic Style “{name}”`) and the style's name, every complete catalog has a row for each template, and the panel and the menu show the style's name as the document holds it, except the Normal styles' names, which they show in the interface language (`steps_named_after_a_style_list_the_template_around_the_name`, `undo_and_redo_name_a_style_step_around_the_style_name`). From e3ae1fb79fd9ff3548f6ffde6a165aad16b5428d Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 13 Nov 2026 16:01:07 -0800 Subject: [PATCH 002/102] i18n: Spanish leaves out the rows #7211, #7214 and #7116 add Open #7211, #7214 and #7116 add Spanish rows for 38 of the messages this branch translates. A second row for the same key fails bundled_catalogs_are_consistent once both sides merge, so this branch drops its 38 rows and leaves those messages to the other pull requests. The Spanish lines in docs/localization-parity.md and docs/target-app-parity.md give the new counts. --- crates/ui-egui/src/i18n/es.tsv | 38 ---------------------------------- docs/localization-parity.md | 2 +- docs/target-app-parity.md | 2 +- 3 files changed, 2 insertions(+), 40 deletions(-) diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index c9a5e5dc08..54aeb60961 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -7497,9 +7497,6 @@ breakText Glyphs Glifos @msg `{KEY}` must be a list `{KEY}` debe ser una lista @msg `{KEY}` takes at most {MAX_PARAGRAPH_INDENTS} entries (got {_1}) `{KEY}` acepta como máximo {MAX_PARAGRAPH_INDENTS} entradas (se recibió {_1}) @msg `{KEY}` takes no `{other}` beside it `{KEY}` no acepta `{other}` junto a él -@msg `{_1}` can't name a composite font `{_1}` no puede nombrar una fuente compuesta -@msg `{_1}` is the name of an installed font `{_1}` es el nombre de una fuente instalada -@msg `{_1}`: {_2} is set in `{font}`, a composite font `{_1}`: {_2} está compuesto en `{font}`, una fuente compuesta @msg `{base}` is larger than {_1} MB `{base}` ocupa más de {_1} MB @msg `{base}` is not in the DCS file's folder `{base}` no está en la carpeta del archivo DCS @msg `{key}` holds more than {MAX_EDIT_WORDS} words `{key}` contiene más de {MAX_EDIT_WORDS} palabras @@ -7518,20 +7515,13 @@ breakText Glyphs Glifos @msg `{key}` must name an object attached to the path of an Objects on Path group `{key}` debe nombrar un objeto unido al trazado de un grupo de Objetos en trazado @msg `{key}` names an object that is hidden or locked `{key}` nombra un objeto que está oculto o bloqueado @msg `{name}` is a file of its own, which can only be found next to the DCS file's path `{name}` es un archivo independiente, que solo se puede encontrar junto a la ruta del archivo DCS -@msg `{name}`: give the kanji part `{name}`: indica la parte kanji -@msg `{name}`: parts must be an object `{name}`: las partes deben ser un objeto -@msg `{name}`: unknown class `{k}`; the classes are kanji, kana, punctuation, symbols, roman and numerals `{name}`: clase desconocida `{k}`; las clases son kanji, kana, punctuation, symbols, roman y numerals -@msg `{name}`: unknown key `{k}` in {_1} `{name}`: clave desconocida `{k}` en {_1} -@msg `{name}`: {_1} must be an object `{name}`: {_1} debe ser un objeto @msg `{name}`: {_1}: {e} `{name}`: {_1}: {e} -@msg `{raw}` can't name a composite font (1 to {COMPOSITE_NAME_MAX} characters, no control characters) `{raw}` no puede nombrar una fuente compuesta (de 1 a {COMPOSITE_NAME_MAX} caracteres, sin caracteres de control) @msg `{u}` is no Unicode character `{u}` no es un carácter Unicode @msg `{word}` isn't in the custom dictionary `{word}` no está en el diccionario personalizado @msg a CMap has too many mappings un CMap tiene demasiadas asignaciones @msg a \\u escape needs four hexadecimal digits un escape \\u necesita cuatro dígitos hexadecimales @msg a comma in an XPath expression must separate function arguments una coma en una expresión XPath debe separar argumentos de función @msg a document holds at most {_1} SVG filters un documento contiene como máximo {_1} filtros SVG -@msg a document keeps at most {COMPOSITE_FONTS_MAX} composite fonts un documento guarda como máximo {COMPOSITE_FONTS_MAX} fuentes compuestas @msg a document with unsaved changes has no recovery copy un documento con cambios sin guardar no tiene copia de recuperación @msg a font's data is too large los datos de una fuente son demasiado grandes @msg a font's subroutines are too large las subrutinas de una fuente son demasiado grandes @@ -7579,15 +7569,11 @@ breakText Glyphs Glifos @msg character dimensions cannot be represented with the target text transform las dimensiones de los caracteres no se pueden representar con la transformación del texto de destino @msg continuation must be an array of path chunks continuation debe ser una lista de fragmentos de trazado @msg continuation requires points continuation requiere points -@msg dataBase64 is not base64 dataBase64 no está en base64 -@msg each font must be {name, parts} cada fuente debe ser {name, parts} -@msg each font needs a name cada fuente necesita un nombre @msg each path chunk must contain 1 to 4096 points cada fragmento de trazado debe contener entre 1 y 4096 puntos @msg each pick is {{at: [x, y]}} or {{rect: [x0, y0, x1, y1]}} (got {v}) cada elección es {{at: [x, y]}} o {{rect: [x0, y0, x1, y1]}} (se recibió {v}) @msg each weight must be a number of 0 or more (got {v}) cada peso debe ser un número de 0 o más (se recibió {v}) @msg finally table {t} out of range tabla finally {t} fuera de rango @msg flags cannot be given with a RegExp object no se pueden indicar indicadores con un objeto RegExp -@msg fonts must be a list of composite fonts fonts debe ser una lista de fuentes compuestas @msg function declaration index out of range índice de declaración de función fuera de rango @msg give `char`, `text`, `code` or `unicode` indica `char`, `text`, `code` o `unicode` @msg give `count` or `spacing`, not both indica `count` o `spacing`, no ambos @@ -7595,10 +7581,8 @@ breakText Glyphs Glifos @msg give `path`, an SVG file, or `svg`, SVG text indica `path`, un archivo SVG, o `svg`, texto SVG @msg give `xml`, one SVG element indica `xml`, un elemento SVG @msg give exactly one of `path`, `data` and `dataBase64` indica exactamente uno de `path`, `data` y `dataBase64` -@msg give fonts: [{name, parts}…] indica fonts: [{name, parts}…] @msg give index or indexes, not both indica index o indexes, no ambos @msg give one element indica un elemento -@msg give one of path, data or dataBase64 indica uno de path, data o dataBase64 @msg give opacity or blend indica opacity o blend @msg handler at {_1} expects {_2} values but its range starts with {d} el controlador en {_1} espera {_2} valores, pero su rango empieza con {d} @msg handler depth too large profundidad de controlador demasiado grande @@ -7643,8 +7627,6 @@ breakText Glyphs Glifos @msg must be an object with `kind` and `value` debe ser un objeto con `kind` y `value` @msg must have `kind` alert, confirm or prompt debe tener `kind` alert, confirm o prompt @msg must have exactly `kind` and `value` debe tener exactamente `kind` y `value` -@msg names must be a list of names names debe ser una lista de nombres -@msg names must be strings names deben ser cadenas @msg needs a closing quote after the name necesita unas comillas de cierre después del nombre @msg needs a name necesita un nombre @msg needs a name of at most 64 bytes necesita un nombre de como máximo 64 bytes @@ -7656,9 +7638,6 @@ breakText Glyphs Glifos @msg no SVG filter at index {k} no hay ningún filtro SVG en el índice {k} @msg no arrowheads file here aquí no hay ningún archivo de puntas de flecha @msg no character has code {code} ningún carácter tiene el código {code} -@msg no composite font no hay ninguna fuente compuesta -@msg no composite font named `{n}` no hay ninguna fuente compuesta llamada `{n}` -@msg no composite fonts to export no hay fuentes compuestas que exportar @msg no custom arrowhead {name} (see stroke.arrowheads.list) no existe la punta de flecha personalizada {name} (consulta stroke.arrowheads.list) @msg no file to open no hay ningún archivo que abrir @msg no instructions sin instrucciones @@ -7670,8 +7649,6 @@ breakText Glyphs Glifos @msg node {_1} already has the text variable `{_2}` el nodo {_1} ya tiene la variable de texto `{_2}` @msg not a DCS file no es un archivo DCS @msg not a RegExp object no es un objeto RegExp -@msg not a composite fonts file: no compositeFonts list no es un archivo de fuentes compuestas: no hay lista compositeFonts -@msg not a composite fonts file: {e} no es un archivo de fuentes compuestas: {e} @msg not a regular expression no es una expresión regular @msg not an action set: the text doesn't start with /version and a number no es un conjunto de acciones: el texto no empieza con /version y un número @msg nothing to repeat nada que repetir @@ -7686,7 +7663,6 @@ breakText Glyphs Glifos @msg operand too large operando demasiado grande @msg order is a whole number from 0 to {others}, not `{v}` order es un número entero entre 0 y {others}, no `{v}` @msg path chunks must share their boundary point los fragmentos de trazado deben compartir su punto límite -@msg path is empty el trazado está vacío @msg pdfCompatible: false needs the artboards to keep the editable artwork when useArtboards is false pdfCompatible: false necesita que las mesas de trabajo conserven la ilustración editable cuando useArtboards es false @msg point x must be a number el punto x debe ser un número @msg point y must be a number el punto y debe ser un número @@ -7738,10 +7714,6 @@ breakText Glyphs Glifos @msg the document has no SVG filter named {r} el documento no tiene ningún filtro SVG llamado {r} @msg the document has no color swatches el documento no tiene muestras de color @msg the document's swatches hold {_1} colors; the document reduction takes at most 255 las muestras del documento contienen {_1} colores; la reducción del documento acepta como máximo 255 -@msg the file holds more than {COMPOSITE_FONTS_MAX} composite fonts el archivo contiene más de {COMPOSITE_FONTS_MAX} fuentes compuestas -@msg the file holds no composite fonts el archivo no contiene fuentes compuestas -@msg the file holds two composite fonts named `{_1}` el archivo contiene dos fuentes compuestas llamadas `{_1}` -@msg the file is larger than 4 MB el archivo ocupa más de 4 MB @msg the file isn't valid SVG: {e} el archivo no es un SVG válido: {e} @msg the file names no plate el archivo no nombra ninguna plancha @msg the function's prototype is not an object el prototipo de la función no es un objeto @@ -7787,10 +7759,8 @@ breakText Glyphs Glifos @msg toString is not a function toString no es una función @msg too many arguments demasiados argumentos @msg too many quantifiers demasiados cuantificadores -@msg two composite fonts are named `{_1}` dos fuentes compuestas se llaman `{_1}` @msg unknown OpenType feature `{t}` (liga, calt, dlig, smcp, frac, onum, tnum, ordn, swsh, ss01–ss20, salt, titl, pnum, lnum, sups, subs, numr, dnom, aalt; prefix - to turn off; swsh, ss01–ss20, salt, titl, pnum, lnum, sups, subs, numr, dnom and aalt take an alternate's number as `tag=N` with N from 0 to {_1}, as `salt=2`) función OpenType desconocida `{t}` (liga, calt, dlig, smcp, frac, onum, tnum, ordn, swsh, ss01–ss20, salt, titl, pnum, lnum, sups, subs, numr, dnom, aalt; antepón - para desactivarla; swsh, ss01–ss20, salt, titl, pnum, lnum, sups, subs, numr, dnom y aalt aceptan el número de una alternativa como `tag=N` con N entre 0 y {_1}, como `salt=2`) @msg unknown dither `{d}` (diffusion, pattern, noise or none) tramado desconocido `{d}` (diffusion, pattern, noise o none) -@msg unknown key `{k}`; a font takes name and parts clave desconocida `{k}`; una fuente acepta name y parts @msg unknown panel `{panel}` panel desconocido `{panel}` @msg unknown parameter `{key}` parámetro desconocido `{key}` @msg unknown parameter `{within}settings.{format}`; {why} parámetro desconocido `{within}settings.{format}`; {why} @@ -7810,13 +7780,7 @@ breakText Glyphs Glifos @msg {k}: a custom arrowhead's path needs an area to fill and at most {most} anchors and {most} subpaths, each anchor within {far} head units of its tip {k}: el trazado de una punta de flecha personalizada necesita un área que rellenar y como máximo {most} puntos de ancla y {most} subtrazados, cada punto de ancla a no más de {far} unidades de cabeza de su punta @msg {k}: bad custom arrowhead path: {e} {k}: trazado de punta de flecha personalizada incorrecto: {e} @msg {k}: bad custom arrowhead: {e} {k}: punta de flecha personalizada incorrecta: {e} -@msg {k}: baseline must be {_1} to {_2}% {k}: baseline debe estar entre {_1} y {_2}% @msg {k}: custom must be a name {k}: custom debe ser un nombre -@msg {k}: give a font {k}: indica una fuente -@msg {k}: only kana can be scaled at the center {k}: solo el kana se puede escalar desde el centro -@msg {k}: only kana, roman and numerals can be scaled {k}: solo se pueden escalar kana, roman y numerals -@msg {k}: scale must be {_1} to {_2}% {k}: scale debe estar entre {_1} y {_2}% -@msg {k}: size must be {_1} to {_2}% {k}: size debe estar entre {_1} y {_2}% @msg {path}: copy takes a DCS file only when its plates are inside it; relink to it where its plate files are {path}: copy solo acepta un archivo DCS cuando sus planchas están dentro de él; vuelve a vincularlo donde estén sus archivos de planchas @msg {path}: larger than {_1} MB {path}: ocupa más de {_1} MB @msg {shown} is not an XPath 1.0 function {shown} no es una función de XPath 1.0 @@ -8085,7 +8049,6 @@ breakText Glyphs Glifos @msg `{name}` is a working space: choose another with edit.colorSettings first `{name}` es un espacio de trabajo de color: elige antes otro con edit.colorSettings @msg `{name}` is built in and stays `{name}` está integrado y se conserva @msg `{name}` takes a paint of its own kind (colour, gradient or pattern) `{name}` acepta una pintura de su mismo tipo (color, degradado o motivo) -@msg `{name}`: Minimum must not exceed Desired, nor Desired Maximum `{name}`: Mínimo no debe superar a Deseado, ni Deseado a Máximo @msg `{n}` can't be deleted `{n}` no se puede eliminar @msg `{n}` can't be merged `{n}` no se puede combinar @msg `{n}` can't be moved `{n}` no se puede mover @@ -8836,7 +8799,6 @@ breakText Glyphs Glifos @msg select a graph selecciona un gráfico @msg select a group or layer with visible, unlocked members selecciona un grupo o una capa con miembros visibles y desbloqueados @msg select a layer selecciona una capa -@msg select a path selecciona un trazado @msg select a text object selecciona un objeto de texto @msg select an image (or an Image Trace group) selecciona una imagen (o un grupo de Calco de imagen) @msg select an image, or pass id selecciona una imagen o pasa id diff --git a/docs/localization-parity.md b/docs/localization-parity.md index 02f4e96418..f847b9451d 100644 --- a/docs/localization-parity.md +++ b/docs/localization-parity.md @@ -28,7 +28,7 @@ Chinese by `imachus`). Only Georgian is recorded as reviewed by a native speaker |---|---|---|---|---|---|---|---| | English | `en` | source, 100% | all | Latin | — | full | — | | Simplified Chinese (Mandarin) | `zh-hans` | 5,102 rows, 791 of them `@msg` (counted 2026-10-21): menus, `tl!` literals and messages complete when counted | all | CJK UI font from craft-fonts (BIZ UDPGothic) when embedded, else a system font; IME with marked text at the caret; vertical type partial ([type-parity.md](type-parity.md)) | no | full | — (review) | -| Spanish | `es` | 4,009 / 4,020 (99.7%) | all (3,460 `@msg` and 48 `@msgplural` rows, counted 2026-11-13; the untranslated report lists two messages whose placeholders sit side by side, which no catalog row can match) | Latin | no | full | — (review) | +| Spanish | `es` | 4,009 / 4,020 (99.7%) | all (3,430 `@msg` and 48 `@msgplural` rows, counted 2026-11-13; the untranslated report lists 50 missing messages for it) | Latin | no | full | — (review) | | Hindi | `hi` | 8,782 rows (2026-11-13): 3,014 `@msg`, 47 `@msgplural`, 41 `@plural`; no gaps in the untranslated report | menus, dialogs, tooltips and scanned messages; contributor-approved loanword terminology; agent wording pass | UI and document text shape with HarfRust; installed desktop Devanagari fallback, or a `Deva` craft-fonts face; web font still needed | contributor terminology review; 2026-11-13 wording pass on messages and longer labels, with a glossary-term test; wider proofread welcome | complete catalog, machine-assisted draft | native review, layout and web font | | Arabic | `ar` | 0 | none | document text: bidi layout and Paragraph Direction; interface: no right-to-left layout, no Arabic shaping in egui | no | none | 25–40 | | French | `fr` | 4,020 / 4,020 (100%) | all | Latin | no | full | — (review) | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 962dabffda..18d8500c63 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -876,7 +876,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - Hindi wording (2026-11-13): rows outside the plug-in messages keep their English's meaning, quantities and clauses, and use the catalog's save, swatch, crop, resolution, path and type terms; a test checks those terms and the point unit in every row; native review remains; scores and estimates unchanged. - Hindi terms (2026-11-13): every row that names a variable (data merge, variable fonts and widths, environment variables) says वेरिएबल, and joining paths, anchor points, point type and lines says जोड़ें instead of शामिल हों, which stays for joining the community; a test checks both terms in every row; scores and estimates unchanged. - Hindi English words (2026-11-13): 264 rows no longer keep English words in their sentences, repeat a parameter's name in Hindi or garble them, among them "unknown align", which now names the alignment; lists of accepted values such as `(left|right|top|bottom)` stay as their English writes them; two tests check every row; native review remains; scores and estimates unchanged. - - Spanish messages (2026-11-13): the Spanish (`es`) catalog has an `@msg` row for 1,840 of the 1,842 status and error messages the untranslated report listed for it; the other two put two placeholders side by side, which a catalog row can't match, and stay in English; the rows keep their placeholders, backticked names, quoted values and command ids; native review remains; scores and estimates unchanged. + - Spanish messages (2026-11-13): the Spanish (`es`) catalog has an `@msg` row for 1,802 of the 1,842 status and error messages the untranslated report listed for it; 38 are the composite font, select-a-path and justification order errors that open #7211, #7214 and #7116 translate, and the other two put two placeholders side by side, which a catalog row can't match, and stay in English; the rows keep their placeholders, backticked names, quoted values and command ids; native review remains; scores and estimates unchanged. - Window › Help Bar shows or hides the tool-help strip at the bottom of the window apart from the status bar (`window.helpBar`). Each setting is kept with the UI preferences and in saved workspaces, and Presentation Mode hides both bars. Layouts saved before the setting existed show the Help Bar where they show the status bar (`help_bar_toggle_is_independent_and_saved_in_workspaces`, `help_bar_and_status_bar_render_independently`, `legacy_help_bar_visibility_follows_each_layouts_status_bar`, `a_help_bar_setting_the_file_lacks_is_saved`). - Czech render-site labels: desktop/web file filters, diagnostics, suggested preset names and contributor tooltips/plurals now use catalog lookups; gradients have Czech adjective agreement and printer marks have a separate context (PDF/Print and Summary). Search, Home, toolbar/panel tooltips and Preferences already look up their labels. Every complete catalog has rows for these labels and for the Roman and Japanese printer mark styles. Evidence: `i18n::tests::czech_render_site_follow_up`, `i18n::tests::complete_catalogs_translate_render_site_labels`, `dialogs::tests_modal::printer_mark_labels_are_distinct_from_language_names`; see [localization-parity.md](localization-parity.md). - The History panel, Edit › Undo and Edit › Redo translate the names of the steps that apply or redefine a character or paragraph style and of the step that redefines a graphic style: each such step keeps its template (`Apply {name}`, `Redefine {name}`, `Redefine Graphic Style “{name}”`) and the style's name, every complete catalog has a row for each template, and the panel and the menu show the style's name as the document holds it, except the Normal styles' names, which they show in the interface language (`steps_named_after_a_style_list_the_template_around_the_name`, `undo_and_redo_name_a_style_step_around_the_style_name`). From 09a8d3d6d28a07d990b806fc3bb7f46e303f0ed8 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 14 Nov 2026 19:49:33 -0800 Subject: [PATCH 003/102] Docs: one Spanish row in the localization table, with its current counts --- docs/localization-parity.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/localization-parity.md b/docs/localization-parity.md index 5f97c9d57f..5f5d448256 100644 --- a/docs/localization-parity.md +++ b/docs/localization-parity.md @@ -30,8 +30,7 @@ Chinese by `imachus`). Georgian and the original Gujarati catalog are recorded a |---|---|---|---|---|---|---|---| | English | `en` | source, 100% | all | Latin | — | full | — | | Simplified Chinese (Mandarin) | `zh-hans` | 5,102 rows, 791 of them `@msg` (counted 2026-10-21): menus, `tl!` literals and messages complete when counted | all (3,554 `@msg` and 48 `@msgplural` rows, counted 2026-11-13: the untranslated report lists 55 missing messages for it, which open #7116, #7211, #7330, #7378 and #7405 translate) | CJK UI font from craft-fonts (BIZ UDPGothic) when embedded, else a system font; IME with marked text at the caret; vertical type partial ([type-parity.md](type-parity.md)) | no | full | — (review) | -| Spanish | `es` | 4,009 / 4,020 (99.7%) | all (3,430 `@msg` and 48 `@msgplural` rows, counted 2026-11-13; the untranslated report lists 50 missing messages for it) | Latin | no | full | — (review) | -| Spanish | `es` | 4,009 / 4,020 (99.7%) | all (604 messages) | Latin | no | full | — (review) | +| Spanish | `es` | 4,009 / 4,020 (99.7%) | all (3,556 `@msg` and 49 `@msgplural` rows, counted 2026-11-14: the untranslated report lists 145 messages without a Spanish row, 33 in its own section and 112 that every checked language lacks) | Latin | no | full | — (review) | | Hindi | `hi` | 8,782 rows (2026-11-13): 3,014 `@msg`, 47 `@msgplural`, 41 `@plural`; the untranslated report on main `f793044f83` (2026-11-14) lists 676 missing rows for it: 608 in its own section and 68 that every checked language lacks | menus, dialogs, tooltips and scanned messages; contributor-approved loanword terminology; agent wording pass | UI and document text shape with HarfRust; installed desktop Devanagari fallback, or a `Deva` craft-fonts face; web font still needed | contributor terminology review; 2026-11-13 wording pass on messages and longer labels, and a word-sense pass on short labels, with a glossary-term test; wider proofread welcome | complete catalog, machine-assisted draft | reported missing rows, native review, layout and web font | | Gujarati | `gu` | 4,673 rows (2026-11-14): original 4,286 unchanged; all 387 additions contributor-reviewed and approved | menus and dialogs; status/error messages partial | installed Gujarati fonts on desktop; optional `Gujr` craft-fonts fallback; no Gujarati face in the pinned CI/release fonts or web startup list | original catalog reviewed by a native speaker; all 387 later additions approved by the contributor, with 11 wording corrections | contributor-reviewed catalog | remaining messages and a bundled Gujarati web font | | Arabic | `ar` | 0 | none | document text: bidi layout and Paragraph Direction; interface: no right-to-left layout, no Arabic shaping in egui | no | none | 25–40 | From 578072babbb168162f88870d1ccdbf4ca0f91bfa Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 06:37:03 -0800 Subject: [PATCH 004/102] Flare: a flare keeps its settings and can be edited after it is drawn A flare drawn with the Flare tool or shape.flare now keeps the settings it was drawn with and the transform it has had since. With flares selected, double-clicking the Flare tool opens Flare Tool Options filled from the first one, and OK draws the selected flares again in their place as one undo step (none when nothing changed). With one flare selected, the Flare tool shows its center and end handles, and dragging either changes the flare's length or direction. Object > Expand turns a flare into a plain group of its parts. - shape.editFlare draws flares again with the settings it is given. - A flare whose parts were edited, or that is locked or hidden, is not edited as a flare. - shape.flare returns an error for a fractional or negative count. - Native files save a flare's settings. --- crates/doc/src/flare.rs | 326 ++++++++++++++++++++ crates/doc/src/lib.rs | 1 + crates/doc/src/mem.rs | 1 + crates/doc/src/node/extras.rs | 4 + crates/doc/src/node/ops.rs | 6 + crates/doc/src/node/wire.rs | 5 + crates/engine/src/cmd.rs | 1 + crates/engine/src/cmd/create.rs | 132 +------- crates/engine/src/cmd/expand.rs | 6 +- crates/engine/src/cmd/flare.rs | 220 +++++++++++++ crates/engine/src/lib.rs | 1 + crates/engine/src/tests.rs | 122 ++++++++ crates/tools/src/extra.rs | 142 ++++++++- crates/ui-egui/src/dialogs/flare_options.rs | 130 +++++++- crates/ui-egui/src/i18n/bg.tsv | 2 + crates/ui-egui/src/i18n/bs.tsv | 2 + crates/ui-egui/src/i18n/ca.tsv | 2 + crates/ui-egui/src/i18n/cs.tsv | 2 + crates/ui-egui/src/i18n/da.tsv | 2 + crates/ui-egui/src/i18n/de.tsv | 2 + crates/ui-egui/src/i18n/el.tsv | 2 + crates/ui-egui/src/i18n/es.tsv | 2 + crates/ui-egui/src/i18n/fi.tsv | 2 + crates/ui-egui/src/i18n/fr.tsv | 2 + crates/ui-egui/src/i18n/gu.tsv | 1 + crates/ui-egui/src/i18n/hi.tsv | 2 + crates/ui-egui/src/i18n/hu.tsv | 2 + crates/ui-egui/src/i18n/id.tsv | 2 + crates/ui-egui/src/i18n/it.tsv | 2 + crates/ui-egui/src/i18n/ja.tsv | 2 + crates/ui-egui/src/i18n/ka.tsv | 2 + crates/ui-egui/src/i18n/ko.tsv | 2 + crates/ui-egui/src/i18n/nl.tsv | 2 + crates/ui-egui/src/i18n/pl.tsv | 2 + crates/ui-egui/src/i18n/pt-br.tsv | 2 + crates/ui-egui/src/i18n/ru.tsv | 2 + crates/ui-egui/src/i18n/sv.tsv | 2 + crates/ui-egui/src/i18n/tr.tsv | 2 + crates/ui-egui/src/i18n/uk.tsv | 2 + crates/ui-egui/src/i18n/vi.tsv | 2 + crates/ui-egui/src/i18n/zh-hans.tsv | 2 + crates/ui-egui/src/i18n/zh-hant.tsv | 2 + crates/ui-egui/src/menus/ui_commands.rs | 2 +- crates/ui-egui/src/toolbar.rs | 3 +- docs/mcp.md | 18 ++ docs/ui-parity.md | 2 + 46 files changed, 1043 insertions(+), 134 deletions(-) create mode 100644 crates/doc/src/flare.rs create mode 100644 crates/engine/src/cmd/flare.rs diff --git a/crates/doc/src/flare.rs b/crates/doc/src/flare.rs new file mode 100644 index 0000000000..f8e79a64ae --- /dev/null +++ b/crates/doc/src/flare.rs @@ -0,0 +1,326 @@ +//! Flare objects: the settings a flare group was drawn with (the Flare tool, `shape.flare`). Its +//! children are ordinary paths for every renderer and exporter; the settings let it be drawn again. +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use vectorcraft_color::{BlendMode, Color, Gradient, GradientGeom, GradientKind, GradientPaint, GradientStop, Paint}; +use vectorcraft_geom::{Affine, BezPath, PathData, Point, Rect, Vec2, shapes}; + +use crate::Appearance; +use crate::node::{Node, NodeId, NodeKind}; + +/// The seed of the sizes a flare's rays and rings take when its settings give none. +pub const DEFAULT_SEED: u64 = 0x2545_f491_4f6c_dd1d; + +/// One part of a flare: its name, outline, fill and opacity. +pub type Part = (&'static str, PathData, Paint, f32); + +/// The number `key` of the settings `v`, or `default`. +fn number(v: &Value, key: &str, default: f64) -> f64 { + v.get(key).and_then(Value::as_f64).unwrap_or(default) +} + +/// The parts of a flare with the settings `v` (`shape.flare`'s params, each one given): a bright +/// center, a halo ring, rays of varying length and rings along the path to the end point. +pub fn parts(v: &Value) -> Vec { + let c = Point::new(number(v, "cx", 0.0), number(v, "cy", 0.0)); + let end = Point::new(number(v, "x2", c.x), number(v, "y2", c.y)); + let pct = |k: &str| (number(v, k, 0.0) / 100.0).clamp(0.0, 10.0); + let r = (number(v, "diameter", 100.0) / 2.0).max(0.5); + let opacity = pct("opacity").min(1.0) as f32; + let brightness = pct("brightness").min(1.0) as f32; + let growth = pct("growth"); + let fuzz = pct("fuzziness").min(1.0); + let rays = v.get("rays").and_then(Value::as_u64).unwrap_or(0).min(50) as usize; + let longest = pct("longest"); + let ray_fuzz = pct("rayFuzziness").min(1.0); + let ray_turn = number(v, "rotation", 0.0).to_radians(); + let rings = v.get("rings").and_then(Value::as_u64).unwrap_or(0).min(50) as usize; + let largest = pct("largest"); + // Deterministic pseudo-random sizes (same parameters → same flare). + let mut seed = v.get("seed").and_then(Value::as_u64).unwrap_or(DEFAULT_SEED) | 1; + let mut rnd = move || { + seed ^= seed << 13; + seed ^= seed >> 7; + seed ^= seed << 17; + (seed >> 11) as f64 / (1u64 << 53) as f64 + }; + let stop = |offset: f32, opacity: f32| GradientStop { opacity, ..GradientStop::new(offset, Color::WHITE) }; + let radial = |centre: Point, radius: f64, stops: Vec| { + let mut g = GradientPaint::new(Gradient::new(GradientKind::Radial, stops)); + g.geom = Some(GradientGeom { start: centre, end: centre + Vec2::new(radius, 0.0), aspect: 1.0, focal: None }); + Paint::Gradient(Box::new(g)) + }; + let circle = |centre: Point, radius: f64| shapes::ellipse(Rect::from_center_size(centre, (radius * 2.0, radius * 2.0))); + let mut parts: Vec = vec![]; + // Halo: a soft ring just outside the centre. + let halo_r = r * (1.0 + growth) * 1.6; + let inner = (1.0 - fuzz as f32 * 0.6).clamp(0.05, 0.95); + parts.push(("Halo", circle(c, halo_r), radial(c, halo_r, vec![stop(0.0, 0.0), stop(inner * 0.75, 0.0), stop(inner, 0.5), stop(1.0, 0.0)]), 1.0)); + // Rays: thin spikes of random length (Longest = % of the centre radius), fading outwards. + // `rotation` turns them clockwise about the center. + if rays > 0 { + let mut bp = BezPath::new(); + let mut reach: f64 = 0.0; + for i in 0..rays { + let a = std::f64::consts::TAU * (i as f64 + rnd() * 0.6) / rays as f64 + ray_turn; + let len = r * longest * (1.0 - ray_fuzz * 0.75 * rnd()).max(0.1); + reach = reach.max(len); + let w = r * 0.035; + let dir = Vec2::new(a.cos(), a.sin()); + let n = Vec2::new(-dir.y, dir.x) * w; + bp.move_to(c + n); + bp.line_to(c + dir * len); + bp.line_to(c - n); + bp.line_to(c - dir * (w * 4.0)); + bp.close_path(); + } + parts.push(("Rays", PathData::from_bezpath(&bp), radial(c, reach, vec![stop(0.0, 0.9), stop(0.25, 0.35), stop(1.0, 0.0)]), 1.0)); + } + // Centre: bright core fading to transparent. + parts.push(("Center", circle(c, r), radial(c, r, vec![stop(0.0, 1.0), stop(0.25 + brightness * 0.5, 0.6), stop(1.0, 0.0)]), opacity)); + // Rings along the path to the end point (Largest = % of the average ring size). + for _ in 0..rings { + let t = rnd(); + let at = c + (end - c) * t; + let rr = (r * largest * (0.25 + rnd() * 0.75)).max(0.5); + let solid = rnd() < 0.5; + let stops = if solid { + vec![stop(0.0, 0.25), stop(0.8, 0.2), stop(1.0, 0.0)] + } else { + vec![stop(0.0, 0.0), stop(0.7, 0.05), stop(0.92, 0.35), stop(1.0, 0.0)] + }; + parts.push(("Ring", circle(at, rr), radial(at, rr, stops), 1.0)); + } + parts +} + +/// Part `part` of a flare as the object `id`, transformed by `xf` (the transform its flare has had +/// since it was drawn), with the pixel-aligned property when `aligned`. +pub fn part_node(id: NodeId, part: Part, xf: Affine, aligned: bool) -> Node { + let (name, pd, paint, op) = part; + let mut n = Node::path(id, pd, Appearance::basic(paint, Paint::None, 0.0)); + n.name = Some(name.into()); + n.blend = BlendMode::Screen; + n.opacity = op; + if aligned { + n.extras_mut().pixel_aligned = true; + } + if xf != Affine::IDENTITY { + n.transform(xf, false); + } + n +} + +/// The ellipse of a radial gradient's placement `geom` as the symmetric matrix `[xx, xy, yy]` that +/// maps it to the unit circle's: the same for every end point and aspect that give that ellipse +/// (transforms applied one by one and all at once can put the end on different axes of it). +fn ellipse(geom: &GradientGeom) -> [f64; 3] { + let u = geom.end - geom.start; + let w = Vec2::new(-u.y, u.x) * geom.aspect; + [u.x * u.x + w.x * w.x, u.x * u.y + w.x * w.y, u.y * u.y + w.y * w.y] +} + +/// `n` as JSON without what depends on how its transforms were applied: its id, the angle of its +/// bounding box, and which axis of a gradient's ellipse its end point is on (the ellipse stays). +fn comparable(n: &Node) -> Value { + fn strip(v: &mut Value) { + match v { + Value::Object(m) => { + for key in ["id", "bbox_angle"] { + m.remove(key); + } + if let Some(geom) = m.get_mut("geom") + && let Ok(g) = serde_json::from_value::(geom.clone()) + && let Value::Object(geom) = geom + { + geom.remove("end"); + geom.remove("aspect"); + geom.insert("ellipse".into(), serde_json::json!(ellipse(&g))); + } + m.values_mut().for_each(strip); + } + Value::Array(a) => a.iter_mut().for_each(strip), + _ => {} + } + } + let mut v = serde_json::to_value(n).unwrap_or(Value::Null); + strip(&mut v); + v +} + +/// How close, relative to its size, a number in an outline or a gradient's placement must be to the +/// one its transforms give: a few thousandths of a point near the edge of the canvas. +const GEOMETRY_TOL: f64 = 1e-9; + +/// Whether `a` and `b` are the same JSON, with each number within `tol` relative to its size; each +/// number in an outline (`path`) or a gradient's placement (`geom`) is within [`GEOMETRY_TOL`] +/// relative to its size (or `tol`, when smaller), and `snap` points as well. +fn close(a: &Value, b: &Value, tol: f64, snap: f64, geometry: bool) -> bool { + match (a, b) { + (Value::Number(x), Value::Number(y)) => match (x.as_f64(), y.as_f64()) { + (Some(x), Some(y)) => { + let (snap, tol) = if geometry { (snap, tol.min(GEOMETRY_TOL)) } else { (0.0, tol) }; + (x - y).abs() <= snap + tol * (1.0 + x.abs().max(y.abs())) + } + _ => x == y, + }, + (Value::Array(x), Value::Array(y)) => x.len() == y.len() && x.iter().zip(y).all(|(x, y)| close(x, y, tol, snap, geometry)), + (Value::Object(x), Value::Object(y)) => { + x.len() == y.len() && x.iter().all(|(k, v)| y.get(k).is_some_and(|w| close(v, w, tol, snap, geometry || k == "path" || k == "geom"))) + } + _ => a == b, + } +} + +/// Whether `a` and `b` are the same JSON, with each number within `tol` relative to its size. +pub fn json_close(a: &Value, b: &Value, tol: f64) -> bool { + close(a, b, tol, 0.0, false) +} + +/// How far a pixel-aligned object's points may be from where its transforms put them: snapping to +/// the pixel grid moves each by up to a pixel. +const PIXEL_SNAP: f64 = 1.0; + +/// The settings of a flare group ([`crate::NodeExtras::flare`]). +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct FlareSpec { + /// `shape.flare`'s params the flare was drawn with, each one given: the center (`cx`, `cy`) and + /// the rings' end point (`x2`, `y2`) are in the coordinates it was drawn in. + pub params: serde_json::Value, + /// The transform its art has had since it was drawn (moves, scales, rotations, reflections and + /// shears). + #[serde(default = "identity", skip_serializing_if = "is_identity")] + pub transform: Affine, +} + +fn identity() -> Affine { + Affine::IDENTITY +} + +fn is_identity(a: &Affine) -> bool { + *a == Affine::IDENTITY +} + +impl FlareSpec { + /// The settings of a flare drawn with `params`, not transformed since. + pub fn new(params: serde_json::Value) -> Self { + Self { params, transform: Affine::IDENTITY } + } + + /// The point `key_x`, `key_y` of the params, where it is in the document now. + fn point(&self, key_x: &str, key_y: &str) -> Option { + let x = self.params.get(key_x)?.as_f64()?; + let y = self.params.get(key_y)?.as_f64()?; + Some(self.transform * Point::new(x, y)).filter(|p| p.x.is_finite() && p.y.is_finite()) + } + + /// The flare's center, where it is in the document now. + pub fn center(&self) -> Option { + self.point("cx", "cy") + } + + /// The rings' end point, where it is in the document now. + pub fn end(&self) -> Option { + self.point("x2", "y2") + } + + /// Its art transformed by `a`. + pub fn transform(&mut self, a: Affine) { + self.transform = a * self.transform; + } + + /// Whether `group`'s parts are still the ones these settings draw, in place: none was edited, + /// distorted, removed or added, and the transform can be undone. + pub fn draws(&self, group: &Node) -> bool { + let NodeKind::Group { children, .. } = &group.kind else { return false }; + if self.transform.determinant().abs() < 1e-12 || !self.transform.as_coeffs().iter().all(|c| c.is_finite()) { + return false; + } + let expected = parts(&self.params); + expected.len() == children.len() + && expected.into_iter().zip(children).all(|(part, child)| { + let aligned = child.extras().pixel_aligned; + let snap = if aligned { PIXEL_SNAP } else { 0.0 }; + close(&comparable(&part_node(child.id, part, self.transform, aligned)), &comparable(child), 1e-6, snap, false) + }) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use serde_json::json; + + /// A flare's center and end point follow its art through a transform, and a save and reload + /// keeps its settings. + #[test] + fn a_flare_keeps_its_settings_through_a_transform_and_a_save() { + let mut g = Node::group(NodeId(1), vec![std::sync::Arc::new(Node::path(NodeId(2), PathData::default(), Default::default()))]); + g.extras_mut().flare = Some(Box::new(FlareSpec::new(json!({ "cx": 10.0, "cy": 20.0, "x2": 110.0, "y2": 20.0, "seed": 7 })))); + g.transform(Affine::translate((5.0, 0.0)) * Affine::rotate(std::f64::consts::FRAC_PI_2), false); + let spec = g.extras().flare.as_deref().cloned().unwrap_or_else(|| panic!("no flare")); + let c = spec.center().unwrap_or_else(|| panic!("no center")); + let e = spec.end().unwrap_or_else(|| panic!("no end")); + assert!((c.x - -15.0).abs() < 1e-9 && (c.y - 10.0).abs() < 1e-9, "{c:?}"); + assert!((e.x - -15.0).abs() < 1e-9 && (e.y - 110.0).abs() < 1e-9, "{e:?}"); + let text = serde_json::to_string(&g).unwrap_or_else(|e| panic!("{e}")); + let back: Node = serde_json::from_str(&text).unwrap_or_else(|e| panic!("{e}")); + assert_eq!(back.extras().flare.as_deref(), Some(&spec)); + // A flare that was not transformed writes no transform. + let plain = FlareSpec::new(json!({ "cx": 1.0 })); + assert_eq!(serde_json::to_value(&plain).unwrap_or_default(), json!({ "params": { "cx": 1.0 } })); + } + + /// A flare group draws its settings until a part's gradient, opacity or outline is edited; a + /// pixel-aligned part may sit up to a pixel from where its transforms put it, but only in its + /// outline and its gradient's placement. + #[test] + fn a_flare_with_an_edited_part_no_longer_draws_its_settings() { + let v = json!({ "cx": 50.0, "cy": 50.0, "x2": 250.0, "y2": 50.0, "rays": 5, "rings": 2, "seed": 9, "diameter": 40.0, + "opacity": 50.0, "brightness": 30.0, "growth": 20.0, "fuzziness": 50.0, "longest": 300.0, "rayFuzziness": 100.0, + "rotation": 0.0, "largest": 50.0 }); + let flare = |aligned: bool| { + let xf = Affine::rotate(0.3) * Affine::scale_non_uniform(1.5, 0.75); + let children = parts(&v).into_iter().enumerate().map(|(i, p)| std::sync::Arc::new(part_node(NodeId(10 + i as u64), p, xf, aligned))); + let mut g = Node::group(NodeId(1), children.collect()); + g.extras_mut().flare = Some(Box::new(FlareSpec { params: v.clone(), transform: xf })); + g + }; + let spec = |g: &Node| g.extras().flare.as_deref().cloned().unwrap_or_else(|| panic!("no flare")); + let edit = |g: &mut Node, f: &dyn Fn(&mut Node)| { + let NodeKind::Group { children, .. } = &mut g.kind else { panic!("not a group") }; + // The center, drawn at half opacity. + f(std::sync::Arc::make_mut(&mut children[2])); + }; + for aligned in [false, true] { + let g = flare(aligned); + assert!(spec(&g).draws(&g), "aligned {aligned}"); + let mut moved = g.clone(); + edit(&mut moved, &|n| n.transform(Affine::translate((0.4, 0.0)), false)); + assert_eq!(spec(&moved).draws(&moved), aligned, "a fraction of a pixel, aligned {aligned}"); + let mut faded = g.clone(); + edit(&mut faded, &|n| n.opacity *= 0.8); + assert!(!spec(&faded).draws(&faded), "opacity, aligned {aligned}"); + let mut shifted = g.clone(); + edit(&mut shifted, &|n| { + if let Some(crate::AppearanceItem::Fill(fill)) = n.appearance.items.first_mut() + && let Paint::Gradient(gp) = &mut fill.paint + && let Some(geom) = &mut gp.geom + { + geom.start.x += 20.0; + } + }); + assert!(!spec(&shifted).draws(&shifted), "gradient placement, aligned {aligned}"); + let mut squashed = g.clone(); + edit(&mut squashed, &|n| { + if let Some(crate::AppearanceItem::Fill(fill)) = n.appearance.items.first_mut() + && let Paint::Gradient(gp) = &mut fill.paint + && let Some(geom) = &mut gp.geom + { + geom.aspect *= 0.5; + } + }); + assert!(!spec(&squashed).draws(&squashed), "gradient shape, aligned {aligned}"); + } + } +} diff --git a/crates/doc/src/lib.rs b/crates/doc/src/lib.rs index b32a4485f4..fda73f40e8 100644 --- a/crates/doc/src/lib.rs +++ b/crates/doc/src/lib.rs @@ -16,6 +16,7 @@ pub mod compound_shape; pub mod corners; pub mod depth; pub mod dimension; +pub mod flare; pub mod graph; mod halftone_radii; pub mod hit; diff --git a/crates/doc/src/mem.rs b/crates/doc/src/mem.rs index 7ff6cdeea2..fef740e5a1 100644 --- a/crates/doc/src/mem.rs +++ b/crates/doc/src/mem.rs @@ -266,6 +266,7 @@ fn node_bytes(n: &Node, other: Option<&Node>, counted: &mut HashSet) -> u .as_deref() .map_or(0, |m| ALLOC + size_of::() + m.key.capacity() + m.from.capacity() + m.colors.capacity() * 3); b += e.trace.as_ref().map_or(0, |t| ALLOC + size_of::() + json_bytes(t)); + b += e.flare.as_ref().map_or(0, |f| ALLOC + size_of::() + json_bytes(&f.params)); b += e.intertwine.as_deref().map_or(0, |a| ALLOC + size_of::() + path_bytes(a)); if e.intertwine_tiers.capacity() > 0 { b += ALLOC + e.intertwine_tiers.capacity() * size_of::() + e.intertwine_tiers.iter().map(path_bytes).sum::(); diff --git a/crates/doc/src/node/extras.rs b/crates/doc/src/node/extras.rs index e13750457e..5fa0c430d1 100644 --- a/crates/doc/src/node/extras.rs +++ b/crates/doc/src/node/extras.rs @@ -41,6 +41,9 @@ pub struct NodeExtras { /// Dimension object: the live measurement it draws; its ordinary group children hold its /// exportable appearance (Object › Dimensions, the Dimension tool). pub dimension: Option>, + /// Flare object: the settings its group was drawn with (the Flare tool); its ordinary group + /// children hold its art. + pub flare: Option>, /// Object › Intertwine: as a member of an Intertwine group, the area (document coordinates, /// filled non-zero) where this object is drawn over the group's other members. pub intertwine: Option>, @@ -96,6 +99,7 @@ pub(super) static NO_EXTRAS: NodeExtras = NodeExtras { slice: None, perspective: None, dimension: None, + flare: None, intertwine: None, intertwine_tiers: Vec::new(), live_paint_gaps: None, diff --git a/crates/doc/src/node/ops.rs b/crates/doc/src/node/ops.rs index 1aad3a27cf..dffef9f44b 100644 --- a/crates/doc/src/node/ops.rs +++ b/crates/doc/src/node/ops.rs @@ -448,6 +448,12 @@ impl Node { { dimension.transform(a); } + // So does a flare's center and end point. + if let Some(e) = self.extras_if_any() + && let Some(flare) = &mut e.flare + { + flare.transform(a); + } // The path the objects are attached to, before it is transformed. let on_path_before = self.on_path_data().cloned(); if !self.is_layer() { diff --git a/crates/doc/src/node/wire.rs b/crates/doc/src/node/wire.rs index 885f9a5853..24bb4d5957 100644 --- a/crates/doc/src/node/wire.rs +++ b/crates/doc/src/node/wire.rs @@ -45,6 +45,7 @@ impl Serialize for Node { is_default(&self.bbox_angle), e.perspective.is_none(), e.dimension.is_none(), + e.flare.is_none(), e.intertwine.is_none(), e.intertwine_tiers.is_empty(), e.live_paint_gaps.is_none(), @@ -90,6 +91,7 @@ impl Serialize for Node { field!("bbox_angle", &self.bbox_angle); field!("perspective", &e.perspective); field!("dimension", &e.dimension); + field!("flare", &e.flare); field!("intertwine", &e.intertwine); field!("intertwine_tiers", &e.intertwine_tiers); field!("live_paint_gaps", &e.live_paint_gaps); @@ -226,6 +228,8 @@ pub(super) struct NodeWire { #[serde(default)] dimension: Option>, #[serde(default)] + flare: Option>, + #[serde(default)] intertwine: Option>, #[serde(default, deserialize_with = "counted_list")] intertwine_tiers: Vec, @@ -267,6 +271,7 @@ impl From for Node { slice: w.slice, perspective: w.perspective, dimension: w.dimension, + flare: w.flare, intertwine: w.intertwine, intertwine_tiers: w.intertwine_tiers, live_paint_gaps: w.live_paint_gaps, diff --git a/crates/engine/src/cmd.rs b/crates/engine/src/cmd.rs index 99b8e1ecdd..b5a723672a 100644 --- a/crates/engine/src/cmd.rs +++ b/crates/engine/src/cmd.rs @@ -32,6 +32,7 @@ pub mod expand; pub(crate) mod fileinfo; pub mod fileio; pub mod findfiles; +pub mod flare; pub mod flatten; pub mod fontfiles; mod fonts; diff --git a/crates/engine/src/cmd/create.rs b/crates/engine/src/cmd/create.rs index ebef729fd3..2c038c3f97 100644 --- a/crates/engine/src/cmd/create.rs +++ b/crates/engine/src/cmd/create.rs @@ -55,7 +55,16 @@ pub fn specs() -> Vec { None, "{cx, cy, diameter=100, opacity=50 (%), brightness=30 (%), growth=20 (%), fuzziness=50 (%), rays=15, longest=300 (%), rayFuzziness=100 (%), rotation=0 (deg, turns the rays clockwise), x2?, y2? (ring end; else pathLength at direction), pathLength=300, rings=10, largest=50 (%), direction=45 (deg counter-clockwise from 3 o'clock: where the rings run from the centre), seed?} → {id}", has_doc, - flare + super::flare::flare + ), + cmd!( + "shape.editFlare", + "Edit Flare", + [], + None, + "{ids?|id?: flares (default: the selected flares), cx?, cy? (the center, where it is drawn now), x2?, y2? (the rings' end point, where it is drawn now; else pathLength at direction from the center, both where it is drawn now, when either is given; else where it was), diameter?, opacity?, brightness?, growth?, fuzziness?, rays?, longest?, rayFuzziness?, rotation?, pathLength?, rings?, largest?, direction? (as shape.flare: what is left out stays as it was)} draws each flare again in its place, moved, scaled, rotated, reflected or sheared as it has been since it was drawn, as one undo step (none when nothing changes); a flare whose parts were edited, or that is locked or hidden, is not one → {ids}", + has_doc, + super::flare::edit_flare ), cmd!("shape.line", "Line Segment", [], None, "{x1, y1, x2, y2, fill?: bool (Fill Line: the current fill, else none)} → {id}", has_doc, line), cmd!("shape.spiral", "Spiral", [], None, "{cx, cy, radius, decay=80 (%), segments=10, clockwise?} → {id}", has_doc, spiral), @@ -407,127 +416,6 @@ fn star(s: &mut Session, p: &Value) -> Result { add_art_turned(s, "Star", path_kind(path, None), constrained_turn(s, rot)) } -/// Flare tool: a lens flare built from radial-gradient paths in Screen mode — a bright centre, a halo -/// ring, rays of varying length and rings along the path to the end point. -fn flare(s: &mut Session, p: &Value) -> Result { - use vectorcraft_color::{BlendMode, Gradient, GradientGeom, GradientKind, GradientPaint, GradientStop, Paint}; - let c = Point::new(f64_req(p, "cx", "shape.flare")?, f64_req(p, "cy", "shape.flare")?); - let numbers = [ - "diameter", - "opacity", - "brightness", - "growth", - "fuzziness", - "rays", - "longest", - "rayFuzziness", - "rotation", - "rings", - "largest", - "x2", - "y2", - "direction", - "pathLength", - "seed", - ]; - check_numbers(p, &numbers, "shape.flare")?; - let pct = |k: &str, d: f64| (f64_or(p, k, d) / 100.0).clamp(0.0, 10.0); - let r = (f64_or(p, "diameter", 100.0) / 2.0).max(0.5); - let opacity = pct("opacity", 50.0).min(1.0) as f32; - let brightness = pct("brightness", 30.0).min(1.0) as f32; - let growth = pct("growth", 20.0); - let fuzz = pct("fuzziness", 50.0).min(1.0); - let rays = p.get("rays").and_then(Value::as_u64).unwrap_or(15).min(50) as usize; - let longest = pct("longest", 300.0); - let ray_fuzz = pct("rayFuzziness", 100.0).min(1.0); - let ray_turn = f64_or(p, "rotation", 0.0).to_radians(); - let rings = p.get("rings").and_then(Value::as_u64).unwrap_or(10).min(50) as usize; - let largest = pct("largest", 50.0); - let end = match (p.get("x2").and_then(Value::as_f64), p.get("y2").and_then(Value::as_f64)) { - (Some(x), Some(y)) => Point::new(x, y), - _ => { - let a = f64_or(p, "direction", 45.0).to_radians(); - c + vectorcraft_geom::Vec2::new(a.cos(), -a.sin()) * f64_or(p, "pathLength", 300.0) - } - }; - // Deterministic pseudo-random sizes (same parameters → same flare). - let mut seed = p.get("seed").and_then(Value::as_u64).unwrap_or(0x2545_f491_4f6c_dd1d) | 1; - let mut rnd = move || { - seed ^= seed << 13; - seed ^= seed >> 7; - seed ^= seed << 17; - (seed >> 11) as f64 / (1u64 << 53) as f64 - }; - let stop = |offset: f32, opacity: f32| GradientStop { opacity, ..GradientStop::new(offset, vectorcraft_color::Color::WHITE) }; - let radial = |centre: Point, radius: f64, stops: Vec| { - let mut g = GradientPaint::new(Gradient::new(GradientKind::Radial, stops)); - g.geom = Some(GradientGeom { start: centre, end: centre + vectorcraft_geom::Vec2::new(radius, 0.0), aspect: 1.0, focal: None }); - Paint::Gradient(Box::new(g)) - }; - let circle = |centre: Point, radius: f64| shapes::ellipse(Rect::from_center_size(centre, (radius * 2.0, radius * 2.0))); - let mut parts: Vec<(&str, PathData, Paint, f32)> = vec![]; - // Halo: a soft ring just outside the centre. - let halo_r = r * (1.0 + growth) * 1.6; - let inner = (1.0 - fuzz as f32 * 0.6).clamp(0.05, 0.95); - parts.push(("Halo", circle(c, halo_r), radial(c, halo_r, vec![stop(0.0, 0.0), stop(inner * 0.75, 0.0), stop(inner, 0.5), stop(1.0, 0.0)]), 1.0)); - // Rays: thin spikes of random length (Longest = % of the centre radius), fading outwards. - // `rotation` turns them clockwise about the center. - if rays > 0 { - let mut bp = vectorcraft_geom::BezPath::new(); - let mut reach: f64 = 0.0; - for i in 0..rays { - let a = std::f64::consts::TAU * (i as f64 + rnd() * 0.6) / rays as f64 + ray_turn; - let len = r * longest * (1.0 - ray_fuzz * 0.75 * rnd()).max(0.1); - reach = reach.max(len); - let w = r * 0.035; - let dir = vectorcraft_geom::Vec2::new(a.cos(), a.sin()); - let n = vectorcraft_geom::Vec2::new(-dir.y, dir.x) * w; - bp.move_to(c + n); - bp.line_to(c + dir * len); - bp.line_to(c - n); - bp.line_to(c - dir * (w * 4.0)); - bp.close_path(); - } - parts.push(("Rays", PathData::from_bezpath(&bp), radial(c, reach, vec![stop(0.0, 0.9), stop(0.25, 0.35), stop(1.0, 0.0)]), 1.0)); - } - // Centre: bright core fading to transparent. - parts.push(("Center", circle(c, r), radial(c, r, vec![stop(0.0, 1.0), stop(0.25 + brightness * 0.5, 0.6), stop(1.0, 0.0)]), opacity)); - // Rings along the path to the end point (Largest = % of the average ring size). - for _ in 0..rings { - let t = rnd(); - let at = c + (end - c) * t; - let rr = (r * largest * (0.25 + rnd() * 0.75)).max(0.5); - let solid = rnd() < 0.5; - let stops = if solid { - vec![stop(0.0, 0.25), stop(0.8, 0.2), stop(1.0, 0.0)] - } else { - vec![stop(0.0, 0.0), stop(0.7, 0.05), stop(0.92, 0.35), stop(1.0, 0.0)] - }; - parts.push(("Ring", circle(at, rr), radial(at, rr, stops), 1.0)); - } - let parent = s.doc()?.target_parent()?; - let id = s.edit("Flare", |d, sel| { - let children = parts - .into_iter() - .map(|(name, pd, paint, op)| { - let mut n = Node::path(d.alloc_id(), pd, Appearance::basic(paint, Paint::None, 0.0)); - n.name = Some(name.into()); - n.blend = BlendMode::Screen; - n.opacity = op; - super::object::align_new_object(d, &mut n); - std::sync::Arc::new(n) - }) - .collect(); - let gid = d.alloc_id(); - let mut g = Node::group(gid, children); - g.name = Some("Flare".into()); - d.insert(parent, usize::MAX, g)?; - sel.set([gid]); - Ok(gid) - })?; - Ok(json!({ "id": id.0 })) -} - fn line(s: &mut Session, p: &Value) -> Result { let a = Point::new(f64_req(p, "x1", "shape.line")?, f64_req(p, "y1", "shape.line")?); let b = Point::new(f64_req(p, "x2", "shape.line")?, f64_req(p, "y2", "shape.line")?); diff --git a/crates/engine/src/cmd/expand.rs b/crates/engine/src/cmd/expand.rs index 43975fe4e4..c39fd7012d 100644 --- a/crates/engine/src/cmd/expand.rs +++ b/crates/engine/src/cmd/expand.rs @@ -182,7 +182,7 @@ impl Expandable { n.walk(&mut |c| { let shape = matches!(c.kind, NodeKind::Path { .. } | NodeKind::Compound { .. }); e.text |= matches!(c.kind, NodeKind::Text(_)); - e.live |= matches!(c.kind, NodeKind::Path { live: Some(_), .. }); + e.live |= matches!(c.kind, NodeKind::Path { live: Some(_), .. }) || c.extras().flare.is_some(); e.effects |= !c.appearance.effects.is_empty(); e.envelope |= matches!(c.kind, NodeKind::Envelope { .. }); e.blends |= matches!(c.kind, NodeKind::Blend { .. }); @@ -500,10 +500,14 @@ fn end_dimension_links(s: &mut Session, ended: &mut Vec) -> Result<() Ok(()) } +/// Makes the live shapes in `n` plain paths, and the flares plain groups of their parts. fn drop_live(n: &mut Node) { if let NodeKind::Path { live, .. } = &mut n.kind { *live = None; } + if n.extras().flare.is_some() { + n.extras_mut().flare = None; + } if let Some(ch) = n.children_mut() { for c in ch.iter_mut() { drop_live(Arc::make_mut(c)); diff --git a/crates/engine/src/cmd/flare.rs b/crates/engine/src/cmd/flare.rs new file mode 100644 index 0000000000..f13d8ca0e2 --- /dev/null +++ b/crates/engine/src/cmd/flare.rs @@ -0,0 +1,220 @@ +//! Flares (the Flare tool): `shape.flare` draws a group of radial-gradient paths that keeps the +//! settings it was drawn with ([`FlareSpec`]), and `shape.editFlare` draws it again from them. + +use std::sync::Arc; + +use serde_json::{Value, json}; +use vectorcraft_doc::flare::{DEFAULT_SEED, FlareSpec, json_close, part_node, parts}; +use vectorcraft_doc::{Document, Node, NodeId}; +use vectorcraft_geom::{Affine, Point, Vec2}; + +use super::{EngineError, Result, Session, bad, check_numbers, f64_or, f64_req, given_objects, number_or}; + +const C: &str = "shape.editFlare"; + +/// `shape.flare`'s settings besides the center, the rings' end point, the counts and the seed: +/// (key, default). +const SETTINGS: [(&str, f64); 9] = [ + ("diameter", 100.0), + ("opacity", 50.0), + ("brightness", 30.0), + ("growth", 20.0), + ("fuzziness", 50.0), + ("longest", 300.0), + ("rayFuzziness", 100.0), + ("rotation", 0.0), + ("largest", 50.0), +]; + +/// The whole number of 0 or more `p` gives for `key`, or `default`. +fn count_or(p: &Value, key: &str, default: u64, cmd: &str) -> Result { + let n = number_or(p, key, default as f64, cmd)?; + if n.is_finite() && n >= 0.0 && n.fract() == 0.0 { + Ok(n as u64) + } else { + Err(bad(cmd, format!("`{key}` must be a whole number of at least 0, not {n}"))) + } +} + +/// `shape.flare`'s params `p` with every setting given: the defaults filled in, the counts at most +/// 50 and the rings' end point as `x2`, `y2` (from `pathLength` and `direction` when `p` gives no +/// end point). +fn settings_of(p: &Value, cmd: &str) -> Result { + let c = Point::new(f64_req(p, "cx", cmd)?, f64_req(p, "cy", cmd)?); + let mut numbers: Vec<&str> = SETTINGS.iter().map(|(key, _)| *key).collect(); + numbers.extend(["x2", "y2", "direction", "pathLength", "seed"]); + check_numbers(p, &numbers, cmd)?; + let rays = count_or(p, "rays", 15, cmd)?.min(50); + let rings = count_or(p, "rings", 10, cmd)?.min(50); + let end = match (p.get("x2").and_then(Value::as_f64), p.get("y2").and_then(Value::as_f64)) { + (Some(x), Some(y)) => Point::new(x, y), + _ => { + let a = f64_or(p, "direction", 45.0).to_radians(); + c + Vec2::new(a.cos(), -a.sin()) * f64_or(p, "pathLength", 300.0) + } + }; + let seed = p.get("seed").and_then(Value::as_u64).unwrap_or(DEFAULT_SEED); + let mut v = json!({ "cx": c.x, "cy": c.y, "x2": end.x, "y2": end.y, "rays": rays, "rings": rings, "seed": seed }); + for (key, default) in SETTINGS { + v[key] = json!(f64_or(p, key, default)); + } + Ok(v) +} + +/// The objects of a flare drawn with the settings `v`, transformed by `xf`. A new flare's parts +/// (`old` None) get new ids and take the document's Align New Objects to Pixel Grid. A flare drawn +/// again from its parts `old` keeps, for each part, the id and pixel-aligned property of the old +/// part it replaces (the same kind of part, counted in order: the second ring replaces the second +/// ring); a part that replaces none gets a new id and the first old part's property. +fn part_nodes(d: &mut Document, v: &Value, xf: Affine, old: Option<&[Arc]>) -> Vec> { + let mut seen: Vec<&str> = vec![]; + parts(v) + .into_iter() + .map(|part| { + let name = part.0; + let nth = seen.iter().filter(|n| **n == name).count(); + seen.push(name); + let replaced = old.and_then(|old| old.iter().filter(|c| c.name.as_deref() == Some(name)).nth(nth)); + let id = replaced.map_or_else(|| d.alloc_id(), |c| c.id); + let mut n = part_node(id, part, Affine::IDENTITY, false); + match old { + None => super::object::align_new_object(d, &mut n), + Some(old) => n.extras_mut().pixel_aligned = replaced.or(old.first()).is_some_and(|c| c.extras().pixel_aligned), + } + if xf != Affine::IDENTITY { + n.transform(xf, false); + } + Arc::new(n) + }) + .collect() +} + +/// `shape.flare`: a flare group that keeps its settings. +pub(super) fn flare(s: &mut Session, p: &Value) -> Result { + let v = settings_of(p, "shape.flare")?; + let parent = s.doc()?.target_parent()?; + let id = s.edit("Flare", |d, sel| { + let children = part_nodes(d, &v, Affine::IDENTITY, None); + let gid = d.alloc_id(); + let mut g = Node::group(gid, children); + g.name = Some("Flare".into()); + g.extras_mut().flare = Some(Box::new(FlareSpec::new(v))); + d.insert(parent, usize::MAX, g)?; + sel.set([gid]); + Ok(gid) + })?; + Ok(json!({ "id": id.0 })) +} + +/// The settings of flare `id`: a group drawn by the Flare tool whose parts are still the ones its +/// settings draw, in place ([`FlareSpec::draws`]). A flare whose parts were edited, distorted, +/// removed or added to, or whose art was flattened to a line, is no longer one. +pub fn flare_settings(d: &Document, id: NodeId) -> Option { + let n = d.node(id)?; + let spec = n.extras().flare.as_deref()?; + // Settings a file holds are read as `shape.flare` reads them. + let spec = FlareSpec { params: settings_of(&spec.params, "shape.flare").ok()?, transform: spec.transform }; + spec.draws(n).then_some(spec) +} + +/// The flares `shape.editFlare` changes: those `p` names, else the selected flares. Each must be a +/// flare that can be edited. +fn flares_to_edit(s: &Session, p: &Value) -> Result> { + let given = given_objects(s, p, C)?; + let d = &s.doc()?.doc; + let flare = |id: NodeId| flare_settings(d, id).filter(|_| d.is_editable(id)).map(|spec| (id, spec)); + let flares: Vec<(NodeId, FlareSpec)> = match &given { + Some(ids) => ids.iter().map(|id| flare(*id)).collect::>>().unwrap_or_default(), + None => s.doc()?.selection.objects.iter().filter_map(|id| flare(*id)).collect(), + }; + if flares.is_empty() { + return Err(EngineError::Other("select a flare".into())); + } + Ok(flares) +} + +/// The settings `old` changed as `p` asks (`shape.editFlare`'s params). The center and the end +/// point `p` gives are in the document, where the flare is now drawn, which `xf` maps from where +/// it was drawn. +fn edited(old: &Value, p: &Value, xf: Affine) -> Result { + let mut v = old.clone(); + let inv = xf.inverse(); + let point = |kx: &str, ky: &str| -> Result> { + if p.get(kx).is_none_or(Value::is_null) && p.get(ky).is_none_or(Value::is_null) { + return Ok(None); + } + Ok(Some(inv * Point::new(f64_req(p, kx, C)?, f64_req(p, ky, C)?))) + }; + let c = point("cx", "cy")?; + let end = point("x2", "y2")?; + if let Some(c) = c { + v["cx"] = json!(c.x); + v["cy"] = json!(c.y); + } + let centre = Point::new(f64_or(&v, "cx", 0.0), f64_or(&v, "cy", 0.0)); + let old_end = Point::new(f64_or(&v, "x2", centre.x), f64_or(&v, "y2", centre.y)); + let end = match end { + Some(e) => e, + None if p.get("pathLength").is_some_and(|l| !l.is_null()) || p.get("direction").is_some_and(|a| !a.is_null()) => { + // The path length and the direction are where the flare is drawn now; the direction is + // measured counter-clockwise from 3 o'clock, as `shape.flare` takes it. + let (c, e) = (xf * centre, xf * old_end); + let d = e - c; + let a = number_or(p, "direction", (-d.y).atan2(d.x).to_degrees(), C)?.to_radians(); + inv * (c + Vec2::new(a.cos(), -a.sin()) * number_or(p, "pathLength", d.hypot(), C)?) + } + // Moving the center leaves the rings' end point where it is. + None => old_end, + }; + v["x2"] = json!(end.x); + v["y2"] = json!(end.y); + for (key, _) in SETTINGS { + if p.get(key).is_some_and(|x| !x.is_null()) { + v[key] = json!(number_or(p, key, 0.0, C)?); + } + } + for key in ["rays", "rings"] { + if p.get(key).is_some_and(|x| !x.is_null()) { + v[key] = json!(count_or(p, key, 0, C)?.min(50)); + } + } + settings_of(&v, C) +} + +/// `shape.editFlare`: draw the flares again with the settings `p` changes, each in its place and +/// transformed as it has been since it was drawn, as one undo step. +pub(super) fn edit_flare(s: &mut Session, p: &Value) -> Result { + let mut numbers: Vec<&str> = SETTINGS.iter().map(|(key, _)| *key).collect(); + numbers.extend(["cx", "cy", "x2", "y2", "pathLength", "direction", "rays", "rings"]); + check_numbers(p, &numbers, C)?; + let flares = flares_to_edit(s, p)?; + let mut changed: Vec<(NodeId, FlareSpec)> = vec![]; + for (id, spec) in &flares { + let v = edited(&spec.params, p, spec.transform)?; + if !json_close(&v, &spec.params, 1e-9) { + changed.push((*id, FlareSpec { params: v, transform: spec.transform })); + } + } + let ids: Vec = flares.iter().map(|(id, _)| id.0).collect(); + // Nothing changes: no undo step. + if changed.is_empty() { + return Ok(json!({ "ids": ids })); + } + let edited_ids: Vec = changed.iter().map(|(id, _)| *id).collect(); + s.edit("Edit Flare", |d, _| { + for (id, spec) in changed { + let old: Vec> = d.node(id).and_then(Node::children).cloned().unwrap_or_default(); + let children = part_nodes(d, &spec.params, spec.transform, Some(&old)); + let n = d.node_mut(id).ok_or(EngineError::NoNode(id))?; + if let Some(ch) = n.children_mut() { + *ch = children; + } + n.extras_mut().flare = Some(Box::new(spec)); + } + if !crate::sanity::objects_in_range(d, &edited_ids) { + return Err(EngineError::Other("result would exceed the canvas (coordinates out of range)".into())); + } + Ok(()) + })?; + Ok(json!({ "ids": ids })) +} diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 4b47966463..bf19294663 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -29,6 +29,7 @@ use vectorcraft_tools::{PaintDefaults, Tool}; pub use cmd::clipboard::{Clipboard, SourceLayer}; pub use cmd::create::constrain_click; pub use cmd::distortcmds::perspective_click; +pub use cmd::flare::flare_settings; pub use cmd::params::{check_keys, check_params}; pub use cmd::pathops::auto_simplify_level; pub use cmd::rasterfx::{export_pdf, flatten_raster_effects}; diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rs index f89cc98ff8..a8b000c9c6 100644 --- a/crates/engine/src/tests.rs +++ b/crates/engine/src/tests.rs @@ -3268,6 +3268,128 @@ fn flare_rotation_turns_only_the_rays() { } } +/// A flare keeps its settings: `shape.editFlare` draws it again with the settings changed, in its +/// place and transformed as it has been since, as one undo step (none when nothing changes). A +/// flare with a changed part, a locked one and an expanded one are not edited. +#[test] +fn edit_flare_draws_a_transformed_flare_again_in_its_place_in_one_undo_step() { + let mut s = session(); + let p = json!({"cx": 200, "cy": 200, "diameter": 60, "rays": 9, "rings": 4, "x2": 400, "y2": 200, "seed": 3}); + let id = NodeId(s.execute("shape.flare", &p).unwrap()["id"].as_u64().unwrap()); + // Reflected twice, sheared and back, turned a quarter and moved: it stays a flare. + for (c, p) in [ + ("object.reflect", json!({"axis": "vertical"})), + ("object.reflect", json!({"axis": "horizontal"})), + ("object.shear", json!({"angle": 30})), + ("object.shear", json!({"angle": -30})), + ("object.rotate", json!({"angle": 90})), + ("object.move", json!({"dx": 50, "dy": 10})), + ] { + s.execute(c, &p).unwrap(); + } + let spec = |s: &Session| flare_settings(&s.doc().unwrap().doc, id).expect("still a flare"); + let part = |s: &Session, name: &str| { + let g = s.doc().unwrap().doc.node(id).unwrap(); + g.children().unwrap().iter().filter(|c| c.name.as_deref() == Some(name)).map(|c| c.geometric_bounds().unwrap()).collect::>() + }; + let (c, e) = (spec(&s).center().unwrap(), spec(&s).end().unwrap()); + // The quarter turn made the rings run vertically, 200 points from the center. + assert!((c.distance(e) - 200.0).abs() < 1e-6 && (c.x - e.x).abs() < 1e-6, "{c:?} {e:?}"); + let undo = s.doc().unwrap().history.undo.len(); + s.execute("shape.editFlare", &json!({"diameter": 100, "rings": 6, "rays": 0})).unwrap(); + assert_eq!(s.doc().unwrap().history.undo.len(), undo + 1); + assert_eq!(s.doc().unwrap().selection.objects, vec![id]); + let centre = part(&s, "Center")[0]; + assert!(centre.center().distance(c) < 1e-6 && (centre.width() - 100.0).abs() < 1e-6, "{centre:?}"); + assert_eq!((part(&s, "Ring").len(), part(&s, "Rays").len()), (6, 0)); + assert!(spec(&s).end().unwrap().distance(e) < 1e-6, "the end point stays"); + // Each ring lies on the line from the center to the end point. + assert!(part(&s, "Ring").iter().all(|r| (r.center().x - c.x).abs() < 1e-6), "{:?}", part(&s, "Ring")); + // The center handle, where it is drawn now: the end point stays where it is. + s.execute("shape.editFlare", &json!({"ids": [id.0], "cx": c.x + 20.0, "cy": c.y})).unwrap(); + assert!(spec(&s).center().unwrap().distance(Point::new(c.x + 20.0, c.y)) < 1e-6); + assert!(spec(&s).end().unwrap().distance(e) < 1e-6); + assert!(part(&s, "Center")[0].center().distance(Point::new(c.x + 20.0, c.y)) < 1e-6); + // The end handle, then the path length and direction. + s.execute("shape.editFlare", &json!({"x2": c.x + 20.0, "y2": c.y + 80.0})).unwrap(); + assert!(spec(&s).end().unwrap().distance(Point::new(c.x + 20.0, c.y + 80.0)) < 1e-6); + // The path length and direction are where the flare is drawn now, though it was turned. + s.execute("shape.editFlare", &json!({"direction": 0, "pathLength": 50})).unwrap(); + assert!(spec(&s).end().unwrap().distance(Point::new(c.x + 70.0, c.y)) < 1e-6, "{:?}", spec(&s).end()); + s.execute("edit.undo", &json!({})).unwrap(); + // Nothing changes: no undo step. + let undo = s.doc().unwrap().history.undo.len(); + s.execute("shape.editFlare", &json!({"diameter": 100})).unwrap(); + assert_eq!(s.doc().unwrap().history.undo.len(), undo); + // Bad values are refused. + for bad in [json!({"rings": 2.5}), json!({"diameter": "big"}), json!({"cx": 10}), json!({"diameter": 1e20})] { + assert!(s.execute("shape.editFlare", &bad).is_err(), "{bad}"); + } + assert_eq!(s.doc().unwrap().history.undo.len(), undo); + s.execute("edit.undo", &json!({})).unwrap(); + assert!(spec(&s).end().unwrap().distance(e) < 1e-6, "undo puts the end point back"); + // A changed part: no longer a flare. + s.edit("Opacity", |d, _| { + let ring = d.node(id).unwrap().children().unwrap().iter().find(|c| c.name.as_deref() == Some("Center")).unwrap().id; + d.node_mut(ring).unwrap().opacity = 0.25; + Ok(()) + }) + .unwrap(); + assert_eq!(s.execute("shape.editFlare", &json!({"rings": 3})).unwrap_err().to_string(), "select a flare"); + s.execute("edit.undo", &json!({})).unwrap(); + // A locked flare. + s.execute("object.lock", &json!({})).unwrap(); + assert!(s.execute("shape.editFlare", &json!({"ids": [id.0], "rings": 3})).is_err()); + s.execute("object.unlockAll", &json!({})).unwrap(); + // Object › Expand: a plain group that is no longer a flare. + s.execute("object.expand", &json!({"object": true, "fill": false, "stroke": false})).unwrap(); + assert!(s.doc().unwrap().doc.node(id).unwrap().extras().flare.is_none()); + assert!(s.execute("shape.editFlare", &json!({"rings": 3})).is_err()); +} + +/// `shape.flare` reads whole-number counts written as floats, and refuses fractions. +#[test] +fn flare_counts_are_whole_numbers() { + let mut s = session(); + let id = NodeId(s.execute("shape.flare", &json!({"cx": 100, "cy": 100, "rays": 4.0, "rings": 2})).unwrap()["id"].as_u64().unwrap()); + let g = s.doc().unwrap().doc.node(id).unwrap(); + let rays = g.children().unwrap().iter().find(|c| c.name.as_deref() == Some("Rays")).unwrap(); + assert_eq!(rays.path_data().unwrap().subpaths.len(), 4); + assert!(s.execute("shape.flare", &json!({"cx": 100, "cy": 100, "rays": 2.5})).is_err()); +} + +/// A flare drawn again keeps its parts' pixel-aligned property, whatever the document's Align New +/// Objects to Pixel Grid is now, and a pixel-aligned flare that was moved is still a flare. +#[test] +fn edit_flare_keeps_its_parts_pixel_alignment() { + let mut s = session(); + let aligned = |s: &Session, id: NodeId| -> Vec { + s.doc().unwrap().doc.node(id).unwrap().children().unwrap().iter().map(|c| c.extras().pixel_aligned).collect() + }; + s.execute("document.setup", &json!({"alignNewObjectsToPixelGrid": true})).unwrap(); + let on = NodeId(s.execute("shape.flare", &json!({"cx": 100.3, "cy": 200.6, "rings": 2})).unwrap()["id"].as_u64().unwrap()); + s.execute("object.move", &json!({"dx": 10.25, "dy": 3.5})).unwrap(); + s.execute("document.setup", &json!({"alignNewObjectsToPixelGrid": false})).unwrap(); + let part = |s: &Session, id: NodeId, name: &str| -> NodeId { + s.doc().unwrap().doc.node(id).unwrap().children().unwrap().iter().find(|c| c.name.as_deref() == Some(name)).unwrap().id + }; + let centre = part(&s, on, "Center"); + s.execute("shape.editFlare", &json!({"rings": 4})).unwrap(); + assert!(aligned(&s, on).len() > 4 && aligned(&s, on).iter().all(|a| *a)); + // Each part drawn again keeps its id and its own property: without the rays, the center does + // not take theirs. + assert_eq!(part(&s, on, "Center"), centre); + s.execute("object.setPixelAligned", &json!({"ids": [centre.0], "on": false})).unwrap(); + s.execute("select.set", &json!({"ids": [on.0]})).unwrap(); + s.execute("shape.editFlare", &json!({"rays": 0})).unwrap(); + let node = |s: &Session, id: NodeId| s.doc().unwrap().doc.node(id).unwrap().extras().pixel_aligned; + assert!(!node(&s, centre) && node(&s, part(&s, on, "Halo"))); + let off = NodeId(s.execute("shape.flare", &json!({"cx": 300.3, "cy": 200.6, "rings": 2})).unwrap()["id"].as_u64().unwrap()); + s.execute("document.setup", &json!({"alignNewObjectsToPixelGrid": true})).unwrap(); + s.execute("shape.editFlare", &json!({"rings": 4})).unwrap(); + assert!(aligned(&s, off).iter().all(|a| !*a)); +} + #[test] fn reshape_moves_the_grabbed_point_and_its_neighbourhood() { let mut s = session(); diff --git a/crates/tools/src/extra.rs b/crates/tools/src/extra.rs index d1a2672402..83227f3d20 100644 --- a/crates/tools/src/extra.rs +++ b/crates/tools/src/extra.rs @@ -3,7 +3,9 @@ //! Flare: drag sets the center and its size and turns the rays as the pointer moves up or down //! (Shift holds their turn; click without dragging opens the Flare Tool Options), then a click //! sets the end point of the rings; Space held during either drag moves the flare. The rest comes -//! from the tool's options (the Flare Tool Options, which last). Reshape: a click on a selected +//! from the tool's options (the Flare Tool Options, which last). With one flare selected, the tool +//! shows its center and end handles, and dragging either changes the flare's length and direction +//! (`shape.editFlare`). Reshape: a click on a selected //! path sets a focal point (adding an anchor on a segment), Shift-click adds or removes more, and //! a drag from a focal point moves them all; the engine's `path.reshape` stretches the selected //! anchors between them and the anchors that stay. @@ -66,6 +68,38 @@ pub struct FlareTool { /// Whether the flare has rays and rings (the options' Rays and Rings checkboxes). rays_on: bool, rings_on: bool, + /// A drag of the selected flare's center or end handle. + handle: Option, +} + +/// A drag of a selected flare's handle: the flare, whether it is the end handle (else the center), +/// where the handle was, where it was pressed and whether the drag has begun its undo step. +#[derive(Clone, Copy, Debug)] +struct HandleDrag { + id: vectorcraft_doc::NodeId, + end: bool, + from: Point, + at: Point, + began: bool, +} + +/// The flare whose handles the Flare tool shows: the one selected object, when it is a flare that +/// can be edited, with its center and the rings' end point. +fn selected_flare(cx: &ToolContext) -> Option<(vectorcraft_doc::NodeId, Point, Point)> { + let [id] = cx.selection.objects.as_slice() else { return None }; + if !cx.doc.is_editable(*id) { + return None; + } + let node = cx.doc.node(*id)?; + let spec = node.extras().flare.as_deref().filter(|spec| spec.draws(node))?; + Some((*id, spec.center()?, spec.end()?)) +} + +/// `shape.editFlare`'s params for handle drag `h` with the pointer at `pointer`: the handle moves +/// as far as the pointer has. +fn handle_params(h: HandleDrag, pointer: Point) -> Value { + let p = h.from + (pointer - h.at); + if h.end { json!({ "ids": [h.id.0], "x2": p.x, "y2": p.y }) } else { json!({ "ids": [h.id.0], "cx": p.x, "cy": p.y }) } } impl Default for FlareTool { @@ -81,6 +115,7 @@ impl Default for FlareTool { values: FLARE_OPTIONS.map(|(_, default, _, _)| default), rays_on: true, rings_on: true, + handle: None, } } } @@ -146,12 +181,40 @@ impl Tool for FlareTool { "flare" } fn busy(&self) -> bool { - self.drag.is_some() || self.placed.is_some() + self.drag.is_some() || self.placed.is_some() || self.handle.is_some() } fn pointer(&mut self, cx: &ToolContext, ev: &PointerEvent) -> Vec { self.hover = ev.pos; + if let Some(mut h) = self.handle { + return match ev.kind { + PointerKind::Drag if h.began => vec![Action::Preview("shape.editFlare".into(), handle_params(h, ev.pos))], + PointerKind::Drag if ev.pos.distance(h.at) < cx.tol(3.0) => vec![], + PointerKind::Drag => { + h.began = true; + self.handle = Some(h); + vec![Action::Begin("Edit Flare".into()), Action::Preview("shape.editFlare".into(), handle_params(h, ev.pos))] + } + PointerKind::Up => { + self.handle = None; + if h.began { vec![Action::Preview("shape.editFlare".into(), handle_params(h, ev.pos)), Action::Commit] } else { vec![] } + } + _ => vec![], + }; + } match ev.kind { PointerKind::Down => { + // A press on the selected flare's center or end handle drags that handle. + if self.placed.is_none() + && let Some((id, c, e)) = selected_flare(cx) + { + let tol = cx.tol(4.0); + let (dc, de) = (ev.pos.distance(c), ev.pos.distance(e)); + if dc.min(de) <= tol { + let end = de < dc; + self.handle = Some(HandleDrag { id, end, from: if end { e } else { c }, at: ev.pos, began: false }); + return vec![]; + } + } if self.placed.is_none() { self.drag = Some((ev.pos, ev.pos)); self.rays = None; @@ -223,6 +286,11 @@ impl Tool for FlareTool { }; return vec![Action::Preview("shape.flare".into(), preview)]; } + if key == ToolKey::Escape + && let Some(h) = self.handle.take() + { + return if h.began { vec![Action::Cancel] } else { vec![] }; + } if key == ToolKey::Escape && self.busy() { self.rays = None; self.drag = None; @@ -235,15 +303,26 @@ impl Tool for FlareTool { fn deactivate(&mut self, _cx: &ToolContext) -> Vec { // Switching away after the centre drag keeps the flare with the rings its options give. self.drag = None; + if self.handle.take().is_some_and(|h| h.began) { + return vec![Action::Commit]; + } if self.placed.take().is_some() && std::mem::take(&mut self.began) { vec![Action::Commit] } else { vec![] } } - fn overlays(&self, _cx: &ToolContext) -> Vec { + fn overlays(&self, cx: &ToolContext) -> Vec { match (self.drag, self.placed) { (Some((c, p)), _) => { vec![Overlay::Path { path: ellipse_path(c, p.distance(c), p.distance(c), 0.0), color: BLUE, width: 1.0, dashed: false }] } (_, Some((c, _))) => vec![Overlay::Line { a: c, b: self.hover, color: BLUE, dashed: true }], - _ => vec![], + // The selected flare's center and end handles. + _ => match selected_flare(cx) { + Some((_, c, e)) => vec![ + Overlay::Line { a: c, b: e, color: BLUE, dashed: true }, + Overlay::Anchor { p: c, color: BLUE, filled: self.handle.is_some_and(|h| !h.end), size: 7.0 }, + Overlay::Anchor { p: e, color: BLUE, filled: self.handle.is_some_and(|h| h.end), size: 7.0 }, + ], + None => vec![], + }, } } fn cursor(&self, _cx: &ToolContext, _p: Point, _mods: Mods) -> Cursor { @@ -791,6 +870,61 @@ mod tests { assert_eq!(t.turn, 10.0); } + /// With one flare selected, the tool shows its center and end handles where the flare is now + /// drawn, and dragging either edits the flare (`shape.editFlare`) as one undo step; a press + /// away from them draws a new flare. + #[test] + fn dragging_a_selected_flares_handles_changes_its_length_and_direction() { + use crate::testutil::*; + use vectorcraft_doc::flare::{FlareSpec, part_node, parts}; + use vectorcraft_doc::{Node, Selection}; + let (mut d, _) = doc_with_rect(); + let gid = d.alloc_id(); + let v = json!({ "cx": 100.0, "cy": 100.0, "x2": 300.0, "y2": 100.0, "rays": 3, "rings": 2, "seed": 5, "diameter": 30.0, + "opacity": 50.0, "brightness": 30.0, "growth": 20.0, "fuzziness": 50.0, "longest": 300.0, "rayFuzziness": 100.0, + "rotation": 0.0, "largest": 50.0 }); + let xf = vectorcraft_geom::Affine::translate((10.0, 20.0)); + let children: Vec<_> = parts(&v).into_iter().map(|part| std::sync::Arc::new(part_node(d.alloc_id(), part, xf, false))).collect(); + let edited = children[0].id; + let mut g = Node::group(gid, children); + g.extras_mut().flare = Some(Box::new(FlareSpec { params: v, transform: xf })); + let layer = d.layers[0].id; + d.insert(Some(layer), usize::MAX, g).unwrap_or_else(|e| panic!("{e}")); + let s = Selection { objects: vec![gid], ..Default::default() }; + let p = paint(); + let cx = cx(&d, &s, &p); + let mut t = FlareTool::default(); + let ov = t.overlays(&cx); + let anchors: Vec = ov.iter().filter_map(|o| if let Overlay::Anchor { p, .. } = o { Some(*p) } else { None }).collect(); + assert_eq!(anchors, vec![Point::new(110.0, 120.0), Point::new(310.0, 120.0)]); + // The end handle, grabbed 2 points off: it moves as far as the pointer. + assert!(t.pointer(&cx, &PointerEvent::new(PointerKind::Down, 312.0, 120.0)).is_empty()); + assert!(t.busy()); + let a = t.pointer(&cx, &PointerEvent::new(PointerKind::Drag, 312.0, 160.0)); + assert_eq!(a.first(), Some(&Action::Begin("Edit Flare".into()))); + let a = t.pointer(&cx, &PointerEvent::new(PointerKind::Up, 302.0, 200.0)); + assert_eq!(a, vec![Action::Preview("shape.editFlare".into(), json!({ "ids": [gid.0], "x2": 300.0, "y2": 200.0 })), Action::Commit]); + // The center handle; Escape cancels its drag. + t.pointer(&cx, &PointerEvent::new(PointerKind::Down, 110.0, 121.0)); + let a = t.pointer(&cx, &PointerEvent::new(PointerKind::Drag, 150.0, 121.0)); + assert_eq!(a.last(), Some(&Action::Preview("shape.editFlare".into(), json!({ "ids": [gid.0], "cx": 150.0, "cy": 120.0 })))); + assert_eq!(t.key(&cx, ToolKey::Escape, Mods::default()), vec![Action::Cancel]); + assert!(!t.busy()); + // A click on a handle without a drag changes nothing. + t.pointer(&cx, &PointerEvent::new(PointerKind::Down, 110.0, 120.0)); + assert!(t.pointer(&cx, &PointerEvent::new(PointerKind::Up, 110.0, 120.0)).is_empty()); + // Away from the handles a drag draws a new flare. + t.pointer(&cx, &PointerEvent::new(PointerKind::Down, 200.0, 300.0)); + let a = t.pointer(&cx, &PointerEvent::new(PointerKind::Drag, 240.0, 300.0)); + assert_eq!(a.first(), Some(&Action::Begin("Flare".into()))); + // Without a flare selected, no handles show. + let none = Selection::default(); + assert!(FlareTool::default().overlays(&crate::testutil::cx(&d, &none, &p)).is_empty()); + // A flare with an edited part is no longer edited as a flare: no handles show. + d.node_mut(edited).unwrap_or_else(|| panic!("no part")).opacity = 0.25; + assert!(FlareTool::default().overlays(&crate::testutil::cx(&d, &s, &p)).is_empty()); + } + /// Space held while dragging out a flare moves it at its current size and turn, in the center /// drag and in the drag that places the rings' end point; let go, the drag goes on from there. #[test] diff --git a/crates/ui-egui/src/dialogs/flare_options.rs b/crates/ui-egui/src/dialogs/flare_options.rs index b94f6a7c2e..cf01d150d0 100644 --- a/crates/ui-egui/src/dialogs/flare_options.rs +++ b/crates/ui-egui/src/dialogs/flare_options.rs @@ -5,11 +5,15 @@ //! grid shows). While Alt (Option on macOS) is held, Cancel reads Reset, which puts every option //! back to the tool's default and leaves the dialog open (`ui.dialogReset`). A click-opened //! dialog previews its settings live; Reset refreshes that preview and Cancel rolls it back. +//! Opened from the toolbar with flares selected, it shows the first one's settings, and OK draws +//! the selected flares again with the settings changed in the dialog (`shape.editFlare`); the tool +//! keeps its options. //! //! Fields: the options (`vectorcraft_tools::extra::FLARE_OPTIONS`): `diameter` and `pathLength` //! (points), `opacity`, `brightness`, `growth`, `fuzziness`, `longest`, `rayFuzziness` and -//! `largest` (%), `rays` and `rings` (counts), `direction` (degrees); `raysOn` and `ringsOn`; and -//! `x`, `y` where a click opened it, with `preview` on initially for that click. +//! `largest` (%), `rays` and `rings` (counts), `direction` (degrees); `raysOn` and `ringsOn`; +//! `x`, `y` where a click opened it, with `preview` on initially for that click; and `flares` +//! (ids) with `shown` (the settings the dialog opened with) for the selected flares. use serde_json::{Map, Value, json}; use vectorcraft_geom::Point; @@ -38,7 +42,8 @@ const LABEL_W: f32 = 78.0; const FIELD_W: f32 = 90.0; /// Open the Flare Tool Options with the tool's values; `at`: where a click opened them, to draw a -/// flare there on OK. +/// flare there on OK. Opened without a click while flares are selected, they show the first one's +/// settings, to change the selected flares on OK. pub fn open(app: &mut VectorcraftApp, at: Option) -> Value { let mut fields = match app.session.tool_options_of("flare") { Value::Object(o) => o, @@ -48,11 +53,79 @@ pub fn open(app: &mut VectorcraftApp, at: Option) -> Value { fields.insert("preview".into(), json!(true)); fields.insert("x".into(), json!(p.x)); fields.insert("y".into(), json!(p.y)); + } else if let Some((ids, settings)) = selected_flares(app) { + // A flare without rays or rings shows that checkbox off, with the tool's count. + for (key, on) in [("rays", "raysOn"), ("rings", "ringsOn")] { + let n = settings.get(key).and_then(Value::as_f64).unwrap_or(0.0); + fields.insert(on.into(), json!(n > 0.0)); + if n > 0.0 { + fields.insert(key.into(), json!(n)); + } + } + for (key, ..) in FLARE_OPTIONS.iter().filter(|(k, ..)| !matches!(*k, "rays" | "rings")) { + if let Some(v) = settings.get(*key) { + fields.insert(key.to_string(), v.clone()); + } + } + fields.insert("shown".into(), Value::Object(shown(&fields))); + fields.insert("flares".into(), json!(ids)); } app.ui.dialog = Some(Dialog { kind: KIND.into(), fields }); json!({ "dialog": KIND }) } +/// The selected flares that can be edited (ids) and the first one's settings as the dialog shows +/// them: its rings' path length and direction from its center to its end point, where the flare is +/// drawn now. +fn selected_flares(app: &VectorcraftApp) -> Option<(Vec, Map)> { + let st = app.session.doc().ok()?; + let flares: Vec<_> = st + .selection + .objects + .iter() + .filter(|id| st.doc.is_editable(**id)) + .filter_map(|id| vectorcraft_engine::flare_settings(&st.doc, *id).map(|spec| (id.0, spec))) + .collect(); + let (_, first) = flares.first()?; + let Value::Object(mut settings) = first.params.clone() else { return None }; + let d = first.end()? - first.center()?; + settings.insert("pathLength".into(), json!(d.hypot())); + // Counter-clockwise from 3 o'clock, 0° to 360°, as `shape.flare` takes it. + settings.insert("direction".into(), json!((-d.y).atan2(d.x).to_degrees().rem_euclid(360.0))); + Some((flares.iter().map(|(id, _)| *id).collect(), settings)) +} + +/// The settings `fields` give a flare: each option, with a count of 0 when its checkbox is off. +fn shown(fields: &Map) -> Map { + let get = |key: &str, default: f64| fields.get(key).and_then(Value::as_f64).unwrap_or(default); + let on = |key: &str| fields.get(key).and_then(Value::as_bool) != Some(false); + FLARE_OPTIONS + .iter() + .map(|&(key, default, ..)| { + let v = match key { + "rays" if !on("raysOn") => 0.0, + "rings" if !on("ringsOn") => 0.0, + "rays" | "rings" => get(key, default).round(), + _ => get(key, default), + }; + (key.to_string(), json!(v)) + }) + .collect() +} + +/// `shape.editFlare`'s params for the selected flares: the settings changed since the dialog opened. +fn edit_params(d: &Dialog) -> Option { + let ids = d.fields.get("flares")?.clone(); + let start = d.fields.get("shown").and_then(Value::as_object).cloned().unwrap_or_default(); + let mut params = json!({ "ids": ids }); + for (key, v) in shown(&d.fields) { + if start.get(&key) != Some(&v) { + params[key.as_str()] = if matches!(key.as_str(), "rays" | "rings") { json!(v.as_f64().unwrap_or(0.0) as u64) } else { v }; + } + } + Some(params) +} + /// A row for option `key`, kept within its range: a distance in `unit`, else a number. fn field(ui: &mut egui::Ui, d: &mut Dialog, unit: vectorcraft_doc::Unit, (key, label): (&str, &str)) { let Some(&(_, default, lo, hi)) = FLARE_OPTIONS.iter().find(|(k, ..)| *k == key) else { return }; @@ -119,8 +192,12 @@ fn body(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool { false } -/// A click-created flare previews at that original click; toolbar options draw no artwork. +/// A click-created flare previews at that original click, and the selected flares preview with the +/// settings changed; toolbar options draw no artwork. fn preview_command(app: &VectorcraftApp, d: &Dialog) -> Option<(String, Value)> { + if let Some(params) = edit_params(d) { + return Some(("shape.editFlare".into(), params)); + } let at = Point::new(d.fields.get("x")?.as_f64().filter(|v| v.is_finite())?, d.fields.get("y")?.as_f64().filter(|v| v.is_finite())?); // Use the same clamping and whole-count conversion as accepted tool settings. let mut tool = vectorcraft_tools::create("flare"); @@ -142,8 +219,16 @@ fn reset(_: &VectorcraftApp, d: &mut Dialog) { } } -/// OK: set the tool's options; opened by a click, draw a flare there with them. +/// OK: set the tool's options; opened by a click, draw a flare there with them. Opened for the +/// selected flares, draw them again with the settings changed, leaving the tool's options. fn confirm(app: &mut VectorcraftApp, d: &Dialog) -> DialogResult { + if let Some(params) = edit_params(d) { + return if d.fields.contains_key(form::PREVIEWED) { + form::commit_preview(app, "shape.editFlare", params) + } else { + run_and_close(app, "shape.editFlare", params) + }; + } let command = preview_command(app, d); if command.is_none() && (d.fields.contains_key("x") || d.fields.contains_key("y") || d.fields.contains_key(form::PREVIEWED)) { return Err("Flare click coordinates must be finite numbers".into()); @@ -317,6 +402,41 @@ mod tests { assert_eq!((o["opacity"].as_f64(), o["diameter"].as_f64()), (Some(100.0), Some(0.0))); } + /// With a flare selected, the toolbar's Flare Tool Options show its settings, and OK draws it + /// again with the settings changed, as one undo step, leaving the tool's options. + #[test] + fn with_a_flare_selected_the_options_show_its_settings_and_ok_draws_it_again() { + let mut app = app(); + let flare = json!({"cx": 200, "cy": 200, "diameter": 60, "rays": 0, "rings": 4, "x2": 200, "y2": 0, "largest": 80, "seed": 5}); + app.run("shape.flare", flare).unwrap(); + app.run("object.move", json!({"dx": 30, "dy": 0})).unwrap(); + let options = app.session.tool_options_of("flare"); + app.run("tool.options", json!({"tool": "flare"})).unwrap(); + painted(&mut app); + let d = app.ui.dialog.as_mut().unwrap(); + let shown = (d.f64("diameter", 0.0), d.bool("raysOn"), d.f64("rays", 0.0), d.f64("rings", 0.0), d.f64("largest", 0.0)); + assert_eq!(shown, (60.0, false, 15.0, 4.0, 80.0)); + assert!((d.f64("pathLength", 0.0) - 200.0).abs() < 1e-9 && (d.f64("direction", 0.0) - 90.0).abs() < 1e-9); + d.fields.insert("rings".into(), json!(7)); + d.fields.insert("raysOn".into(), json!(true)); + let depth = app.session.doc().unwrap().history.undo.len(); + super::super::confirm(&mut app).unwrap(); + assert!(app.ui.dialog.is_none()); + assert_eq!(app.session.doc().unwrap().history.undo.len(), depth + 1); + let parts = flare_parts(&app); + assert_eq!((parts.iter().filter(|p| *p == "Ring").count(), parts.iter().any(|p| p == "Rays")), (7, true), "{parts:?}"); + // Still where it was moved to. + let doc = &app.session.doc().unwrap().doc; + let id = app.session.doc().unwrap().selection.objects[0]; + assert!(vectorcraft_engine::flare_settings(doc, id).unwrap().center().unwrap().distance(Point::new(230.0, 200.0)) < 1e-9); + assert_eq!(app.session.tool_options_of("flare"), options); + // With nothing selected, the dialog shows the tool's options again. + app.run("select.none", json!({})).unwrap(); + app.run("tool.options", json!({"tool": "flare"})).unwrap(); + let d = app.ui.dialog.as_ref().unwrap(); + assert_eq!((d.f64("diameter", 0.0), d.fields.contains_key("flares")), (100.0, false)); + } + #[test] fn ui_dialog_reset_puts_the_defaults_back_and_keeps_where_a_click_opened_it() { let mut app = app(); diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index 948b295e17..0dfdb5a443 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -1234,6 +1234,7 @@ font-technology Variable Променливи Fit to Selected Art Побиране спрямо избраната графика Flag… Знаме… Flare Взрив + Edit Flare Редактиране на взрива Flare Tool Инструмент „Взрив“ Flare Tool Options Опции на инструмента „Взрив“ Halo Ореол @@ -4615,6 +4616,7 @@ axis Both И двете @msg select a blend изберете преход (blend) @msg select a blend or give `id` изберете преливане или задайте неговия `id` @msg select a clip group изберете група за изрязване +@msg select a flare изберете взрив @msg select a gradient mesh изберете мрежа на градиент (gradient mesh) @msg select a linked image: an embedded one has no file изберете свързано изображение: вграденото няма файл @msg select a repeat изберете повторение (repeat) diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index f8d6fa263b..358aeea968 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -4049,6 +4049,7 @@ theme Appearance Izgled Set Tab Stops Postavi tabulatore Tab Stops Tabulatori Flare Odsjaj + Edit Flare Uredi odsjaj Rays Zrake Rectangle Pravougaonik Paintbrush Kist @@ -5011,6 +5012,7 @@ imageTrace Outline Obris @msg select a blend odaberite stapanje @msg select a blend or give `id` odaberite stapanje ili navedite `id` @msg select a clip group odaberite grupu isijecanja +@msg select a flare odaberite odsjaj @msg select a gradient mesh odaberite gradijentnu mrežu @msg select a linked image: an embedded one has no file odaberite povezanu sliku: ugrađena nema datoteku @msg select a repeat odaberite ponavljanje diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 3ed3ca8331..cf7b13b28d 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -1738,6 +1738,7 @@ digits Malayalam Malaiàlam Fixed Fix Flag… Marca… Flare Resplendor + Edit Flare Edita el resplendor Flare Tool Eina de resplendor Flare Tool Options Opcions de l’eina de resplendor Flat Angle Angle pla @@ -6106,6 +6107,7 @@ digits Malayalam Malaiàlam @msg select a blend selecciona una fusió @msg select a blend or give `id` selecciona una fusió o dona `id` @msg select a clip group selecciona un grup de retall +@msg select a flare selecciona un resplendor @msg select a gradient mesh selecciona una malla de degradat @msg select a linked image: an embedded one has no file selecciona una imatge enllaçada: una d’incrustada no té fitxer @msg select a Live Paint group selecciona un grup de pintura interactiva diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 161e235c56..d1c1b9cab9 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -4105,6 +4105,7 @@ theme Appearance Motiv Set Tab Stops Nastavit zarážky tabulátoru Tab Stops Zarážky tabulátoru Flare Odlesk + Edit Flare Upravit odlesk Rays Paprsky Rectangle Obdélník Paintbrush Štětec @@ -5185,6 +5186,7 @@ imageTrace Outline Obrys @msg select a blend vyberte prolnutí @msg select a blend or give `id` vyberte prolnutí, nebo zadejte `id` @msg select a clip group vyberte ořezovou skupinu +@msg select a flare vyberte odlesk @msg select a gradient mesh vyberte přechodovou síť @msg select a linked image: an embedded one has no file vyberte propojený obrázek: vložený nemá soubor @msg select a repeat vyberte opakování diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index fd0b7c042e..0073d6f1cf 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -4431,6 +4431,7 @@ theme Appearance Udseende Set Tab Stops Angiv tabulatorstop Tab Stops Tabulatorstop Flare Flare + Edit Flare Redigér flare Rays Stråler Rectangle Rektangel Paintbrush Malerpensel @@ -5323,6 +5324,7 @@ imageTrace Outline Kontur @msg select a Live Paint group markér en Live Paint-gruppe @msg select a blend markér en blanding @msg select a clip group markér en klipgruppe +@msg select a flare markér en flare @msg select a gradient mesh markér et gradientnet @msg select a linked image: an embedded one has no file markér et linket billede: et indlejret har ingen fil @msg select a repeat markér en gentagelse diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 2a5f32a5d9..1197f96944 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -1267,6 +1267,7 @@ font-technology Variable Variabel Fit to Selected Art An ausgewählte Grafik anpassen Flag… Flagge… Flare Blendenfleck + Edit Flare Blendenfleck bearbeiten Flare Tool Blendenfleck-Werkzeug Flare Tool Options Optionen für das Blendenfleck-Werkzeug Halo Lichtkranz @@ -4800,6 +4801,7 @@ theme Appearance Erscheinungsbild @msg select a blend wählen Sie eine Angleichung aus @msg select a blend or give `id` wählen Sie eine Angleichung aus oder geben Sie `id` an @msg select a clip group wählen Sie eine Schnittgruppe aus +@msg select a flare wählen Sie einen Blendenfleck aus @msg select a gradient mesh wählen Sie ein Verlaufsgitter aus @msg select a linked image: an embedded one has no file wählen Sie ein verknüpftes Bild aus: Ein eingebettetes hat keine Datei @msg select a repeat wählen Sie eine Wiederholung aus diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index b1b7b4d039..8c4153e396 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -1212,6 +1212,7 @@ font-technology Variable Μεταβλητές Fit to Selected Art Προσαρμογή στο επιλεγμένο γραφικό Flag… Σημαία… Flare Λάμψη + Edit Flare Επεξεργασία λάμψης Flare Tool Λάμψη (Flare Tool) Flare Tool Options Επιλογές εργαλείου λάμψης Halo Άλως @@ -4834,6 +4835,7 @@ digits Malayalam Μαλαγιάλαμ @msg select a blend επιλέξτε ανάμειξη @msg select a blend or give `id` επιλέξτε ανάμειξη ή δώστε το `id` @msg select a clip group επιλέξτε ομάδα αποκοπής +@msg select a flare επιλέξτε λάμψη @msg select a gradient mesh επιλέξτε πλέγμα ντεγκραντέ @msg select a linked image: an embedded one has no file επιλέξτε συνδεδεμένη εικόνα: η ενσωματωμένη δεν έχει αρχείο @msg select a repeat επιλέξτε επανάληψη diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 5b3c675f7b..451a5654f4 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -1288,6 +1288,7 @@ font-technology Variable Variables Fit to Selected Art Encajar en la ilustración seleccionada Flag… Bandera… Flare Destello + Edit Flare Editar destello Flare Tool Herramienta Destello Flare Tool Options Opciones de la herramienta Destello Halo Halo @@ -4878,6 +4879,7 @@ axis Both Ambos @msg select a blend selecciona una fusión @msg select a blend or give `id` selecciona una fusión o indica su `id` @msg select a clip group selecciona un grupo de recorte +@msg select a flare selecciona un destello @msg select a gradient mesh selecciona una malla de degradado @msg select a linked image: an embedded one has no file selecciona una imagen vinculada: una incrustada no tiene archivo @msg select a repeat selecciona una repetición diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index e77a617c52..cb2a4d8227 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -4029,6 +4029,7 @@ theme Appearance Ulkoasu Set Tab Stops Aseta sarkainkohdat Tab Stops Sarkainkohdat Flare Häikäisy + Edit Flare Muokkaa häikäisyä Rays Säteet Rectangle Suorakulmio Paintbrush Maalaussivellin @@ -5093,6 +5094,7 @@ imageTrace Outline Ääriviiva @msg select a blend valitse sulautus @msg select a blend or give `id` valitse sulautus tai anna sen `id` @msg select a clip group valitse leikkausryhmä +@msg select a flare valitse häikäisy @msg select a gradient mesh valitse liukuväriverkko @msg select a linked image: an embedded one has no file valitse linkitetty kuva: upotetulla kuvalla ei ole tiedostoa @msg select a repeat valitse toisto diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 2762d2a954..7d0c1cad6d 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -1282,6 +1282,7 @@ font-technology Variable Variables Fit to Selected Art Ajuster à l’illustration sélectionnée Flag… Drapeau… Flare Halo + Edit Flare Modifier le halo Flare Tool Outil Halo Flare Tool Options Options de l’outil Halo Halo Halo @@ -4865,6 +4866,7 @@ axis Both Les deux @msg select a blend sélectionnez un dégradé de formes @msg select a blend or give `id` sélectionnez un dégradé de formes ou indiquez son `id` @msg select a clip group sélectionnez un groupe d’écrêtage +@msg select a flare sélectionnez un halo @msg select a gradient mesh sélectionnez un filet de dégradé @msg select a linked image: an embedded one has no file sélectionnez une image liée : une image incorporée n’a pas de fichier @msg select a repeat sélectionnez une répétition diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index 1c96900b2b..f307fad521 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -1412,6 +1412,7 @@ Fix Selected પસંદ કરેલું ઠીક કરો Flag… ફ્લેગ… Flare ફ્લેર + Edit Flare ફ્લેર સંપાદિત કરો Flare Tool ફ્લેર ટૂલ Flare Tool Options ફ્લેર ટૂલ વિકલ્પો Flat Image ફ્લેટ છબી diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 548f961f51..b500fa4b21 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -1939,6 +1939,7 @@ antiAlias Sharp शार्प Fixed निश्चित Flag… झंडा… Flare फ्लेयर + Edit Flare फ्लेयर संपादित करें Flare Tool फ्लेयर टूल Flare Tool Options फ़्लेयर टूल ऑप्शन्स Flat Angle फ्लैट कोण @@ -7831,6 +7832,7 @@ antiAlias Sharp शार्प @msg select a blend or give `id` एक मिश्रण सिलेक्ट करें या `id` देना @msg select a blend to set easing or color shift Easing या रंग शिफ्ट सेट करने के लिए एक मिश्रण सिलेक्ट करें @msg select a clip group एक क्लिप समूह चुनें +@msg select a flare एक फ्लेयर चुनें @msg select a compound shape एक मिश्रित आकार चुनें @msg Select a dimension first पहले आयाम सिलेक्ट करें @msg select a gradient mesh एक ग्रेडिएंट जाल सिलेक्ट करें diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 200b45d1b1..22611fc847 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -1602,6 +1602,7 @@ digits Malayalam Malajálam Fixed Rögzített Flag… Zászló… Flare Fényvillanás + Edit Flare Fényvillanás szerkesztése Flare Tool Fényvillanás Flare Tool Options Fényvillanás beállításai Flat Angle Lapos, ferde @@ -5638,6 +5639,7 @@ imageTrace Outline Körvonal @msg select a blend jelölj ki egy összemosást @msg select a blend or give `id` jelölj ki egy összemosást, vagy add meg az `id` értékét @msg select a clip group jelölj ki egy vágócsoportot +@msg select a flare jelölj ki egy fényvillanást @msg select a gradient mesh jelölj ki egy színátmenetes hálót @msg select a linked image: an embedded one has no file jelölj ki egy csatolt képet: a beágyazottnak nincs fájlja @msg select a Live Paint group jelölj ki egy élőfestés-csoportot diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index f3dcca3874..c9153eecc0 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -3822,6 +3822,7 @@ theme Appearance Tampilan Set Tab Stops Atur hentian tab Tab Stops Hentian tab Flare Flare + Edit Flare Edit flare Rays Sinar Rectangle Persegi panjang Paintbrush Kuas lukis @@ -4713,6 +4714,7 @@ imageTrace Outline Kontur @msg select a Live Paint group pilih grup Live Paint @msg select a blend pilih blend @msg select a clip group pilih grup klip +@msg select a flare pilih flare @msg select a gradient mesh pilih mesh gradien @msg select a linked image: an embedded one has no file pilih gambar tertaut: gambar yang tersemat tidak memiliki berkas @msg select a repeat pilih pengulangan diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 90ec79404c..0a0eff1d6c 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -1297,6 +1297,7 @@ font-technology Variable Variabili Fit to Selected Art Adatta alla grafica selezionata Flag… Bandiera… Flare Riflesso + Edit Flare Modifica riflesso Flare Tool Strumento Riflesso Flare Tool Options Opzioni strumento Riflesso Halo Alone @@ -4928,6 +4929,7 @@ axis Both Entrambi @msg select a blend seleziona una fusione @msg select a blend or give `id` seleziona una fusione o specifica il suo `id` @msg select a clip group seleziona un gruppo di ritaglio +@msg select a flare seleziona un riflesso @msg select a gradient mesh seleziona una trama sfumatura @msg select a linked image: an embedded one has no file seleziona un'immagine collegata: un'immagine incorporata non ha un file @msg select a repeat seleziona una ripetizione diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index d98acfa22d..0ae8b3476c 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -1826,6 +1826,7 @@ antiAlias Sharp シャープ Fit in Window ウィンドウに合わせる Fit on Screen 画面にフィット Flare フレア + Edit Flare フレアを編集 Flare Tool フレアツール Flat Image 統合イメージ Flatness: フラットネス: @@ -4602,6 +4603,7 @@ swatch Bright Violet ビビッドバイオレット @msg no previous transform 前回の変形がありません @msg nothing to align 整列するものがありません @msg select a clip group クリップグループを選択してください +@msg select a flare フレアを選択してください @msg select two or more objects to distribute 分布させるオブジェクトを 2 つ以上選択してください @msg axis must be "vertical", "horizontal" or an angle in degrees, not `{v}` axis には "vertical"、"horizontal"、度単位の角度のいずれかを指定してください (`{v}` は指定できません) @msg give horizontal or vertical horizontal または vertical を指定してください diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 794e5454a9..ec66e9fb64 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -3660,6 +3660,7 @@ theme Appearance იერსახე Set Tab Stops ტაბულაციის გაჩერებების დაყენება Tab Stops ტაბულაციის გაჩერებები Flare ბლიკი + Edit Flare ბლიკის რედაქტირება Rays სხივები Rectangle მართკუთხედი Paintbrush ფუნჯი @@ -4543,6 +4544,7 @@ font-technology Variable ცვლადი @msg select a Live Paint group მონიშნეთ ცოცხალი შეღებვის ჯგუფი @msg select a blend მონიშნეთ გადასვლა @msg select a clip group მონიშნეთ მომჭრელი ჯგუფი +@msg select a flare მონიშნეთ ბლიკი @msg select a gradient mesh მონიშნეთ გრადიენტული ბადე @msg select a linked image: an embedded one has no file მონიშნეთ მიბმული გამოსახულება: ჩაშენებულს ფაილი არ აქვს @msg select a repeat მონიშნეთ გამეორება diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index bb8676df71..88a530b304 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -1816,6 +1816,7 @@ antiAlias Sharp 날카롭게 Fit in Window 창에 맞추기 Fit on Screen 화면에 맞추기 Flare 플레어 + Edit Flare 플레어 편집 Flare Tool 플레어 도구 Flat Image 단일 이미지 Flatness: 평탄도: @@ -4529,6 +4530,7 @@ theme Appearance 외관 @msg no previous transform 이전 변형이 없습니다 @msg nothing to align 정렬할 항목이 없습니다 @msg select a clip group 클립 그룹을 선택하세요 +@msg select a flare 플레어를 선택하세요 @msg select two or more objects to distribute 분포할 개체를 두 개 이상 선택하세요 @msg axis must be "vertical", "horizontal" or an angle in degrees, not `{v}` axis는 "vertical", "horizontal" 또는 도 단위 각도여야 합니다: `{v}` @msg give horizontal or vertical horizontal 또는 vertical을 지정하세요 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index a597a03fd0..a2aef865b4 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -4340,6 +4340,7 @@ theme Appearance Vormgeving Set Tab Stops Tabstops instellen Tab Stops Tabstops Flare Flare + Edit Flare Flare bewerken Rays Stralen Rectangle Rechthoek Paintbrush Penseel @@ -5232,6 +5233,7 @@ imageTrace Outline Contour @msg select a Live Paint group selecteer een Live Paint-groep @msg select a blend selecteer een vermenging @msg select a clip group selecteer een knipgroep +@msg select a flare selecteer een flare @msg select a gradient mesh selecteer een verloopnet @msg select a linked image: an embedded one has no file selecteer een gekoppelde afbeelding: een ingesloten afbeelding heeft geen bestand @msg select a repeat selecteer een herhaling diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 99ee2080b8..a7065b0b4f 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -3964,6 +3964,7 @@ theme Appearance Wygląd Set Tab Stops Ustaw tabulatory Tab Stops Tabulatory Flare Rozbłysk + Edit Flare Edytuj rozbłysk Rays Promienie Rectangle Prostokąt Paintbrush Pędzel @@ -5011,6 +5012,7 @@ imageTrace Outline Kontur @msg select a blend zaznacz przejście @msg select a blend or give `id` zaznacz przejście lub podaj `id` @msg select a clip group zaznacz grupę przycinającą +@msg select a flare zaznacz rozbłysk @msg select a gradient mesh zaznacz siatkę gradientową @msg select a linked image: an embedded one has no file zaznacz obraz połączony: osadzony nie ma pliku @msg select a repeat zaznacz powtórzenie diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 677c8e460f..35ffb04b83 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -1168,6 +1168,7 @@ antiAlias Sharp Nítido Fit to Selected Art Ajustar à Arte Selecionada Flag… Bandeira… Flare Brilho de Lente + Edit Flare Editar Brilho de Lente Flare Tool Ferramenta Brilho de Lente Flat Image Imagem Plana Flatness: Achatamento: @@ -4325,6 +4326,7 @@ axis Both Ambos @msg select a blend selecione uma mesclagem @msg select a blend or give `id` selecione uma mesclagem ou informe seu `id` @msg select a clip group selecione um grupo de recorte +@msg select a flare selecione um brilho de lente @msg select a gradient mesh selecione uma malha de gradiente @msg select a linked image: an embedded one has no file selecione uma imagem vinculada: uma incorporada não tem arquivo @msg select a repeat selecione uma repetição diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 106343cddd..3ef691ef91 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -1286,6 +1286,7 @@ font-technology Variable Вариативные Fit to Selected Art Вписать в выделенный рисунок Flag… Флаг… Flare Блик + Edit Flare Редактировать блик Flare Tool Инструмент «Блик» Flare Tool Options Параметры инструмента «Блик» Halo Ореол @@ -4915,6 +4916,7 @@ axis Both Оба @msg select a blend выделите переход @msg select a blend or give `id` выделите переход или укажите `id` @msg select a clip group выделите группу обрезки +@msg select a flare выделите блик @msg select a gradient mesh выделите градиентную сетку @msg select a linked image: an embedded one has no file выделите связанное изображение: у внедрённого нет файла @msg select a repeat выделите повтор diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index cc854aa362..4f95c2fa8f 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -1247,6 +1247,7 @@ font-technology Variable Variabla Fit to Selected Art Anpassa till markerad grafik Flag… Flagga… Flare Ljusreflex + Edit Flare Redigera ljusreflex Flare Tool Ljusreflexverktyg Flare Tool Options Alternativ för ljusreflexverktyget Halo Halo @@ -4776,6 +4777,7 @@ axis Both Båda @msg select a blend markera en blandning @msg select a blend or give `id` markera en blandning eller ange dess `id` @msg select a clip group markera en urklippsgrupp +@msg select a flare markera en ljusreflex @msg select a gradient mesh markera ett gradientnät @msg select a linked image: an embedded one has no file markera en länkad bild: en inbäddad bild har ingen fil @msg select a repeat markera en upprepning diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index f2888a30f0..967775a659 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -1241,6 +1241,7 @@ font-technology Variable Değişken Fit to Selected Art Seçilen Sanata Sığdır Flag… Bayrak… Flare parlama + Edit Flare Parlamayı Düzenle Flare Tool Mercek Parlaması Aracı Flare Tool Options Genişletme Aracı Seçenekleri Halo Hale @@ -4647,6 +4648,7 @@ axis Both Her İkisi @msg select a Live Paint group bir Canlı Boyama grubu seçin @msg select a blend bir karışım seç @msg select a clip group bir klip grubu seçin +@msg select a flare bir parlama seçin @msg select a gradient mesh bir degrade ağı seçin @msg select a linked image: an embedded one has no file bağlantılı bir görsel seçin: gömülü görselin dosyası yok @msg select a repeat bir tekrar seç diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 411b2c3baf..a63194eb5a 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -1291,6 +1291,7 @@ font-technology Variable Варіативні Fit to Selected Art Вписати у виділений малюнок Flag… Прапор… Flare Відблиск + Edit Flare Редагувати відблиск Flare Tool Інструмент «Відблиск» Flare Tool Options Параметри інструменту «Відблиск» Halo Ореол @@ -4912,6 +4913,7 @@ axis Both Обидві @msg select a blend виділіть перехід @msg select a blend or give `id` виділіть перехід або вкажіть `id` @msg select a clip group виділіть відсічну групу +@msg select a flare виділіть відблиск @msg select a gradient mesh виділіть градієнтну сітку @msg select a linked image: an embedded one has no file виділіть пов’язане зображення: у вбудованого немає файлу @msg select a repeat виділіть повтор diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 1460910197..4851de7575 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -1513,6 +1513,7 @@ digits Malayalam Malayalam Fixed Cố định Flag… Lá cờ… Flare Hào quang + Edit Flare Chỉnh sửa hào quang Flare Tool Công cụ Hào quang Flare Tool Options Tùy chọn Công cụ Hào quang Flat Angle Góc phẳng @@ -5302,6 +5303,7 @@ theme Appearance Giao diện @msg select a blend hãy chọn một đối tượng hòa trộn @msg select a blend or give `id` hãy chọn một đối tượng hòa trộn hoặc cung cấp `id` @msg select a clip group hãy chọn nhóm cắt +@msg select a flare hãy chọn một hào quang @msg select a gradient mesh hãy chọn lưới chuyển sắc @msg select a linked image: an embedded one has no file hãy chọn ảnh liên kết: ảnh nhúng không có tệp @msg select a Live Paint group hãy chọn nhóm tô trực tiếp diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 3fe2f9e009..e03bc90802 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -1228,6 +1228,7 @@ antiAlias Sharp 锐利 Fit to Selected Art 适合所选图稿 Flag… 旗形… Flare 光晕 + Edit Flare 编辑光晕 Flare Tool 光晕工具 Flare Tool Options 光晕工具选项 Halo 光晕 @@ -4301,6 +4302,7 @@ imageTrace Outline 轮廓 @msg no previous transform 没有上一次变换 @msg nothing to align 没有可对齐的内容 @msg select a clip group 请选择一个剪切组 +@msg select a flare 请选择一个光晕 @msg select two or more objects to distribute 请选择两个或更多要分布的对象 @msg axis must be "vertical", "horizontal" or an angle in degrees, not `{v}` axis 必须是 "vertical"、"horizontal" 或以度为单位的角度,而不是 `{v}` @msg give horizontal or vertical 请给出 horizontal 或 vertical diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index ab7f9d9dd2..ad0a9afabb 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -1262,6 +1262,7 @@ font-technology Variable 可變 Fit to Selected Art 符合選取的圖稿 Flag… 旗形… Flare 光暈 + Edit Flare 編輯光暈 Flare Tool 光暈工具 Flare Tool Options 光暈工具選項 Halo 光暈 @@ -1997,6 +1998,7 @@ file-filter Templates 範本 @msg no previous transform 沒有上一次的變形 @msg nothing to align 沒有可對齊的內容 @msg select a clip group 請選取剪裁群組 +@msg select a flare 請選取光暈 @msg select two or more objects to distribute 請選取兩個以上要均分的物件 @msg axis must be "vertical", "horizontal" or an angle in degrees, not `{v}` axis 必須是 "vertical"、"horizontal" 或以度為單位的角度,而非 `{v}` @msg give horizontal or vertical 請提供 horizontal 或 vertical diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index d83f03d376..4642824545 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -956,7 +956,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "tool.options", "Tool Options…", "", - "{tool: id} what double-clicking a tool button opens: hand → fits the artboard in the window (view.fitArtboard), zoom → 100% (view.actualSize), rotate|scale|reflect|shear → that Object › Transform dialog (dialog `rotate`, `scale`, `reflect` or `shear`; error `nothing selected` without a selection), selection|directSelection|groupSelection → the Move dialog (dialog `move`; the same error), gradient|magicWand → the Gradient or Magic Wand panel (window.panel), artboard → Artboard Options of the active artboard (dialog `artboardOptions`, fields index, name, x, y, width, height, showCenterMark, showCrossHairs; OK runs artboard.setProps, and with other artboards selected with the Artboard tool a new width or height goes to each of them too, in its `artboards` list, each resized about the reference point the form used for that size, or about its top-left corner when the size was set in the fields directly), flare → Flare Tool Options (dialog `flareOptions`, fields diameter and pathLength (pt), opacity, brightness, growth, fuzziness, longest, rayFuzziness, largest (%), rays, rings, direction (°), raysOn, ringsOn; OK runs tool.setOption {tool: \"flare\", values}: the next flare dragged out uses them, and a Flare click's dialog, which also has x, y and preview (on initially), previews one there and accepts it as one Undo step; Cancel rolls back the preview), lineSegment|arc|rectangularGrid|polarGrid → that tool's Tool Options, its click dialog without x and y (dialog kind = the tool id, `__toolOptions: true`; lineSegment: length (pt), angle (°), fillLine; arc: lengthX, lengthY (pt), reference (0–8), arcType: open|closed, baseAlong: x|y, slope (−100…100), fillArc; rectangularGrid: width, height (pt, the Default Size), reference (0–8), rows, columns, rowSkew, columnSkew (%), frame, fill; polarGrid: the same with concentric, radial, concentricSkew, radialSkew and compound for rows, columns, the skews and frame; OK runs tool.setOption {tool, values} and draws nothing: the next drag uses them (Fill Line, the arc's type, base, slope and fill, the grids' dividers, skews and switches) and a click's dialog opens at them), columnGraph|stackedColumnGraph|barGraph|stackedBarGraph|lineGraph|areaGraph|scatterGraph|pieGraph|radarGraph → Graph Type for the selected graph (dialog `command` running graph.setType; an error without one), typeOnPath|verticalTypeOnPath → Type on a Path Options for the selected type on a path (dialog `command` running type.pathOptions; error `nothing selected` without a selection, and the command's error when no type on a path is selected),symbolSprayer|symbolShifter|symbolScruncher|symbolSizer|symbolSpinner|symbolStainer|symbolScreener|symbolStyler → Symbolism Tools Options (dialog `symbolismOptions`, fields tool, diameter (pt), intensity and density (1–10), shared by the eight tools; OK runs tool.setOption {tool, values}), blend → Blend Options, perspectiveGrid → Perspective Grid Options, eyedropper → Eyedropper Options (dialog `eyedropperOptions`, fields sampleSize, pickUp, apply; OK runs eyedropper.setOptions), printTiling → resets the print tiling (print.tiling.set {reset: true}), warp|twirl|pucker|bloat|scallop|crystallize|wrinkle → that tool's Tool Options (dialog `liquifyOptions`, fields tool, width, height, angle, intensity %, usePressure, detail, simplify, simplifyOn, rate, complexity, horizontal %, vertical %, affectAnchors, affectIn, affectOut, showBrush; OK runs tool.setOption {tool, values}), pencil|paintbrush|smooth|blobBrush|eraser → that tool's Tool Options (dialog `freehandOptions`, fields tool and the options the tool keeps: fidelity (px for pencil, paintbrush and smooth, the same at any zoom; pt for blobBrush), fill, keepSelected (on for pencil and paintbrush, off for blobBrush), mergeOnlySelection (off), closeWithin and editWithin (px, 0 is off), livePreview (pencil, on: off draws a thin line while the stroke is drawn, and the path's fill and stroke on release), size (pt), angle (°, −180–180; 0) and roundness (%, 1–100; 100) of the eraser's tip; OK runs tool.setOption {tool, values}), livePaintSelection → Live Paint Selection Tool Options (dialog `livePaintSelectionOptions`, fields selectFills and selectStrokes (both on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the highlight's width, 1–20 px; 4); OK runs tool.setOption {tool: \"livePaintSelection\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), livePaintBucket → Live Paint Bucket Options (dialog `livePaintBucketOptions`, fields paintFills (on) and paintStrokes (off), cursorSwatchPreview (on: the active fill or stroke shows above the pointer between the color swatches before and after it; Left and Right without modifiers step it through the color swatches whether it is on or off), highlight (on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the face highlight's width, 1–20 px; 4; an edge's highlight is half as wide); OK runs tool.setOption {tool: \"livePaintBucket\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), shapeBuilder → Shape Builder Tool Options (dialog `shapeBuilderOptions`, fields gapDetection (off), gapLength (pt, 0–72; 3), openFilledAsClosed (on), clickStrokeSplitsPath (off), pickColorFrom: artwork|swatches (artwork), cursorSwatchPreview (off), selection: freeform|straightLine (freeform), highlightFill (on), highlightStroke (on), highlightColor (#rrggbb or a layer color's name; #ff4f4f); OK runs tool.setOption {tool: \"shapeBuilder\", values}; a highlightColor with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), objectsOnPath → Objects on Path Tool Options (dialog `objectsOnPathOptions`, fields pivot (0–8, row by row from the top left; 4, the center) and rotate (°, −360–360; 0); Reset puts 4 and 0 back; Save runs tool.setOption {tool: \"objectsOnPath\", values}: the objects attached next use them, groups attached before keep theirs)", + "{tool: id} what double-clicking a tool button opens: hand → fits the artboard in the window (view.fitArtboard), zoom → 100% (view.actualSize), rotate|scale|reflect|shear → that Object › Transform dialog (dialog `rotate`, `scale`, `reflect` or `shear`; error `nothing selected` without a selection), selection|directSelection|groupSelection → the Move dialog (dialog `move`; the same error), gradient|magicWand → the Gradient or Magic Wand panel (window.panel), artboard → Artboard Options of the active artboard (dialog `artboardOptions`, fields index, name, x, y, width, height, showCenterMark, showCrossHairs; OK runs artboard.setProps, and with other artboards selected with the Artboard tool a new width or height goes to each of them too, in its `artboards` list, each resized about the reference point the form used for that size, or about its top-left corner when the size was set in the fields directly), flare → Flare Tool Options (dialog `flareOptions`, fields diameter and pathLength (pt), opacity, brightness, growth, fuzziness, longest, rayFuzziness, largest (%), rays, rings, direction (°), raysOn, ringsOn; OK runs tool.setOption {tool: \"flare\", values}: the next flare dragged out uses them, and a Flare click's dialog, which also has x, y and preview (on initially), previews one there and accepts it as one Undo step; Cancel rolls back the preview; with flares selected, the fields show the first one's settings, `flares` lists them and OK runs shape.editFlare with the settings changed instead, leaving the tool's options), lineSegment|arc|rectangularGrid|polarGrid → that tool's Tool Options, its click dialog without x and y (dialog kind = the tool id, `__toolOptions: true`; lineSegment: length (pt), angle (°), fillLine; arc: lengthX, lengthY (pt), reference (0–8), arcType: open|closed, baseAlong: x|y, slope (−100…100), fillArc; rectangularGrid: width, height (pt, the Default Size), reference (0–8), rows, columns, rowSkew, columnSkew (%), frame, fill; polarGrid: the same with concentric, radial, concentricSkew, radialSkew and compound for rows, columns, the skews and frame; OK runs tool.setOption {tool, values} and draws nothing: the next drag uses them (Fill Line, the arc's type, base, slope and fill, the grids' dividers, skews and switches) and a click's dialog opens at them), columnGraph|stackedColumnGraph|barGraph|stackedBarGraph|lineGraph|areaGraph|scatterGraph|pieGraph|radarGraph → Graph Type for the selected graph (dialog `command` running graph.setType; an error without one), typeOnPath|verticalTypeOnPath → Type on a Path Options for the selected type on a path (dialog `command` running type.pathOptions; error `nothing selected` without a selection, and the command's error when no type on a path is selected),symbolSprayer|symbolShifter|symbolScruncher|symbolSizer|symbolSpinner|symbolStainer|symbolScreener|symbolStyler → Symbolism Tools Options (dialog `symbolismOptions`, fields tool, diameter (pt), intensity and density (1–10), shared by the eight tools; OK runs tool.setOption {tool, values}), blend → Blend Options, perspectiveGrid → Perspective Grid Options, eyedropper → Eyedropper Options (dialog `eyedropperOptions`, fields sampleSize, pickUp, apply; OK runs eyedropper.setOptions), printTiling → resets the print tiling (print.tiling.set {reset: true}), warp|twirl|pucker|bloat|scallop|crystallize|wrinkle → that tool's Tool Options (dialog `liquifyOptions`, fields tool, width, height, angle, intensity %, usePressure, detail, simplify, simplifyOn, rate, complexity, horizontal %, vertical %, affectAnchors, affectIn, affectOut, showBrush; OK runs tool.setOption {tool, values}), pencil|paintbrush|smooth|blobBrush|eraser → that tool's Tool Options (dialog `freehandOptions`, fields tool and the options the tool keeps: fidelity (px for pencil, paintbrush and smooth, the same at any zoom; pt for blobBrush), fill, keepSelected (on for pencil and paintbrush, off for blobBrush), mergeOnlySelection (off), closeWithin and editWithin (px, 0 is off), livePreview (pencil, on: off draws a thin line while the stroke is drawn, and the path's fill and stroke on release), size (pt), angle (°, −180–180; 0) and roundness (%, 1–100; 100) of the eraser's tip; OK runs tool.setOption {tool, values}), livePaintSelection → Live Paint Selection Tool Options (dialog `livePaintSelectionOptions`, fields selectFills and selectStrokes (both on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the highlight's width, 1–20 px; 4); OK runs tool.setOption {tool: \"livePaintSelection\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), livePaintBucket → Live Paint Bucket Options (dialog `livePaintBucketOptions`, fields paintFills (on) and paintStrokes (off), cursorSwatchPreview (on: the active fill or stroke shows above the pointer between the color swatches before and after it; Left and Right without modifiers step it through the color swatches whether it is on or off), highlight (on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the face highlight's width, 1–20 px; 4; an edge's highlight is half as wide); OK runs tool.setOption {tool: \"livePaintBucket\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), shapeBuilder → Shape Builder Tool Options (dialog `shapeBuilderOptions`, fields gapDetection (off), gapLength (pt, 0–72; 3), openFilledAsClosed (on), clickStrokeSplitsPath (off), pickColorFrom: artwork|swatches (artwork), cursorSwatchPreview (off), selection: freeform|straightLine (freeform), highlightFill (on), highlightStroke (on), highlightColor (#rrggbb or a layer color's name; #ff4f4f); OK runs tool.setOption {tool: \"shapeBuilder\", values}; a highlightColor with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), objectsOnPath → Objects on Path Tool Options (dialog `objectsOnPathOptions`, fields pivot (0–8, row by row from the top left; 4, the center) and rotate (°, −360–360; 0); Reset puts 4 and 0 back; Save runs tool.setOption {tool: \"objectsOnPath\", values}: the objects attached next use them, groups attached before keep theirs)", ), ( "ui.colorGuideOptions", diff --git a/crates/ui-egui/src/toolbar.rs b/crates/ui-egui/src/toolbar.rs index 29d89ebf6d..d6aec770f9 100644 --- a/crates/ui-egui/src/toolbar.rs +++ b/crates/ui-egui/src/toolbar.rs @@ -460,7 +460,8 @@ pub fn open_options(app: &mut VectorcraftApp, tool: &str) -> Result crate::dialogs::shapes::open_options(app, tool), - // The Flare tool: its options, which draw the next flare (OK draws none). + // The Flare tool: its options, which draw the next flare (OK draws none); with flares + // selected, the first one's settings, and OK draws the selected flares again. "flare" => Ok(crate::dialogs::flare_options::open(app, None)), // A double click on the Print Tiling tool puts the pages back where the placement puts them. "printTiling" => app.run("print.tiling.set", json!({ "reset": true })), diff --git a/docs/mcp.md b/docs/mcp.md index 8ca4121032..b7deac9cea 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -10478,6 +10478,24 @@ A canvas-click dialog also has `preview` (initially on): tentative settings draw {"name":"run_command","arguments":{"command":"tool.setOption","params":{"tool":"flare","values":{"rays":24,"ringsOn":false}}}} ``` +A flare keeps the settings it was drawn with, and a move, scale, rotation, reflection or shear of it updates them. +With one or more flares selected, double-clicking the Flare tool opens Flare Tool Options filled from the first +selected flare, with `flares` listing the selected ones. OK runs `shape.editFlare` with the settings changed in the +dialog and leaves the tool's own options as they were. `shape.editFlare {ids?, cx?, cy?, x2?, y2?, diameter?, ...}` +draws each flare again in its place from its settings, changing only the ones given (the center, the end point, +the path length and the direction where the flare is drawn now, the other settings as in `shape.flare`), as one undo step, and adds no step when nothing +changes. With a flare selected, the Flare tool draws its center and end point as handles joined by a dashed line; +dragging the center moves it while the end point stays, and dragging the end point moves the end point; either drag +changes the flare's length and direction as one undo step, and Esc cancels the drag. A flare whose parts were edited +is no longer edited as a flare (error `select a flare`), and a locked or hidden flare is not edited either. Object › Expand turns +a flare into a plain group of its parts. The document saves a flare's settings. Sources: +[Draw and edit flares](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/draw-shapes/draw-and-edit-flares.html), +[the CS3 help, page 67](https://help.adobe.com/archive/en_US/illustrator/cs3/illustrator_cs3_help.pdf#page=67). + +```json +{"name":"run_command","arguments":{"command":"shape.editFlare","params":{"diameter":100,"rings":6}}} +``` + The Shape Builder tool's options are its Shape Builder Tool Options (dialog `shapeBuilderOptions`): `openFilledAsClosed` (on: a filled open path bounds a region as if an invisible edge closed it; a path counts as filled when any of its fill rows is shown, painted and above 0% opacity, whichever row is on top; off: it cuts regions diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 082e565bd2..4f5fb04450 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -14,6 +14,8 @@ Numeric fields step on wheel hover without taking keyboard focus (#5949). Arrow keys still require focus; modifiers, units, limits, mixed values and existing rounding stay in the shared stepping path. Headless regressions in `tests/numfields.rs` cover hovered unfocused fields, focused fields, trackpad accumulation and panel scroll exclusion. Scores and estimates unchanged. +A flare keeps its settings through transforms and saves. With a flare selected, double-clicking the Flare tool opens Flare Tool Options filled from it, and OK draws it again in its place as one undo step (`shape.editFlare`; none when nothing changed); the Flare tool shows the selected flare's center and end handles, and dragging either changes its length or direction; Object › Expand turns it into plain objects ([Draw and edit flares](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/draw-shapes/draw-and-edit-flares.html)). Regressions: `edit_flare_draws_a_transformed_flare_again_in_its_place_in_one_undo_step`, `dragging_a_selected_flares_handles_changes_its_length_and_direction` and `with_a_flare_selected_the_options_show_its_settings_and_ok_draws_it_again`. Scores and estimates unchanged. + | 2026-11-06 | minor | Opening a file that takes longer than 0.4 s shows a progress window: the file name, a moving bar (reading reports no steps), how many more files wait, Cancel (Esc; the file doesn't open) and Continue in Background (`file.cancelOpen`, `file.openInBackground`); it never opens over another dialog or progress window (part of #5930); scores and estimates unchanged | Raster rendering fits and preflattens curved stroke outlines more tightly only below four times the raster tolerance, retaining thin-band coverage without changing stroke weight or vector export geometry. Current cached character/object outlines, cropped long strokes, gradient clips and effect rasters share the helper; cropped-region reuse and guarded flattening remain. The unchanged `fractional_curved_strokes_retain_coverage_between_notches` regression covers fractional weights, rotation, phase, opacity and f32-rounded endpoints. This is a quality/cost tradeoff, not a speed claim. Scores and estimates unchanged. From 2b97e0a52a19e47297e392cc0e0e26b097f2e154 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 07:17:31 -0800 Subject: [PATCH 005/102] Docs: the flare editing source link names its help section --- docs/mcp.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/mcp.md b/docs/mcp.md index 2745282a65..3ac0dfbef8 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -10885,7 +10885,7 @@ changes the flare's length and direction as one undo step, and Esc cancels the d is no longer edited as a flare (error `select a flare`), and a locked or hidden flare is not edited either. Object › Expand turns a flare into a plain group of its parts. The document saves a flare's settings. Sources: [Draw and edit flares](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/draw-shapes/draw-and-edit-flares.html), -[the CS3 help, page 67](https://help.adobe.com/archive/en_US/illustrator/cs3/illustrator_cs3_help.pdf#page=67). +[Edit a flare](https://help.adobe.com/archive/en_US/illustrator/cs3/illustrator_cs3_help.pdf#page=67). ```json {"name":"run_command","arguments":{"command":"shape.editFlare","params":{"diameter":100,"rings":6}}} From 80aa3401c25e549ecf230e1b2a88e83b4fa46b8c Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 08:18:49 -0800 Subject: [PATCH 006/102] Plug-ins: plug-ins may call shape.editFlare The new command was in neither reviewed list, so every_command_is_reviewed failed and a plug-in call to it was refused as not reviewed. It goes in ALLOWED next to shape.flare; it takes no file or folder parameter. --- crates/engine/src/cmd/plugin_call/reviewed.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/engine/src/cmd/plugin_call/reviewed.rs b/crates/engine/src/cmd/plugin_call/reviewed.rs index 67d0fec2a3..39acf8ad1f 100644 --- a/crates/engine/src/cmd/plugin_call/reviewed.rs +++ b/crates/engine/src/cmd/plugin_call/reviewed.rs @@ -542,6 +542,7 @@ pub(super) const ALLOWED: &[&str] = &[ "select.toggle", "select.update", "shape.arc", + "shape.editFlare", "shape.ellipse", "shape.flare", "shape.line", From 9389acc81e9a256d469834e75f6ebc531b5c165e Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 09:23:53 -0800 Subject: [PATCH 007/102] i18n: drop Spanish catalog rows main already has Main added Spanish rows for ten of the dialog-answer messages this branch also translates. The branch's copies are removed so each message has one row and bundled_catalogs_are_consistent passes; main's translations are identical. --- crates/ui-egui/src/i18n/es.tsv | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index f8070aa2dd..84ab97441e 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -7752,9 +7752,6 @@ breakText Glyphs Glifos @msg `alignOn` must be a string `alignOn` debe ser una cadena @msg `align` must be a string `align` debe ser una cadena @msg `answer` for this {kind} dialog must be one of: {_1} `answer` para este cuadro de diálogo {kind} debe ser uno de: {_1} -@msg `answers` has more than {MAX_ANSWERS} answers `answers` tiene más de {MAX_ANSWERS} respuestas -@msg `answers` is larger than 1 MiB `answers` ocupa más de 1 MiB -@msg `answers` must be a list of answers `answers` debe ser una lista de respuestas @msg `artboard` must be the index of an artboard of the document `artboard` debe ser el índice de una mesa de trabajo del documento @msg `artboardsAt` must be [x, y] `artboardsAt` debe ser [x, y] @msg `artboards` names an artboard the document does not have `artboards` nombra una mesa de trabajo que el documento no tiene @@ -7924,10 +7921,6 @@ breakText Glyphs Glifos @msg invalid regular expression flag '{_1}' indicador de expresión regular no válido '{_1}' @msg invalid regular expression: {m} expresión regular no válida: {m} @msg invalid time value valor de tiempo no válido -@msg is a confirm's answer, whose `value` must be true or false es la respuesta de un confirm, cuyo `value` debe ser true o false -@msg is a prompt's answer, whose `value` must be a string or null es la respuesta de un prompt, cuyo `value` debe ser una cadena o null -@msg is an alert's answer, whose `value` must be "ok" es la respuesta de un alert, cuyo `value` debe ser "ok" -@msg is longer than 16 KiB ocupa más de 16 KiB @msg it draws its image through a clipping path dibuja su imagen a través de un trazado de recorte @msg it draws no image no dibuja ninguna imagen @msg it is larger than {MAX_DICTIONARY_FILE_BYTES} bytes ocupa más de {MAX_DICTIONARY_FILE_BYTES} bytes @@ -7945,9 +7938,6 @@ breakText Glyphs Glifos @msg localize: the first argument must be a localization object or a string localize: el primer argumento debe ser un objeto de localización o una cadena @msg missing `picks` falta `picks` @msg missing `word` falta `word` -@msg must be an object with `kind` and `value` debe ser un objeto con `kind` y `value` -@msg must have `kind` alert, confirm or prompt debe tener `kind` alert, confirm o prompt -@msg must have exactly `kind` and `value` debe tener exactamente `kind` y `value` @msg needs a closing quote after the name necesita unas comillas de cierre después del nombre @msg needs a name necesita un nombre @msg needs a name of at most 64 bytes necesita un nombre de como máximo 64 bytes From f026c911591d1623be19baae4753e9b4e73b1388 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 09:50:19 -0800 Subject: [PATCH 008/102] Flare: shape.editFlare's rotation says it turns the rays clockwise The engine's turn-direction check requires every rotation param to say which way it turns. shape.editFlare's rotation is shape.flare's setting, which turns the rays clockwise. --- crates/engine/src/cmd/create.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/engine/src/cmd/create.rs b/crates/engine/src/cmd/create.rs index cb0ef7a6a5..b0bce422ee 100644 --- a/crates/engine/src/cmd/create.rs +++ b/crates/engine/src/cmd/create.rs @@ -62,7 +62,7 @@ pub fn specs() -> Vec { "Edit Flare", [], None, - "{ids?|id?: flares (default: the selected flares), cx?, cy? (the center, where it is drawn now), x2?, y2? (the rings' end point, where it is drawn now; else pathLength at direction from the center, both where it is drawn now, when either is given; else where it was), diameter?, opacity?, brightness?, growth?, fuzziness?, rays?, longest?, rayFuzziness?, rotation?, pathLength?, rings?, largest?, direction? (as shape.flare: what is left out stays as it was)} draws each flare again in its place, moved, scaled, rotated, reflected or sheared as it has been since it was drawn, as one undo step (none when nothing changes); a flare whose parts were edited, or that is locked or hidden, is not one → {ids}", + "{ids?|id?: flares (default: the selected flares), cx?, cy? (the center, where it is drawn now), x2?, y2? (the rings' end point, where it is drawn now; else pathLength at direction from the center, both where it is drawn now, when either is given; else where it was), diameter?, opacity?, brightness?, growth?, fuzziness?, rays?, longest?, rayFuzziness?, rotation? (deg, turns the rays clockwise), pathLength?, rings?, largest?, direction? (as shape.flare: what is left out stays as it was)} draws each flare again in its place, moved, scaled, rotated, reflected or sheared as it has been since it was drawn, as one undo step (none when nothing changes); a flare whose parts were edited, or that is locked or hidden, is not one → {ids}", has_doc, super::flare::edit_flare ), From 22f68ebb8d3e571eb8905018388caecf64e83261 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 10:41:07 -0800 Subject: [PATCH 009/102] Flare: shape.editFlare refuses an end point that is not finite On a flare scaled far down, a large pathLength gave an end point that overflowed when taken back to where the flare was drawn. The settings then stored the end point as null, and the flare was drawn again with the default path. shape.flare and shape.editFlare now return an error naming x2 or y2 instead. --- crates/engine/src/cmd/flare.rs | 13 +++++++++++-- crates/engine/src/tests.rs | 13 +++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/crates/engine/src/cmd/flare.rs b/crates/engine/src/cmd/flare.rs index 187496f137..05b25421eb 100644 --- a/crates/engine/src/cmd/flare.rs +++ b/crates/engine/src/cmd/flare.rs @@ -36,6 +36,15 @@ fn count_or(p: &Value, key: &str, default: u64, cmd: &str) -> Result { } } +/// `end`, the rings' end point, or an error naming `x2` or `y2` when that coordinate is not a +/// finite number (a `pathLength` so large that the end point overflows). +fn finite_end(end: Point, cmd: &str) -> Result { + match [("x2", end.x), ("y2", end.y)].into_iter().find(|(_, v)| !v.is_finite()) { + None => Ok(end), + Some((key, _)) => Err(bad(cmd, format!("{key} must be a finite coordinate"))), + } +} + /// `shape.flare`'s params `p` with every setting given: the defaults filled in, the counts at most /// 50 and the rings' end point as `x2`, `y2` (from `pathLength` and `direction` when `p` gives no /// end point), with `ringSeed` when `p` gives one. @@ -60,7 +69,7 @@ fn settings_of(p: &Value, cmd: &str) -> Result { (Some(x), Some(y)) => Point::new(x, y), _ => { let a = f64_or(p, "direction", 45.0).to_radians(); - c + Vec2::new(a.cos(), -a.sin()) * f64_or(p, "pathLength", 300.0) + finite_end(c + Vec2::new(a.cos(), -a.sin()) * f64_or(p, "pathLength", 300.0), cmd)? } }; let mut v = json!({ "cx": c.x, "cy": c.y, "x2": end.x, "y2": end.y, "rays": rays, "rings": rings, "seed": seed }); @@ -173,7 +182,7 @@ fn edited(old: &Value, p: &Value, xf: Affine) -> Result { let (c, e) = (xf * centre, xf * old_end); let d = e - c; let a = number_or(p, "direction", (-d.y).atan2(d.x).to_degrees(), C)?.to_radians(); - inv * (c + Vec2::new(a.cos(), -a.sin()) * number_or(p, "pathLength", d.hypot(), C)?) + finite_end(inv * (c + Vec2::new(a.cos(), -a.sin()) * number_or(p, "pathLength", d.hypot(), C)?), C)? } // Moving the center leaves the rings' end point where it is. None => old_end, diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rs index 10c7069ce0..09b78d8a89 100644 --- a/crates/engine/src/tests.rs +++ b/crates/engine/src/tests.rs @@ -3360,6 +3360,19 @@ fn flare_counts_are_whole_numbers() { assert!(s.execute("shape.flare", &json!({"cx": 100, "cy": 100, "rays": 2.5})).is_err()); } +/// `shape.editFlare` on a flare scaled far down: a `pathLength` whose end point, taken back to +/// where the flare was drawn, is not a finite number is an error, and the flare keeps its settings. +#[test] +fn edit_flare_end_points_that_are_not_finite_are_errors() { + let mut s = session(); + let id = NodeId(s.execute("shape.flare", &json!({"cx": 100, "cy": 100, "rings": 2})).unwrap()["id"].as_u64().unwrap()); + s.execute("object.scale", &json!({"sx": 1e-4, "sy": 1e-4})).unwrap(); + let before = flare_settings(&s.doc().unwrap().doc, id).expect("a flare"); + let err = s.execute("shape.editFlare", &json!({"pathLength": 1e305})).unwrap_err().to_string(); + assert!(err.ends_with("x2 must be a finite coordinate"), "{err}"); + assert_eq!(flare_settings(&s.doc().unwrap().doc, id).expect("still a flare"), before); +} + /// A flare drawn again keeps its parts' pixel-aligned property, whatever the document's Align New /// Objects to Pixel Grid is now, and a pixel-aligned flare that was moved is still a flare. #[test] From 0cf59a764990de4ffebb3a34d257bf51d3e41d99 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 09:52:48 -0800 Subject: [PATCH 010/102] Shortcuts: a tool or command can have a hold shortcut that runs when its key is held MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Edit › Keyboard Shortcuts gets a Hold Shortcuts checkbox, off by default, with a ? button that explains it. While it is off, the dialog has no Hold column and every key runs on its press as before. While it is on, the dialog shows a Hold column and the Hold Shortcut Delay (`keyHoldDelay`, 0.35 s, 0.2 to 1.0 s), and a letter, digit or punctuation key, alone or with Shift, can hold a tool or command. Held for the delay, the key runs its hold shortcut once and its repeats are ignored until it is let go; a quicker press runs what the key runs without one, at the release. Another key, or Cmd, Ctrl or Alt, ends the wait first; focus loss, a dialog, a text field, Presentation Mode or an input method composition ends it without running anything. A hold on a letter alone leaves the letter with Shift as it is, and a key the active tool uses itself (E with the Extend Path tool) does not wait. A tool key with a hold shortcut runs the hold instead of choosing its tool temporarily (`holdToolKeys`). Preferences › General › Options lists both settings too, with the delay dimmed while Hold Shortcuts is off. Hold shortcuts are stored apart from the shortcuts (`shortcut_holds`). `shortcuts.set` takes `hold`, `shortcuts.list` rows have `hold`, `shortcuts.conflicts` lists hold clashes, Export… writes `holds` and Import… reads it, and Export Text… adds a `Hold X` column while the checkbox is on. Reset to Defaults and the presets clear them. The new strings have rows in every catalog. --- crates/engine/src/cmd/prefscmds.rs | 2 + crates/engine/src/lib.rs | 2 +- crates/engine/src/prefs.rs | 24 + crates/engine/src/tests/prefs_file.rs | 21 + crates/mcp/src/ui_catalog.rs | 11 +- crates/ui-egui/src/app.rs | 1 + crates/ui-egui/src/i18n/bg.tsv | 10 + crates/ui-egui/src/i18n/bs.tsv | 10 + crates/ui-egui/src/i18n/ca.tsv | 10 + crates/ui-egui/src/i18n/cs.tsv | 10 + crates/ui-egui/src/i18n/da.tsv | 10 + crates/ui-egui/src/i18n/de.tsv | 10 + crates/ui-egui/src/i18n/el.tsv | 10 + crates/ui-egui/src/i18n/es.tsv | 10 + crates/ui-egui/src/i18n/fi.tsv | 10 + crates/ui-egui/src/i18n/fr.tsv | 10 + crates/ui-egui/src/i18n/gu.tsv | 10 + crates/ui-egui/src/i18n/hi.tsv | 10 + crates/ui-egui/src/i18n/hu.tsv | 10 + crates/ui-egui/src/i18n/id.tsv | 10 + crates/ui-egui/src/i18n/it.tsv | 10 + crates/ui-egui/src/i18n/ja.tsv | 10 + crates/ui-egui/src/i18n/ka.tsv | 10 + crates/ui-egui/src/i18n/ko.tsv | 10 + crates/ui-egui/src/i18n/nl.tsv | 10 + crates/ui-egui/src/i18n/pl.tsv | 10 + crates/ui-egui/src/i18n/pt-br.tsv | 10 + crates/ui-egui/src/i18n/ru.tsv | 10 + crates/ui-egui/src/i18n/sv.tsv | 10 + crates/ui-egui/src/i18n/tr.tsv | 10 + crates/ui-egui/src/i18n/uk.tsv | 10 + crates/ui-egui/src/i18n/vi.tsv | 10 + crates/ui-egui/src/i18n/zh-hans.tsv | 10 + crates/ui-egui/src/i18n/zh-hant.tsv | 10 + crates/ui-egui/src/lib.rs | 3 + crates/ui-egui/src/menus/ui_commands.rs | 11 +- crates/ui-egui/src/prefs_dialog.rs | 12 + crates/ui-egui/src/prefs_dialog/tests.rs | 39 ++ crates/ui-egui/src/shortcut_editor.rs | 539 +++++++++++++++++- crates/ui-egui/src/shortcuts.rs | 89 ++- crates/ui-egui/src/shortcuts/hold_keys.rs | 321 +++++++++++ .../ui-egui/src/shortcuts/hold_keys/tests.rs | 517 +++++++++++++++++ crates/ui-egui/src/state.rs | 7 + docs/mcp.md | 32 +- docs/target-app-parity.md | 1 + 45 files changed, 1849 insertions(+), 63 deletions(-) create mode 100644 crates/ui-egui/src/shortcuts/hold_keys.rs create mode 100644 crates/ui-egui/src/shortcuts/hold_keys/tests.rs diff --git a/crates/engine/src/cmd/prefscmds.rs b/crates/engine/src/cmd/prefscmds.rs index b6c500749f..d255558e7b 100644 --- a/crates/engine/src/cmd/prefscmds.rs +++ b/crates/engine/src/cmd/prefscmds.rs @@ -156,6 +156,8 @@ pub const PREF_SPECS: &[PrefSpec] = &[ p!("scrubNumericFields", "General", "Options", "Scrub Numeric Fields by Dragging", bool), p!("trackpadRotateView", "General", "Options", "Trackpad Gesture to Rotate View", bool), p!("holdToolKeys", "General", "Options", "Hold a Tool Shortcut to Use the Tool Temporarily", bool), + p!("holdShortcuts", "General", "Options", "Hold Shortcuts", bool), + p!("keyHoldDelay", "General", "Options", "Hold Shortcut Delay", num(0.2, 1.0, "s")), p!("boundingBoxWhileMovingAndDrawing", "General", "Options", "Show Bounding Box While Moving and Drawing", bool), // Selection & Anchor Display p!("selectionTolerance", "Selection & Anchor Display", "Selection", "Tolerance", num(1.0, 8.0, "px")), diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index aeb723c963..2b89a31966 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -408,7 +408,7 @@ use history::history_budget_for; pub use history::{History, HistoryEntry, NamedStep, default_history_budget}; pub(crate) use interaction::PreviewCopies; pub use interaction::{Interaction, LastTransform, UndoGroup, UndoScope}; -pub use prefs::{DrawMode, Prefs}; +pub use prefs::{DrawMode, KEY_HOLD_DELAY, KEY_HOLD_DELAY_RANGE, Prefs}; pub use sanity::TOO_DEEP; pub(crate) use sanity::{deselect_hidden, is_guide_path}; #[cfg(test)] diff --git a/crates/engine/src/prefs.rs b/crates/engine/src/prefs.rs index 86525e9214..710604e524 100644 --- a/crates/engine/src/prefs.rs +++ b/crates/engine/src/prefs.rs @@ -71,6 +71,13 @@ pub struct Prefs { /// A single-key tool shortcut held down chooses its tool until the key is let go, and then the /// tool active before comes back; a quick press chooses the tool for good. pub hold_tool_keys: bool, + /// Hold shortcuts act (Edit › Keyboard Shortcuts › Hold Shortcuts, off by default): a key with a + /// hold shortcut runs it when held for [`Self::key_hold_delay`], and its own shortcut when let go + /// sooner. Off, every key runs on its press and the dialog shows no Hold column. + pub hold_shortcuts: bool, + /// Seconds a key with a hold shortcut must stay down before the hold shortcut runs (Hold + /// Shortcut Delay, 0.2 to 1.0). VectorCraft's own default, 0.35. + pub key_hold_delay: f64, /// With View › Show Bounding Box on, the bounding box stays visible while a drag moves the /// selection, and the shape tools that show it draw it around the shape being drawn. Off (the /// default), it hides during a move and while a shape is drawn, except that a Selection tool @@ -385,6 +392,21 @@ pub struct Prefs { pub import_matches: Vec, } +/// The default Hold Shortcut Delay, in seconds (VectorCraft's own value). +pub const KEY_HOLD_DELAY: f64 = 0.35; +/// The range of the Hold Shortcut Delay, in seconds. +pub const KEY_HOLD_DELAY_RANGE: (f64, f64) = (0.2, 1.0); + +impl Prefs { + /// The Hold Shortcut Delay in seconds, inside its range. A restored settings file is not + /// checked against the range, so a value outside it is brought inside, and one that is not a + /// number gives the default. + pub fn key_hold_delay(&self) -> f64 { + let (min, max) = KEY_HOLD_DELAY_RANGE; + if self.key_hold_delay.is_finite() { self.key_hold_delay.clamp(min, max) } else { KEY_HOLD_DELAY } + } +} + impl Default for Prefs { fn default() -> Self { let s = |v: &str| v.to_string(); @@ -415,6 +437,8 @@ impl Default for Prefs { scrub_numeric_fields: true, trackpad_rotate_view: true, hold_tool_keys: true, + hold_shortcuts: false, + key_hold_delay: KEY_HOLD_DELAY, bounding_box_while_moving_and_drawing: false, paste_offset: 10.0, selection_tolerance: 3.0, diff --git a/crates/engine/src/tests/prefs_file.rs b/crates/engine/src/tests/prefs_file.rs index c2822ba937..bfe98b901b 100644 --- a/crates/engine/src/tests/prefs_file.rs +++ b/crates/engine/src/tests/prefs_file.rs @@ -176,3 +176,24 @@ fn a_file_over_the_limit_is_refused_before_it_is_parsed() { assert!(s.execute("prefs.import", &json!({"path": missing.to_string_lossy()})).is_err()); assert_eq!(s.prefs.to_json().to_string(), before); } + +/// Hold Shortcuts is off by default. The Hold Shortcut Delay takes 0.2 to 1.0 s and refuses other +/// values; a value from a settings file outside the range is brought inside it. +#[test] +fn hold_shortcut_preferences() { + let mut s = Session::new(); + assert!(!s.prefs.hold_shortcuts); + assert_eq!(s.prefs.key_hold_delay(), 0.35); + for ok in [0.2, 1.0] { + s.execute("prefs.set", &json!({"key": "keyHoldDelay", "value": ok})).unwrap(); + assert_eq!(s.prefs.key_hold_delay(), ok); + } + for bad in [0.1, 1.5] { + assert!(is_bad_params(s.execute("prefs.set", &json!({"key": "keyHoldDelay", "value": bad}))), "{bad}"); + } + s.execute("prefs.set", &json!({"key": "holdShortcuts", "value": true})).unwrap(); + assert!(s.prefs.hold_shortcuts); + let restored: Prefs = serde_json::from_value(json!({"keyHoldDelay": 5.0})).unwrap(); + assert_eq!(restored.key_hold_delay(), 1.0); + assert!(!restored.hold_shortcuts); +} diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index 8e651622af..3774177db0 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -173,8 +173,13 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "Cmd+I", "{} open the Check Spelling dialog to walk through unrecognized words with suggestions, ignore, change and dictionary options", ), - ("shortcuts.set", "Set Keyboard Shortcut", "", "{id: command id or tool:, shortcut: \"Cmd+Shift+K\" | \"\" (none) | null (default), force?}"), - ("shortcuts.list", "List Keyboard Shortcuts", "", "{query?} → [{id, label, group, shortcut, default, overridden}]"), + ( + "shortcuts.set", + "Set Keyboard Shortcut", + "", + "{id: command id or tool:, shortcut?: \"Cmd+Shift+K\" | \"\" (none) | null (default), hold?: a character key alone or with Shift (\"X\", \"Shift+X\", \".\") | \"\" | null (none), force?} → {id, shortcut, hold, removedFrom}; `hold` alone leaves the shortcut as it is; a hold shortcut acts while the holdShortcuts preference is on", + ), + ("shortcuts.list", "List Keyboard Shortcuts", "", "{query?} → [{id, label, group, shortcut, hold, default, overridden}]"), ("shortcuts.conflicts", "Keyboard Shortcut Conflicts", "", "{} → [{shortcut, ids}]"), ("shortcuts.reset", "Reset Keyboard Shortcuts", "", "{}"), ( @@ -188,7 +193,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "shortcuts.exportText", "Export Keyboard Shortcuts as Text…", "", - "{path?} save the current set's tools and menu commands with their shortcuts as a UTF-8 text file (Keyboard Shortcuts › Export Text…): the set's name, then a Tools and a Menu Commands section in the dialog's order, one `nameshortcut` line per row, empty after the tab when it has none; without `path`, pick a file", + "{path?} save the current set's tools and menu commands with their shortcuts as a UTF-8 text file (Keyboard Shortcuts › Export Text…): the set's name, then a Tools and a Menu Commands section in the dialog's order, one `nameshortcut` line per row, empty after the tab when it has none, and while the holdShortcuts preference is on a third `Hold ` column on a row with a hold shortcut; without `path`, pick a file", ), ("shortcuts.import", "Import Keyboard Shortcuts…", "", "{path? | data?}"), ( diff --git a/crates/ui-egui/src/app.rs b/crates/ui-egui/src/app.rs index f708d0f454..e5f5cfc91c 100644 --- a/crates/ui-egui/src/app.rs +++ b/crates/ui-egui/src/app.rs @@ -191,6 +191,7 @@ impl VectorcraftApp { input_frames: vec![], shortcuts_frames: vec![], held_tool: Vec::new(), + hold_keys: Default::default(), synthetic_injected: false, injected_events: vec![], injected_generation: InputGeneration::default(), diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index a6a69d9100..8b4fba95fc 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -7018,3 +7018,13 @@ breakText Glyphs Глифи Open a document to mark its fold lines. Отворете документ, за да отбележите линиите му на сгъване. Remove Fold Line Role Премахни вида на линията @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer трябва да е "singleLine", "everyLine", "standardSingleLine" или "standardEveryLine" + Tap Кратко натискане + Clear Hold Изчистване на задържането + Hold Shortcuts Комбинации със задържане + Hold Shortcut Delay Забавяне на комбинациите със задържане + How hold shortcuts work Как работят комбинациите със задържане + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Щракнете и натиснете клавиш, който да се задържа за това (Esc отменя). Задържането на клавиша изпълнява това; краткото натискане изпълнява собствената комбинация на клавиша. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Краткото натискане на клавиш изпълнява неговата комбинация. Задържането на клавиша за времето на забавяне изпълнява вместо това инструмента или командата от колоната му „Задръжте“. Комбинация със задържане е клавиш с буква, цифра или препинателен знак, самостоятелно или с Shift. +@msg Hold {_1} is already used by {_2} Задържането на {_1} вече се използва от {_2} +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) комбинация със задържане е клавиш, който въвежда знак, самостоятелно или с Shift ({shown} съдържа Cmd, Ctrl или Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} не може да бъде комбинация със задържане: използвайте буква, цифра или препинателен знак diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 5da48b6cff..bbfca4e045 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -7071,3 +7071,13 @@ shape Open Otvoren Open a document to mark its fold lines. Otvorite dokument da označite njegove linije savijanja. Remove Fold Line Role Ukloni vrstu linije @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer mora biti "singleLine", "everyLine", "standardSingleLine" ili "standardEveryLine" + Tap Kratki pritisak + Clear Hold Očisti zadržavanje + Hold Shortcuts Prečice zadržavanjem + Hold Shortcut Delay Kašnjenje prečica zadržavanjem + How hold shortcuts work Kako rade prečice zadržavanjem + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Kliknite, zatim pritisnite tipku koju treba zadržati za ovo (Esc otkazuje). Zadržavanje tipke pokreće ovo; kratki pritisak pokreće vlastitu prečicu tipke. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Kratki pritisak tipke pokreće njenu prečicu. Zadržavanje tipke tokom kašnjenja umjesto toga pokreće alat ili naredbu iz njene kolone Zadrži. Prečica zadržavanjem je tipka sa slovom, cifrom ili interpunkcijskim znakom, sama ili sa Shift. +@msg Hold {_1} is already used by {_2} Zadržavanje {_1} već koristi {_2} +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) prečica zadržavanjem je tipka koja upisuje znak, sama ili sa Shift ({shown} ima Cmd, Ctrl ili Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} ne može biti prečica zadržavanjem: koristite slovo, cifru ili interpunkcijsku tipku diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index e861e61fec..91f334b451 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -7793,3 +7793,13 @@ breakText Glyphs Glifs Open a document to mark its fold lines. Obre un document per marcar-ne les línies de plegat. Remove Fold Line Role Elimina el tipus de línia @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer ha de ser "singleLine", "everyLine", "standardSingleLine" o "standardEveryLine" + Tap Pulsació breu + Clear Hold Esborra la pulsació llarga + Hold Shortcuts Dreceres de pulsació llarga + Hold Shortcut Delay Retard de les dreceres de pulsació llarga + How hold shortcuts work Com funcionen les dreceres de pulsació llarga + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Fes clic i prem una tecla per mantenir premuda per a això (Esc cancel·la). Mantenir premuda la tecla executa això; una pulsació breu executa la drecera pròpia de la tecla. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Una pulsació breu d’una tecla executa la seva drecera. Mantenir premuda la tecla durant el retard executa en canvi l’eina o l’ordre de la seva columna Mantén. Una drecera de pulsació llarga és una tecla de lletra, xifra o puntuació, sola o amb Shift. +@msg Hold {_1} is already used by {_2} La pulsació llarga de {_1} ja la fa servir {_2} +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) una drecera de pulsació llarga és una tecla que escriu un caràcter, sola o amb Shift ({shown} té Cmd, Ctrl o Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} no pot ser una drecera de pulsació llarga: fes servir una lletra, una xifra o una tecla de puntuació diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 1a4d359b93..eacda6ef61 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -9613,3 +9613,13 @@ breakText Glyphs Glyfy No objects are selected. Nejsou vybrány žádné objekty. Open a document to mark its fold lines. Otevřete dokument, abyste označili jeho linie skladu. Remove Fold Line Role Odstranit typ linie + Tap Krátký stisk + Clear Hold Vymazat podržení + Hold Shortcuts Zkratky podržením + Hold Shortcut Delay Prodleva zkratek podržením + How hold shortcuts work Jak fungují zkratky podržením + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Klikněte a stiskněte klávesu, kterou pro toto podržíte (Esc zruší). Podržení klávesy spustí toto; krátký stisk spustí vlastní zkratku klávesy. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Krátký stisk klávesy spustí její zkratku. Podržení klávesy po dobu prodlevy místo toho spustí nástroj nebo příkaz z jejího sloupce Podržení. Zkratka podržením je klávesa s písmenem, číslicí nebo interpunkcí, samotná nebo se Shiftem. +@msg Hold {_1} is already used by {_2} Podržení {_1} už používá {_2} +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) zkratka podržením je klávesa, která píše znak, samotná nebo se Shiftem ({shown} obsahuje Cmd, Ctrl nebo Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} nemůže být zkratkou podržením: použijte písmeno, číslici nebo interpunkční klávesu diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 723766f020..5ba395314d 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -7703,3 +7703,13 @@ breakText Glyphs Glyffer Open a document to mark its fold lines. Åbn et dokument for at markere dets foldelinjer. Remove Fold Line Role Fjern linjetype @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer skal være "singleLine", "everyLine", "standardSingleLine" eller "standardEveryLine" + Tap Kort tryk + Clear Hold Ryd hold + Hold Shortcuts Holdegenveje + Hold Shortcut Delay Forsinkelse for holdegenveje + How hold shortcuts work Sådan virker holdegenveje + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Klik, og tryk derefter på en tast, der skal holdes nede for dette (Esc annullerer). Når tasten holdes nede, køres dette; et kort tryk kører tastens egen genvej. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Et kort tryk på en tast kører dens genvej. Når tasten holdes nede i forsinkelsens varighed, køres i stedet værktøjet eller kommandoen i dens Hold-kolonne. En holdegenvej er en bogstav-, ciffer- eller tegnsætningstast, alene eller med Shift. +@msg Hold {_1} is already used by {_2} Hold {_1} bruges allerede af {_2} +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) en holdegenvej er en tast, der skriver et tegn, alene eller med Shift ({shown} har Cmd, Ctrl eller Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} kan ikke være en holdegenvej: brug et bogstav, et ciffer eller en tegnsætningstast diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 21a07e09e5..113b51e3bd 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -9211,3 +9211,13 @@ breakText Glyphs Glyphen No objects are selected. Es sind keine Objekte ausgewählt. Open a document to mark its fold lines. Öffnen Sie ein Dokument, um seine Faltlinien festzulegen. Remove Fold Line Role Linienart entfernen + Tap Kurz drücken + Clear Hold Halten löschen + Hold Shortcuts Halte-Tastaturbefehle + Hold Shortcut Delay Verzögerung für Halte-Tastaturbefehle + How hold shortcuts work So funktionieren Halte-Tastaturbefehle + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Klicken Sie und drücken Sie dann eine Taste, die hierfür gehalten werden soll (Esc bricht ab). Halten der Taste führt dies aus; kurzes Drücken führt den eigenen Tastaturbefehl der Taste aus. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Kurzes Drücken einer Taste führt ihren Tastaturbefehl aus. Halten der Taste für die Dauer der Verzögerung führt stattdessen das Werkzeug oder den Befehl in ihrer Spalte „Halten“ aus. Ein Halte-Tastaturbefehl ist eine Buchstaben-, Ziffern- oder Satzzeichentaste, allein oder mit Shift. +@msg Hold {_1} is already used by {_2} Halten {_1} wird bereits von {_2} verwendet +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) Ein Halte-Tastaturbefehl ist eine Taste, die ein Zeichen eingibt, allein oder mit Shift ({shown} enthält Cmd, Ctrl oder Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} kann kein Halte-Tastaturbefehl sein: Verwenden Sie einen Buchstaben, eine Ziffer oder eine Satzzeichentaste diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index ebd167f397..62a69a7f97 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -7767,3 +7767,13 @@ breakText Glyphs Γλύφοι Open a document to mark its fold lines. Ανοίξτε ένα έγγραφο για να σημειώσετε τις γραμμές δίπλωσής του. Remove Fold Line Role Αφαίρεση τύπου γραμμής @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" το composer πρέπει να είναι "singleLine", "everyLine", "standardSingleLine" ή "standardEveryLine" + Tap Σύντομο πάτημα + Clear Hold Εκκαθάριση παρατεταμένου πατήματος + Hold Shortcuts Συντομεύσεις παρατεταμένου πατήματος + Hold Shortcut Delay Καθυστέρηση συντομεύσεων παρατεταμένου πατήματος + How hold shortcuts work Πώς λειτουργούν οι συντομεύσεις παρατεταμένου πατήματος + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Κάντε κλικ και πατήστε ένα πλήκτρο που θα κρατάτε πατημένο για αυτό (Esc για ακύρωση). Το παρατεταμένο πάτημα του πλήκτρου εκτελεί αυτό. Ένα σύντομο πάτημα εκτελεί τη συντόμευση του ίδιου του πλήκτρου. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Ένα σύντομο πάτημα πλήκτρου εκτελεί τη συντόμευσή του. Αν κρατήσετε πατημένο το πλήκτρο για τον χρόνο καθυστέρησης, εκτελείται αντί γι’ αυτό το εργαλείο ή η εντολή της στήλης «Κρατήστε πατημένο». Μια συντόμευση παρατεταμένου πατήματος είναι ένα πλήκτρο γράμματος, ψηφίου ή σημείου στίξης, μόνο του ή με Shift. +@msg Hold {_1} is already used by {_2} το παρατεταμένο πάτημα του {_1} χρησιμοποιείται ήδη από το {_2} +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) μια συντόμευση παρατεταμένου πατήματος είναι ένα πλήκτρο που πληκτρολογεί έναν χαρακτήρα, μόνο του ή με Shift (το {shown} έχει Cmd, Ctrl ή Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key το {shown} δεν μπορεί να είναι συντόμευση παρατεταμένου πατήματος: χρησιμοποιήστε γράμμα, ψηφίο ή πλήκτρο στίξης diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 27d7d4aaf8..b4df50d6b1 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -7754,3 +7754,13 @@ breakText Glyphs Glifos Open a document to mark its fold lines. Abre un documento para marcar sus líneas de plegado. Remove Fold Line Role Quitar tipo de línea @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer debe ser "singleLine", "everyLine", "standardSingleLine" o "standardEveryLine" + Tap Pulsación breve + Clear Hold Borrar pulsación larga + Hold Shortcuts Métodos abreviados de pulsación larga + Hold Shortcut Delay Retardo de pulsación larga + How hold shortcuts work Cómo funcionan los métodos abreviados de pulsación larga + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Haz clic y presiona una tecla que mantener pulsada para esto (Esc cancela). Mantener pulsada la tecla ejecuta esto; una pulsación breve ejecuta el método abreviado propio de la tecla. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Una pulsación breve de una tecla ejecuta su método abreviado. Mantener pulsada la tecla durante el retardo ejecuta en su lugar la herramienta o el comando de su columna Mantener pulsado. Un método abreviado de pulsación larga es una tecla de letra, dígito o puntuación, sola o con Shift. +@msg Hold {_1} is already used by {_2} La pulsación larga de {_1} ya la usa {_2} +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) un método abreviado de pulsación larga es una tecla que escribe un carácter, sola o con Shift ({shown} tiene Cmd, Ctrl o Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} no puede ser un método abreviado de pulsación larga: usa una letra, un dígito o una tecla de puntuación diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 3f29fd7f7a..fca0c1cda1 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -7850,3 +7850,13 @@ breakText Glyphs Merkit Open a document to mark its fold lines. Avaa asiakirja, niin voit merkitä sen taittoviivat. Remove Fold Line Role Poista viivatyyppi @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer on oltava "singleLine", "everyLine", "standardSingleLine" tai "standardEveryLine" + Tap Lyhyt painallus + Clear Hold Tyhjennä pitkä painallus + Hold Shortcuts Pitkän painalluksen pikanäppäimet + Hold Shortcut Delay Pitkän painalluksen viive + How hold shortcuts work Näin pitkän painalluksen pikanäppäimet toimivat + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Napsauta ja paina sitten näppäintä, jota pidetään pohjassa tätä varten (Esc peruuttaa). Näppäimen pitäminen pohjassa suorittaa tämän; lyhyt painallus suorittaa näppäimen oman pikanäppäimen. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Näppäimen lyhyt painallus suorittaa sen pikanäppäimen. Kun näppäintä pidetään pohjassa viiveen ajan, suoritetaan sen sijaan sen Pidä pohjassa -sarakkeen työkalu tai komento. Pitkän painalluksen pikanäppäin on kirjain-, numero- tai välimerkkinäppäin yksin tai Shiftin kanssa. +@msg Hold {_1} is already used by {_2} Pitkä painallus {_1} on jo käytössä kohteella {_2} +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) pitkän painalluksen pikanäppäin on merkin kirjoittava näppäin yksin tai Shiftin kanssa ({shown} sisältää Cmd-, Ctrl- tai Alt-näppäimen) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} ei voi olla pitkän painalluksen pikanäppäin: käytä kirjainta, numeroa tai välimerkkinäppäintä diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 20e94749c5..e18a7cbda1 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -9598,4 +9598,14 @@ breakText Glyphs Glyphes No objects are selected. Aucun objet n’est sélectionné. Open a document to mark its fold lines. Ouvrez un document pour marquer ses lignes de pliage. Remove Fold Line Role Supprimer le type de ligne + Tap Appui bref + Clear Hold Effacer le maintien + Hold Shortcuts Raccourcis de maintien + Hold Shortcut Delay Délai des raccourcis de maintien + How hold shortcuts work Fonctionnement des raccourcis de maintien + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Cliquez, puis appuyez sur une touche à maintenir pour cet élément (Échap annule). Maintenir la touche exécute cet élément ; un appui bref exécute le raccourci propre à la touche. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Un appui bref sur une touche exécute son raccourci. Maintenir la touche pendant le délai exécute à la place l’outil ou la commande de sa colonne Maintenir. Un raccourci de maintien est une touche de lettre, de chiffre ou de ponctuation, seule ou avec Maj. +@msg Hold {_1} is already used by {_2} Le maintien de {_1} est déjà utilisé par {_2} +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) un raccourci de maintien est une touche qui saisit un caractère, seule ou avec Maj ({shown} comporte Cmd, Ctrl ou Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} ne peut pas être un raccourci de maintien : utilisez une lettre, un chiffre ou une touche de ponctuation @msg {_1} × {_2} pixels is too large for GIF (at most 65535 pixels a side): lower the resolution {_1} × {_2} pixels, c’est trop grand pour le GIF (65535 pixels par côté au plus) : réduisez la résolution diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index ff59a464c5..814251df4f 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -4798,3 +4798,13 @@ swatch [Registration] [રજિસ્ટ્રેશન] Standard Single-line Composer સ્ટાન્ડર્ડ સિંગલ-લાઇન કમ્પોઝર Standard Every-line Composer સ્ટાન્ડર્ડ એવરી-લાઇન કમ્પોઝર @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer આમાંથી એક હોવું જોઈએ: "singleLine", "everyLine", "standardSingleLine" અથવા "standardEveryLine" + Tap ટૂંકું દબાણ + Clear Hold હોલ્ડ સાફ કરો + Hold Shortcuts હોલ્ડ શોર્ટકટ + Hold Shortcut Delay હોલ્ડ શોર્ટકટ વિલંબ + How hold shortcuts work હોલ્ડ શોર્ટકટ કેવી રીતે કામ કરે છે + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. ક્લિક કરો, પછી આ માટે દબાવી રાખવાની કી દબાવો (Esc રદ કરે છે). કી દબાવી રાખવાથી આ ચાલે છે; ટૂંકું દબાણ કીનો પોતાનો શોર્ટકટ ચલાવે છે. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. કીને ટૂંકું દબાવવાથી તેનો શોર્ટકટ ચાલે છે. વિલંબ જેટલો સમય કી દબાવી રાખવાથી તેના બદલે તેની હોલ્ડ કૉલમમાંનું ટૂલ અથવા આદેશ ચાલે છે. હોલ્ડ શોર્ટકટ એ અક્ષર, અંક અથવા વિરામચિહ્નની કી છે, એકલી અથવા Shift સાથે. +@msg Hold {_1} is already used by {_2} હોલ્ડ {_1} પહેલેથી {_2} વાપરે છે +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) હોલ્ડ શોર્ટકટ એ અક્ષર લખતી કી છે, એકલી અથવા Shift સાથે ({shown} માં Cmd, Ctrl અથવા Alt છે) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} હોલ્ડ શોર્ટકટ ન હોઈ શકે: અક્ષર, અંક અથવા વિરામચિહ્નની કી વાપરો diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 6fe8f254f4..1e37429de3 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -9205,3 +9205,13 @@ theme Appearance अपीयरेंस No objects are selected. कोई ऑब्जेक्ट सिलेक्ट नहीं है। Open a document to mark its fold lines. फ़ोल्ड लाइनें मार्क करने के लिए कोई डॉक्यूमेंट ओपन करें। Remove Fold Line Role लाइन प्रकार हटाएँ + Tap जल्दी दबाना + Clear Hold होल्ड साफ़ करें + Hold Shortcuts होल्ड शॉर्टकट + Hold Shortcut Delay होल्ड शॉर्टकट विलंब + How hold shortcuts work होल्ड शॉर्टकट कैसे काम करते हैं + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. क्लिक करें, फिर इसके लिए दबाए रखने वाली कुंजी दबाएँ (Esc रद्द)। कुंजी दबाए रखने पर यह चलता है; जल्दी से दबाने पर कुंजी का अपना शॉर्टकट चलता है। + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. किसी कुंजी को जल्दी से दबाने पर उसका शॉर्टकट चलता है। कुंजी को विलंब जितनी देर दबाए रखने पर इसके बजाय उसके होल्ड कॉलम का टूल या कमांड चलता है। होल्ड शॉर्टकट कोई अक्षर, अंक या विराम चिह्न वाली कुंजी होती है, अकेले या Shift के साथ। +@msg Hold {_1} is already used by {_2} होल्ड {_1} का उपयोग पहले से ही {_2} द्वारा किया जाता है +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) होल्ड शॉर्टकट ऐसी कुंजी होती है जो अकेले या Shift के साथ कोई कैरेक्टर टाइप करती है ({shown} में Cmd, Ctrl या Alt है) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} होल्ड शॉर्टकट नहीं हो सकता: कोई अक्षर, अंक या विराम चिह्न वाली कुंजी उपयोग करें diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 4a93411b47..d6a795b6b1 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -9601,3 +9601,13 @@ breakText Glyphs Glifák No objects are selected. Nincs kijelölt objektum. Open a document to mark its fold lines. Nyiss meg egy dokumentumot a hajtásvonalai megjelöléséhez. Remove Fold Line Role Vonaltípus eltávolítása + Tap Rövid lenyomás + Clear Hold Nyomva tartás törlése + Hold Shortcuts Nyomva tartásos billentyűparancsok + Hold Shortcut Delay Nyomva tartás késleltetése + How hold shortcuts work Így működnek a nyomva tartásos billentyűparancsok + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Kattints, majd nyomd le a billentyűt, amelyet ehhez nyomva kell tartani (Esc: mégse). A billentyű nyomva tartása ezt futtatja; a rövid lenyomás a billentyű saját billentyűparancsát futtatja. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Egy billentyű rövid lenyomása a billentyűparancsát futtatja. Ha a késleltetés idejéig nyomva tartod, helyette a Nyomva tartás oszlopában lévő eszköz vagy parancs fut. Nyomva tartásos billentyűparancs lehet egy betű-, szám- vagy írásjelbillentyű, önmagában vagy Shifttel. +@msg Hold {_1} is already used by {_2} már foglalt: nyomva tartás {_1} (használja: {_2}) +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) a nyomva tartásos billentyűparancs egy karaktert beíró billentyű, önmagában vagy Shifttel ({shown} Cmd, Ctrl vagy Alt billentyűt tartalmaz) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} nem lehet nyomva tartásos billentyűparancs: használj betű-, szám- vagy írásjelbillentyűt diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index bf029526f7..6c30d93fa3 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -7033,3 +7033,13 @@ breakText Glyphs Glif Open a document to mark its fold lines. Buka dokumen untuk menandai garis lipatnya. Remove Fold Line Role Hapus jenis garis @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer harus "singleLine", "everyLine", "standardSingleLine", atau "standardEveryLine" + Tap Tekan singkat + Clear Hold Hapus Tahan + Hold Shortcuts Pintasan tahan + Hold Shortcut Delay Jeda pintasan tahan + How hold shortcuts work Cara kerja pintasan tahan + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Klik, lalu tekan tombol yang ditahan untuk ini (Esc membatalkan). Menahan tombol menjalankan ini; tekan singkat menjalankan pintasan milik tombol itu sendiri. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Tekan singkat sebuah tombol menjalankan pintasannya. Menahan tombol selama jeda menjalankan alat atau perintah di kolom Tahan sebagai gantinya. Pintasan tahan adalah tombol huruf, angka, atau tanda baca, sendiri atau dengan Shift. +@msg Hold {_1} is already used by {_2} Tahan {_1} sudah digunakan oleh {_2} +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) pintasan tahan adalah tombol yang mengetik karakter, sendiri atau dengan Shift ({shown} memakai Cmd, Ctrl, atau Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} tidak bisa menjadi pintasan tahan: gunakan huruf, angka, atau tombol tanda baca diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 360ec1d5ba..bc0c3854e8 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -9245,3 +9245,13 @@ breakText Glyphs Glifi No objects are selected. Nessun oggetto selezionato. Open a document to mark its fold lines. Apri un documento per segnarne le linee di piega. Remove Fold Line Role Rimuovi tipo di linea + Tap Pressione breve + Clear Hold Cancella pressione prolungata + Hold Shortcuts Scorciatoie a pressione prolungata + Hold Shortcut Delay Ritardo delle scorciatoie a pressione prolungata + How hold shortcuts work Come funzionano le scorciatoie a pressione prolungata + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Fai clic, poi premi un tasto da tenere premuto per questo (Esc annulla). Tenere premuto il tasto esegue questo; una pressione breve esegue la scorciatoia del tasto stesso. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Una pressione breve di un tasto esegue la sua scorciatoia. Tenere premuto il tasto per la durata del ritardo esegue invece lo strumento o il comando della sua colonna Tieni premuto. Una scorciatoia a pressione prolungata è un tasto di lettera, cifra o punteggiatura, da solo o con Shift. +@msg Hold {_1} is already used by {_2} La pressione prolungata di {_1} è già usata da {_2} +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) una scorciatoia a pressione prolungata è un tasto che digita un carattere, da solo o con Shift ({shown} ha Cmd, Ctrl o Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} non può essere una scorciatoia a pressione prolungata: usa una lettera, una cifra o un tasto di punteggiatura diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 37089bb835..5262880734 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -9312,3 +9312,13 @@ breakText Glyphs 字形 No objects are selected. オブジェクトが選択されていません。 Open a document to mark its fold lines. ドキュメントを開くと折り線を設定できます。 Remove Fold Line Role 線種を解除 + Tap 短押し + Clear Hold 長押しを消去 + Hold Shortcuts 長押しショートカット + Hold Shortcut Delay 長押しショートカットの遅延 + How hold shortcuts work 長押しショートカットのしくみ + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. クリックしてから、これに使う長押しのキーを押します (Esc でキャンセル)。キーを長押しするとこれを実行し、短く押すとキー自体のショートカットを実行します。 + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. キーを短く押すと、そのショートカットを実行します。遅延の時間だけキーを押し続けると、代わりに長押し列のツールまたはコマンドを実行します。長押しショートカットには、文字、数字、句読点のキーを単独で、または Shift と組み合わせて使用できます。 +@msg Hold {_1} is already used by {_2} 長押し {_1} はすでに {_2} で使用されています +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) 長押しショートカットは、文字を入力するキーを単独で、または Shift と組み合わせたものです ({shown} には Cmd、Ctrl、Alt のいずれかが含まれています) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} は長押しショートカットにできません: 文字、数字、句読点のいずれかのキーを使用してください diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 25fb4f87ed..759bc441c0 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -9885,3 +9885,13 @@ font-script Japanese იაპონური Open a document to mark its fold lines. გახსენით დოკუმენტი მისი მოკეცვის ხაზების მოსანიშნად. Remove Fold Line Role ხაზის ტიპის მოხსნა @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer უნდა იყოს "singleLine", "everyLine", "standardSingleLine" ან "standardEveryLine" + Tap მოკლე დაჭერა + Clear Hold ხანგრძლივი დაჭერის გასუფთავება + Hold Shortcuts ხანგრძლივი დაჭერის მალსახმობები + Hold Shortcut Delay ხანგრძლივი დაჭერის დაყოვნება + How hold shortcuts work როგორ მუშაობს ხანგრძლივი დაჭერის მალსახმობები + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. დაწკაპეთ, შემდეგ დააჭირეთ კლავიშს, რომელიც ამისთვის უნდა დაიჭიროთ (Esc აუქმებს). კლავიშის ხანგრძლივი დაჭერა ამას უშვებს; მოკლე დაჭერა კლავიშის საკუთარ მალსახმობს უშვებს. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. კლავიშის მოკლე დაჭერა მის მალსახმობს უშვებს. თუ კლავიშს დაყოვნების ხანგრძლივობით დაიჭერთ, ამის ნაცვლად გაეშვება მისი „დაჭერა“ სვეტის ხელსაწყო ან ბრძანება. ხანგრძლივი დაჭერის მალსახმობი არის ასოს, ციფრის ან სასვენი ნიშნის კლავიში, ცალკე ან Shift კლავიშთან ერთად. +@msg Hold {_1} is already used by {_2} ხანგრძლივი დაჭერა {_1} უკვე გამოიყენება ამისთვის: {_2} +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) ხანგრძლივი დაჭერის მალსახმობი არის კლავიში, რომელიც სიმბოლოს წერს, ცალკე ან Shift კლავიშთან ერთად ({shown} შეიცავს Cmd, Ctrl ან Alt კლავიშს) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} ვერ იქნება ხანგრძლივი დაჭერის მალსახმობი: გამოიყენეთ ასო, ციფრი ან სასვენი ნიშნის კლავიში diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 0787180a1c..f482021c87 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -9208,3 +9208,13 @@ breakText Glyphs 글리프 No objects are selected. 선택한 개체가 없습니다. Open a document to mark its fold lines. 접는 선을 지정하려면 문서를 여세요. Remove Fold Line Role 선 종류 제거 + Tap 짧게 누르기 + Clear Hold 길게 누르기 지우기 + Hold Shortcuts 길게 누르기 단축키 + Hold Shortcut Delay 길게 누르기 단축키 지연 시간 + How hold shortcuts work 길게 누르기 단축키 작동 방식 + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. 클릭한 다음 이 항목에 길게 누를 키를 누르세요 (Esc로 취소). 키를 길게 누르면 이 항목이 실행되고, 짧게 누르면 키 자체의 단축키가 실행됩니다. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. 키를 짧게 누르면 해당 단축키가 실행됩니다. 지연 시간 동안 키를 누르고 있으면 대신 누르고 있기 열의 도구나 명령이 실행됩니다. 길게 누르기 단축키는 문자, 숫자 또는 문장 부호 키이며, 단독으로 또는 Shift와 함께 사용합니다. +@msg Hold {_1} is already used by {_2} 길게 누르기 {_1}은(는) 이미 {_2}에서 사용 중입니다 +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) 길게 누르기 단축키는 문자를 입력하는 키를 단독으로 또는 Shift와 함께 사용해야 합니다 ({shown}에 Cmd, Ctrl 또는 Alt가 있음) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown}은(는) 길게 누르기 단축키가 될 수 없습니다: 문자, 숫자 또는 문장 부호 키를 사용하세요 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index ab30a3639f..4c6a1784f8 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -9646,3 +9646,13 @@ breakText Glyphs Glyphs No objects are selected. Er zijn geen objecten geselecteerd. Open a document to mark its fold lines. Open een document om de vouwlijnen te markeren. Remove Fold Line Role Lijnsoort verwijderen + Tap Kort drukken + Clear Hold Vasthouden wissen + Hold Shortcuts Vasthoudsneltoetsen + Hold Shortcut Delay Vertraging vasthoudsneltoetsen + How hold shortcuts work Zo werken vasthoudsneltoetsen + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Klik en druk vervolgens een toets in die hiervoor wordt vastgehouden (Esc annuleert). De toets vasthouden voert dit uit; kort drukken voert de eigen sneltoets van de toets uit. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Kort drukken op een toets voert de sneltoets ervan uit. De toets vasthouden gedurende de vertraging voert in plaats daarvan het gereedschap of de opdracht in de kolom Houd uit. Een vasthoudsneltoets is een letter-, cijfer- of leestekentoets, alleen of met Shift. +@msg Hold {_1} is already used by {_2} Vasthouden {_1} wordt al gebruikt door {_2} +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) een vasthoudsneltoets is een toets die een teken typt, alleen of met Shift ({shown} bevat Cmd, Ctrl of Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} kan geen vasthoudsneltoets zijn: gebruik een letter, een cijfer of een leestekentoets diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 085935a9bd..598e2cc6eb 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -9466,3 +9466,13 @@ breakText Glyphs Glify No objects are selected. Nie zaznaczono żadnych obiektów. Open a document to mark its fold lines. Otwórz dokument, aby oznaczyć jego linie zgięcia. Remove Fold Line Role Usuń rodzaj linii + Tap Krótkie naciśnięcie + Clear Hold Wyczyść przytrzymanie + Hold Shortcuts Skróty przytrzymania + Hold Shortcut Delay Opóźnienie skrótów przytrzymania + How hold shortcuts work Jak działają skróty przytrzymania + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Kliknij, a następnie naciśnij klawisz, który ma być przytrzymywany dla tego elementu (Esc anuluje). Przytrzymanie klawisza uruchamia ten element; krótkie naciśnięcie uruchamia własny skrót klawisza. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Krótkie naciśnięcie klawisza uruchamia jego skrót. Przytrzymanie klawisza przez czas opóźnienia uruchamia zamiast tego narzędzie lub polecenie z jego kolumny Przytrzymaj. Skrót przytrzymania to klawisz litery, cyfry lub znaku interpunkcyjnego, sam lub z Shift. +@msg Hold {_1} is already used by {_2} Przytrzymanie {_1} jest już używane przez {_2} +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) skrót przytrzymania to klawisz wpisujący znak, sam lub z Shift ({shown} zawiera Cmd, Ctrl lub Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} nie może być skrótem przytrzymania: użyj litery, cyfry lub klawisza interpunkcyjnego diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 0289161fe4..d2bb22f8be 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -9684,3 +9684,13 @@ swatch Yellow Green Verde-amarelado No objects are selected. Nenhum objeto selecionado. Open a document to mark its fold lines. Abra um documento para marcar suas linhas de dobra. Remove Fold Line Role Remover Tipo de Linha + Tap Toque Rápido + Clear Hold Limpar Pressionamento Longo + Hold Shortcuts Atalhos de Pressionamento Longo + Hold Shortcut Delay Atraso dos Atalhos de Pressionamento Longo + How hold shortcuts work Como funcionam os atalhos de pressionamento longo + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Clique e depois pressione uma tecla para manter pressionada para isto (Esc cancela). Manter a tecla pressionada executa isto; um toque rápido executa o atalho da própria tecla. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Um toque rápido em uma tecla executa o atalho dela. Manter a tecla pressionada pelo tempo do atraso executa, em vez disso, a ferramenta ou o comando da coluna Manter pressionado. Um atalho de pressionamento longo é uma tecla de letra, número ou pontuação, sozinha ou com Shift. +@msg Hold {_1} is already used by {_2} O pressionamento longo de {_1} já é usado por {_2} +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) um atalho de pressionamento longo é uma tecla que digita um caractere, sozinha ou com Shift ({shown} tem Cmd, Ctrl ou Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} não pode ser um atalho de pressionamento longo: use uma letra, um número ou uma tecla de pontuação diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index e45ac9423a..bd4c98a94a 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -9709,3 +9709,13 @@ shape Open Открытый Remove Fold Line Role Убрать тип линии @msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} пикселей — слишком большой размер для PSD (не более {MAX_SIDE} пикселей по стороне): уменьшите разрешение @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer должен быть "singleLine", "everyLine", "standardSingleLine" или "standardEveryLine" + Tap Короткое нажатие + Clear Hold Очистить удержание + Hold Shortcuts Клавиши удержания + Hold Shortcut Delay Задержка клавиш удержания + How hold shortcuts work Как работают клавиши удержания + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Щелкните, затем нажмите клавишу, которую нужно удерживать для этого (Esc отменяет). Удержание клавиши запускает это; короткое нажатие запускает собственное сочетание клавиши. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Короткое нажатие клавиши запускает ее сочетание. Удержание клавиши в течение задержки запускает вместо этого инструмент или команду из ее столбца «Удерживать». Клавиша удержания — это клавиша буквы, цифры или знака препинания, отдельно или с Shift. +@msg Hold {_1} is already used by {_2} Удержание {_1} уже используется для {_2} +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) клавиша удержания — это клавиша, которая вводит символ, отдельно или с Shift ({shown} содержит Cmd, Ctrl или Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} не может быть клавишей удержания: используйте букву, цифру или клавишу знака препинания diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 95e7c34b47..5b599e4df9 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -9283,3 +9283,13 @@ digits Hindi Hindi Open a document to mark its fold lines. Öppna ett dokument för att markera dess falslinjer. Remove Fold Line Role Ta bort linjetyp @msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} pixlar är för stort för PSD (högst {MAX_SIDE} pixlar per sida): sänk upplösningen + Tap Kort tryck + Clear Hold Rensa håll + Hold Shortcuts Hållkortkommandon + Hold Shortcut Delay Fördröjning för hållkortkommandon + How hold shortcuts work Så fungerar hållkortkommandon + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Klicka och tryck sedan på en tangent som ska hållas ned för detta (Esc avbryter). Att hålla ned tangenten kör detta; ett kort tryck kör tangentens eget kortkommando. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Ett kort tryck på en tangent kör dess kortkommando. Att hålla ned tangenten under fördröjningen kör i stället verktyget eller kommandot i dess Håll-kolumn. Ett hållkortkommando är en bokstavs-, siffer- eller skiljeteckentangent, ensam eller med Shift. +@msg Hold {_1} is already used by {_2} Håll {_1} används redan av {_2} +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) ett hållkortkommando är en tangent som skriver ett tecken, ensam eller med Shift ({shown} har Cmd, Ctrl eller Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} kan inte vara ett hållkortkommando: använd en bokstav, en siffra eller en skiljeteckentangent diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index d8249b1c79..ef10a57c7d 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -9567,3 +9567,13 @@ breakText Glyphs Glifler No objects are selected. Hiçbir nesne seçili değil. Open a document to mark its fold lines. Katlama çizgilerini işaretlemek için bir belgeyi açın. Remove Fold Line Role Çizgi Türünü Kaldır + Tap Kısa Basma + Clear Hold Basılı Tutmayı Temizle + Hold Shortcuts Basılı Tutma Kısayolları + Hold Shortcut Delay Basılı Tutma Kısayolu Gecikmesi + How hold shortcuts work Basılı tutma kısayolları nasıl çalışır + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Tıklayın, ardından bunun için basılı tutulacak tuşa basın (Esc iptal edilir). Tuşu basılı tutmak bunu çalıştırır; kısa basmak tuşun kendi kısayolunu çalıştırır. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Bir tuşa kısa basmak onun kısayolunu çalıştırır. Tuşu gecikme süresi boyunca basılı tutmak bunun yerine Basılı tutun sütunundaki aracı veya komutu çalıştırır. Basılı tutma kısayolu, tek başına veya Shift ile bir harf, rakam ya da noktalama tuşudur. +@msg Hold {_1} is already used by {_2} Basılı tutma {_1} zaten {_2} tarafından kullanılıyor +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) basılı tutma kısayolu, tek başına veya Shift ile bir karakter yazan tuştur ({shown} Cmd, Ctrl veya Alt içeriyor) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} basılı tutma kısayolu olamaz: bir harf, rakam veya noktalama tuşu kullanın diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 8ebb97a5be..e5ab45e496 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -9220,3 +9220,13 @@ breakText Glyphs Гліфи No objects are selected. Об’єкти не виділено. Open a document to mark its fold lines. Відкрийте документ, щоб позначити його лінії згину. Remove Fold Line Role Прибрати тип лінії + Tap Коротке натискання + Clear Hold Очистити утримання + Hold Shortcuts Клавіші утримання + Hold Shortcut Delay Затримка клавіш утримання + How hold shortcuts work Як працюють клавіші утримання + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Клацніть, потім натисніть клавішу, яку слід утримувати для цього (Esc скасовує). Утримання клавіші запускає це; коротке натискання запускає власне сполучення клавіші. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Коротке натискання клавіші запускає її сполучення. Утримання клавіші протягом затримки запускає натомість інструмент або команду з її стовпця «Утримувати». Клавіша утримання — це клавіша літери, цифри або розділового знака, окремо або з Shift. +@msg Hold {_1} is already used by {_2} Утримання {_1} вже використовується для {_2} +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) клавіша утримання — це клавіша, що вводить символ, окремо або з Shift ({shown} містить Cmd, Ctrl або Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} не може бути клавішею утримання: використайте літеру, цифру або клавішу розділового знака diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index a9a9cb140a..23ef3d3845 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -7424,3 +7424,13 @@ breakText Glyphs Glyph @msg {width} × {height} pixels is too large for Targa (at most 65535 pixels a side): lower the resolution {width} × {height} điểm ảnh quá lớn cho Targa (tối đa 65535 điểm ảnh mỗi cạnh): hãy giảm độ phân giải @msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} điểm ảnh quá lớn cho PSD (tối đa {MAX_SIDE} điểm ảnh mỗi cạnh): hãy giảm độ phân giải @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer phải là "singleLine", "everyLine", "standardSingleLine" hoặc "standardEveryLine" + Tap Nhấn nhanh + Clear Hold Xóa nhấn giữ + Hold Shortcuts Phím tắt nhấn giữ + Hold Shortcut Delay Độ trễ phím tắt nhấn giữ + How hold shortcuts work Cách phím tắt nhấn giữ hoạt động + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Nhấp, rồi nhấn phím cần giữ cho mục này (Esc để hủy). Giữ phím sẽ chạy mục này; nhấn nhanh sẽ chạy phím tắt riêng của phím đó. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Nhấn nhanh một phím sẽ chạy phím tắt của phím đó. Giữ phím trong khoảng độ trễ sẽ chạy công cụ hoặc lệnh trong cột Giữ của phím thay vào đó. Phím tắt nhấn giữ là một phím chữ cái, chữ số hoặc dấu câu, dùng riêng hoặc cùng Shift. +@msg Hold {_1} is already used by {_2} Nhấn giữ {_1} đã được {_2} sử dụng +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) phím tắt nhấn giữ là một phím gõ ra ký tự, dùng riêng hoặc cùng Shift ({shown} có Cmd, Ctrl hoặc Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} không thể là phím tắt nhấn giữ: hãy dùng chữ cái, chữ số hoặc phím dấu câu diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index f3a87e6b84..76ff60f06d 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -9452,3 +9452,13 @@ breakText Glyphs 字形 Open a document to mark its fold lines. 打开文档以标记其折线。 Remove Fold Line Role 移除线条类型 @msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} 像素对 PSD 而言过大 (每边最多 {MAX_SIDE} 像素):请降低分辨率 + Tap 短按 + Clear Hold 清除按住 + Hold Shortcuts 按住快捷键 + Hold Shortcut Delay 按住快捷键延迟 + How hold shortcuts work 按住快捷键的工作方式 + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. 单击后按下要为此按住的键 (Esc 取消)。按住该键会运行此项;短按会运行该键自己的快捷键。 + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. 短按一个键会运行它的快捷键。按住该键达到延迟时间,则改为运行其“按住”列中的工具或命令。按住快捷键是字母、数字或标点键,可单独使用或与 Shift 组合。 +@msg Hold {_1} is already used by {_2} 按住 {_1} 已被 {_2} 使用 +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) 按住快捷键是可输入字符的键,单独使用或与 Shift 组合 ({shown} 含有 Cmd、Ctrl 或 Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} 不能作为按住快捷键:请使用字母、数字或标点键 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 52715f8360..e7a8224e13 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -9262,3 +9262,13 @@ breakText Glyphs 字符 Open a document to mark its fold lines. 開啟文件以標記其摺線。 Remove Fold Line Role 移除線條類型 @msg {what} would print on more than {MAX_TILES} tiles: scale it down {what} 會列印在超過 {MAX_TILES} 個拼貼上:請縮小 + Tap 短按 + Clear Hold 清除按住 + Hold Shortcuts 按住快速鍵 + Hold Shortcut Delay 按住快速鍵延遲 + How hold shortcuts work 按住快速鍵的運作方式 + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. 按一下後按下要為此按住的按鍵 (Esc 取消)。按住該按鍵會執行此項;短按會執行該按鍵本身的快速鍵。 + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. 短按按鍵會執行它的快速鍵。按住按鍵達延遲時間,則改為執行其「按住」欄中的工具或命令。按住快速鍵是字母、數字或標點符號按鍵,可單獨使用或搭配 Shift。 +@msg Hold {_1} is already used by {_2} 按住 {_1} 已被 {_2} 使用 +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) 按住快速鍵是可輸入字元的按鍵,可單獨使用或搭配 Shift ({shown} 含有 Cmd、Ctrl 或 Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} 不能作為按住快速鍵:請使用字母、數字或標點符號按鍵 diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 3f89789d5d..7f13d34da3 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -368,6 +368,9 @@ pub struct VectorcraftApp { /// The single-key tool shortcuts held down, the last held last, and the tool each goes back to /// when it is let go ([`shortcuts::HeldTool`]). pub(crate) held_tool: Vec, + /// A key with a hold shortcut that waits for its release, and the keys whose repeats are held + /// back until they are let go ([`shortcuts::HoldKeys`]). + pub(crate) hold_keys: shortcuts::HoldKeys, /// A synthetic batch is in the host's raw input and no settled UI pass has taken it yet. synthetic_injected: bool, /// The exact events of [`Self::synthetic_injected`], to remove them if the state they belong diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index 4c286f1da9..dbe67c5916 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -174,8 +174,13 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "Cmd+I", "{} open the Check Spelling dialog to walk through unrecognized words with suggestions, ignore, change and dictionary options", ), - ("shortcuts.set", "Set Keyboard Shortcut", "", "{id: command id or tool:, shortcut: \"Cmd+Shift+K\" | \"\" (none) | null (default), force?}"), - ("shortcuts.list", "List Keyboard Shortcuts", "", "{query?} → [{id, label, group, shortcut, default, overridden}]"), + ( + "shortcuts.set", + "Set Keyboard Shortcut", + "", + "{id: command id or tool:, shortcut?: \"Cmd+Shift+K\" | \"\" (none) | null (default), hold?: a character key alone or with Shift (\"X\", \"Shift+X\", \".\") | \"\" | null (none), force?} → {id, shortcut, hold, removedFrom}; `hold` alone leaves the shortcut as it is; a hold shortcut acts while the holdShortcuts preference is on", + ), + ("shortcuts.list", "List Keyboard Shortcuts", "", "{query?} → [{id, label, group, shortcut, hold, default, overridden}]"), ("shortcuts.conflicts", "Keyboard Shortcut Conflicts", "", "{} → [{shortcut, ids}]"), ("shortcuts.reset", "Reset Keyboard Shortcuts", "", "{}"), ( @@ -189,7 +194,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "shortcuts.exportText", "Export Keyboard Shortcuts as Text…", "", - "{path?} save the current set's tools and menu commands with their shortcuts as a UTF-8 text file (Keyboard Shortcuts › Export Text…): the set's name, then a Tools and a Menu Commands section in the dialog's order, one `nameshortcut` line per row, empty after the tab when it has none; without `path`, pick a file", + "{path?} save the current set's tools and menu commands with their shortcuts as a UTF-8 text file (Keyboard Shortcuts › Export Text…): the set's name, then a Tools and a Menu Commands section in the dialog's order, one `nameshortcut` line per row, empty after the tab when it has none, and while the holdShortcuts preference is on a third `Hold ` column on a row with a hold shortcut; without `path`, pick a file", ), ("shortcuts.import", "Import Keyboard Shortcuts…", "", "{path? | data?}"), ( diff --git a/crates/ui-egui/src/prefs_dialog.rs b/crates/ui-egui/src/prefs_dialog.rs index f9939177de..c01a31d754 100644 --- a/crates/ui-egui/src/prefs_dialog.rs +++ b/crates/ui-egui/src/prefs_dialog.rs @@ -580,6 +580,18 @@ fn category_fields(ui: &mut egui::Ui, app: &mut VectorcraftApp, d: &mut Dialog, } } PrefKind::Bool => bool_row(ui, d, sp.key, sp.label), + // General › Hold Shortcut Delay acts only while Hold Shortcuts is on: dimmed while it + // is off, as in Edit › Keyboard Shortcuts, which shows it only then. + PrefKind::Num { min, max, unit } if sp.key == "keyHoldDelay" => { + ui.add_enabled_ui(d.bool("holdShortcuts"), |ui| { + labeled(ui, sp.label, |ui, _| { + let x = v.as_f64().unwrap_or(min); + if let Some(x) = widgets::range_field(ui, sp.key, x, min..=max, &format!(" {unit}"), 3, 110.0) { + d.fields.insert(sp.key.into(), json!(x)); + } + }); + }); + } PrefKind::Num { min, max, unit } => { labeled(ui, sp.label, |ui, label_id| { let mut x = v.as_f64().unwrap_or(min); diff --git a/crates/ui-egui/src/prefs_dialog/tests.rs b/crates/ui-egui/src/prefs_dialog/tests.rs index 5c9356edd9..84b9abd4af 100644 --- a/crates/ui-egui/src/prefs_dialog/tests.rs +++ b/crates/ui-egui/src/prefs_dialog/tests.rs @@ -1093,6 +1093,45 @@ fn scroll_sideways_with_cmd_wheel_dims_with_zoom_with_mouse_wheel() { } } +/// General › Hold Shortcut Delay: its field is dimmed while Hold Shortcuts is unchecked in the +/// dialog, and a click on it then does not give it the keyboard. +#[test] +fn hold_shortcut_delay_dims_without_hold_shortcuts() { + fn text(s: &egui::Shape, f: &dyn Fn(&str) -> bool) -> Option { + match s { + egui::Shape::Text(t) if f(t.galley.text()) => Some(t.visual_bounding_rect()), + egui::Shape::Vec(v) => v.iter().find_map(|s| text(s, f)), + _ => None, + } + } + for on in [true, false] { + let ctx = egui::Context::default(); + crate::theme::install_fonts(&ctx); + let mut a = app(); + let mut d = Dialog::new("preferences", json!({"holdShortcuts": on, "keyHoldDelay": 0.35})); + let mut frame = |d: &mut Dialog, events: Vec| { + let raw = egui::RawInput { + screen_rect: Some(egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(600.0, 2400.0))), + events, + ..Default::default() + }; + let mut out = ctx.run_ui(raw, |ui| category_fields(ui, &mut a, d, "General")); + out.textures_delta.clear(); + let label = out.shapes.iter().find_map(|c| text(&c.shape, &|t| t.starts_with("Hold Shortcut Delay"))); + let field = out.shapes.iter().find_map(|c| text(&c.shape, &|t| t.starts_with("0.35"))); + (label, field) + }; + let (label, field) = frame(&mut d, vec![]); + assert!(label.is_some(), "no label (on {on})"); + let at = field.unwrap_or_else(|| panic!("no field (on {on})")); + let press = + |pressed| egui::Event::PointerButton { pos: at.center(), button: egui::PointerButton::Primary, pressed, modifiers: Default::default() }; + frame(&mut d, vec![egui::Event::PointerMoved(at.center()), press(true)]); + frame(&mut d, vec![press(false)]); + assert_eq!(ctx.memory(|m| m.focused().is_some()), on, "a click gives the field the keyboard only while Hold Shortcuts is on ({on})"); + } +} + /// Type › Show samples on white: its checkbox is dimmed while Enable in-menu font previews is /// unchecked in the dialog, and a click on it then leaves the setting as it was. #[test] diff --git a/crates/ui-egui/src/shortcut_editor.rs b/crates/ui-egui/src/shortcut_editor.rs index 88a97206c7..da0448162c 100644 --- a/crates/ui-egui/src/shortcut_editor.rs +++ b/crates/ui-egui/src/shortcut_editor.rs @@ -1141,6 +1141,89 @@ pub fn reset_one(overrides: &mut Overrides, key: &str) { crate::keymap::remove_override(overrides, key); } +/// Hold shortcuts: entry key → chord text ([`UiState::shortcut_holds`]). +pub type Holds = BTreeMap; + +/// The chord of hold shortcut text `text`, or why it can't be one. A hold shortcut is a key that +/// types a character, alone or with Shift. Space and the backtick key are refused: the canvas reads +/// them while they are held. +pub fn hold_chord(text: &str) -> Result { + let chord = vc_chord(text).ok_or_else(|| format!("can't parse shortcut `{text}`"))?; + let shown = menus::pretty_shortcut(&vc_format(&chord)); + if chord.mods.cmd || chord.mods.ctrl || chord.mods.alt { + return Err(format!("a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt)")); + } + if chord.key == craft_keymap::Key::Backtick || !crate::shortcuts::types_text(chord.key) { + return Err(format!("{shown} can't be a hold shortcut: use a letter, a digit or a punctuation key")); + } + Ok(chord) +} + +/// The hold shortcut of `key` in `holds`, in VectorCraft's chord spelling, when it is usable. +pub fn hold_of(holds: &Holds, key: &str) -> Option { + holds.get(key).and_then(|t| hold_chord(t).ok()).map(|c| vc_format(&c)) +} + +/// The entry whose usable hold shortcut is `chord`: the first in `holds`' order when several are. +/// An entry no longer listed (a removed plug-in's) keeps its text but does not hold. +pub(crate) fn hold_for<'a>(holds: &'a Holds, chord: &craft_keymap::Chord) -> Option<&'a str> { + holds.iter().find(|(k, t)| hold_chord(t).is_ok_and(|c| c == *chord) && entry(k).is_some()).map(|(k, _)| k.as_str()) +} + +/// Sets (`Some`) or removes (`None` or `""`) the hold shortcut of `key`. Another entry that holds +/// the same key loses it when `force`; otherwise that is an error. Returns the entries that lost +/// it. Nothing changes on an error. +pub fn assign_hold(holds: &mut Holds, key: &str, text: Option<&str>, force: bool) -> Result, String> { + if entry(key).is_none() { + return Err(format!("unknown tool or command `{key}`")); + } + let Some(text) = text.filter(|t| !t.is_empty()) else { + holds.remove(key); + return Ok(vec![]); + }; + let chord = hold_chord(text)?; + let taken: Vec = holds.iter().filter(|(k, t)| *k != key && vc_chord(t) == Some(chord)).map(|(k, _)| k.clone()).collect(); + if !taken.is_empty() && !force { + let names: Vec = taken.iter().map(|k| entry(k).map_or(k.clone(), |e| english_name(&e))).collect(); + return Err(format!("Hold {} is already used by {}", menus::pretty_shortcut(&vc_format(&chord)), names.join(", "))); + } + for k in &taken { + holds.remove(k); + } + holds.insert(key.to_string(), vc_format(&chord)); + Ok(taken) +} + +/// Hold shortcuts used by more than one entry: (chord text, entry keys). +pub fn hold_conflicts(holds: &Holds) -> Vec<(String, Vec)> { + let mut by: BTreeMap> = BTreeMap::new(); + for (k, t) in holds { + if let Ok(c) = hold_chord(t) { + by.entry(vc_format(&c)).or_default().push(k.clone()); + } + } + by.into_iter().filter(|(_, keys)| keys.len() > 1).collect() +} + +/// The hold shortcuts of an exported set's `holds` member: none when it is missing. Every value +/// must be a usable hold shortcut; otherwise the error names the first entry that is not. +pub fn import_holds(v: &Value) -> Result { + let Some(h) = v.get("holds") else { return Ok(Holds::new()) }; + let h = h.as_object().ok_or("`holds` must be an object")?; + let mut out = Holds::new(); + for (k, v) in h { + let s = v.as_str().ok_or_else(|| format!("hold shortcut for `{k}` must be a string"))?; + let c = hold_chord(s).map_err(|e| format!("hold shortcut for `{k}`: {e}"))?; + out.insert(k.clone(), vc_format(&c)); + } + Ok(out) +} + +/// The hold shortcuts of the Keyboard Shortcuts dialog's working set. +fn dialog_holds(d: &Dialog) -> Holds { + d.fields.get("holds").and_then(|v| serde_json::from_value(v.clone()).ok()).unwrap_or_default() +} + /// Text shown for all active chords in a dialog row, with the backtick key shown as `typed` /// ([`backtick_text`]). fn dialog_shortcuts_with(km: &Keymap, key: &str, typed: Option<&str>) -> Option { @@ -1161,7 +1244,17 @@ pub fn preset(name: &str) -> Option { /// Export format: `{"format": "vectorcraft-shortcuts", "set": name, "overrides": {...}}`. pub fn export_json(set: &str, overrides: &Overrides) -> Value { - json!({"format": "vectorcraft-shortcuts", "version": 1, "set": set, "overrides": stored::to_value(overrides)}) + export_json_with(set, overrides, &Holds::new()) +} + +/// [`export_json`] with the set's hold shortcuts, written as `holds` when there are any. The +/// version stays 1: earlier versions read `overrides` only, so they import the file without them. +pub fn export_json_with(set: &str, overrides: &Overrides, holds: &Holds) -> Value { + let mut v = json!({"format": "vectorcraft-shortcuts", "version": 1, "set": set, "overrides": stored::to_value(overrides)}); + if !holds.is_empty() { + v["holds"] = json!(holds); + } + v } pub fn import_json(v: &Value) -> Result<(String, Overrides), String> { @@ -1181,6 +1274,11 @@ pub fn import_json(v: &Value) -> Result<(String, Overrides), String> { /// row per line with the name and the shortcuts as the dialog shows them, separated by a tab. A /// row with no shortcut ends after the tab. pub fn export_text(set: &str, overrides: &Overrides) -> String { + export_text_with(set, overrides, &Holds::new()) +} + +/// [`export_text`] with the set's hold shortcuts: a row with one gets a third column, `Hold X`. +pub fn export_text_with(set: &str, overrides: &Overrides, holds: &Holds) -> String { let snapshot = snapshot(); let km = crate::keymap::keymap_in(&snapshot, overrides); let backtick = backtick_text(); @@ -1191,7 +1289,10 @@ pub fn export_text(set: &str, overrides: &Overrides) -> String { for e in snapshot.entries.iter().filter(|e| e.is_tool == tools && listed(km.overrides(), e)) { let name = shown_name(e); let sc = dialog_shortcuts_with(&km, &e.key, backtick.as_deref()).unwrap_or_default(); - out += &format!("{name}\t{sc}\n"); + match hold_of(holds, &e.key) { + Some(h) => out += &format!("{name}\t{sc}\t{} {}\n", tl!("Hold"), menus::pretty_shortcut(&h)), + None => out += &format!("{name}\t{sc}\n"), + } } } out @@ -1203,10 +1304,35 @@ pub fn open(app: &mut VectorcraftApp) { let ov = stored::to_value(&app.ui.shortcut_overrides); app.ui.dialog = Some(Dialog::new( "shortcuts", - json!({"tab": "tools", "query": "", "set": app.ui.shortcut_set, "overrides": ov, "__recording": "", "__selected": "", "__message": "", "__conflict": ""}), + json!({ + "tab": "tools", + "query": "", + "set": app.ui.shortcut_set, + "overrides": ov, + "holds": app.ui.shortcut_holds, + "holdShortcuts": app.session.prefs.hold_shortcuts, + "keyHoldDelay": app.session.prefs.key_hold_delay(), + "__holdInfo": false, + "__recording": "", + "__recordingHold": false, + "__selected": "", + "__message": "", + "__conflict": "" + }), )); } +/// Hold Shortcuts in the Keyboard Shortcuts dialog's working copy. +fn dialog_holds_on(d: &Dialog) -> bool { + d.bool("holdShortcuts") +} + +/// The Hold Shortcut Delay in the Keyboard Shortcuts dialog's working copy, in its range. +fn dialog_hold_delay(d: &Dialog) -> f64 { + let (min, max) = vectorcraft_engine::KEY_HOLD_DELAY_RANGE; + d.fields.get("keyHoldDelay").and_then(Value::as_f64).filter(|x| x.is_finite()).map_or(vectorcraft_engine::KEY_HOLD_DELAY, |x| x.clamp(min, max)) +} + fn dialog_overrides(d: &Dialog) -> Overrides { d.fields.get("overrides").map(|v| stored::from_value(v.clone())).unwrap_or_default() } @@ -1214,7 +1340,13 @@ fn dialog_overrides(d: &Dialog) -> Overrides { /// OK: commit the working set. pub fn confirm(app: &mut VectorcraftApp) -> Result { let Some(d) = app.ui.dialog.clone() else { return Err("no dialog open".into()) }; + let (on, delay) = (dialog_holds_on(&d), dialog_hold_delay(&d)); + let prefs = &app.session.prefs; + if d.kind == "shortcuts" && (on != prefs.hold_shortcuts || delay != prefs.key_hold_delay()) { + app.run("prefs.set", json!({"values": {"holdShortcuts": on, "keyHoldDelay": delay}})).map_err(|e| e.to_string())?; + } app.ui.shortcut_overrides = dialog_overrides(&d); + app.ui.shortcut_holds = dialog_holds(&d); app.ui.shortcut_set = d.str("set"); app.ui.dialog = None; sync(&app.ui); @@ -1244,18 +1376,45 @@ pub fn run_command(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option (key.unwrap_or_default(), shortcut, force.unwrap_or(false)), (Err(e), _, _) | (_, Err(e), _) | (_, _, Err(e)) => return Some(Err(e)), }; + let hold = match s("hold") { + Ok(hold) => hold, + Err(e) => return Some(Err(e)), + }; + // Without `hold`, a missing `shortcut` removes the shortcut, as it always has; with + // `hold` alone, the shortcut is left as it is. Both are checked before either is kept. + let has_hold = p.get("hold").is_some(); + let has_shortcut = p.get("shortcut").is_some() || !has_hold; let mut ov = app.ui.shortcut_overrides.clone(); - let r = if p.get("shortcut").is_some_and(Value::is_null) { + let mut holds = app.ui.shortcut_holds.clone(); + let r = if !has_shortcut { + Ok(vec![]) + } else if p.get("shortcut").is_some_and(Value::is_null) { reset_one(&mut ov, &key); Ok(vec![]) } else { assign(&mut ov, &key, shortcut.as_deref(), force) }; + let r = r.and_then(|mut removed| { + if has_hold { + for k in assign_hold(&mut holds, &key, hold.as_deref(), force)? { + if !removed.contains(&k) { + removed.push(k); + } + } + } + Ok(removed) + }); r.map(|removed| { app.ui.shortcut_overrides = ov; + app.ui.shortcut_holds = holds; app.ui.shortcut_set = CUSTOM.into(); sync(&app.ui); - json!({"id": key, "shortcut": effective_in(&app.ui.shortcut_overrides, &key), "removedFrom": removed}) + json!({ + "id": key, + "shortcut": effective_in(&app.ui.shortcut_overrides, &key), + "hold": hold_of(&app.ui.shortcut_holds, &key), + "removedFrom": removed + }) }) } "shortcuts.list" => { @@ -1272,15 +1431,19 @@ pub fn run_command(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option { - Ok(json!(all_conflicts(&app.ui.shortcut_overrides).into_iter().map(|(c, k)| json!({"shortcut": c, "ids": k})).collect::>())) + let holds = hold_conflicts(&app.ui.shortcut_holds).into_iter().map(|(c, k)| (format!("Hold {c}"), k)); + Ok(json!( + all_conflicts(&app.ui.shortcut_overrides).into_iter().chain(holds).map(|(c, k)| json!({"shortcut": c, "ids": k})).collect::>() + )) } "shortcuts.reset" => { app.ui.shortcut_overrides.clear(); + app.ui.shortcut_holds.clear(); app.ui.shortcut_set = PRESETS[0].into(); sync(&app.ui); Ok(Value::Null) @@ -1288,6 +1451,8 @@ pub fn run_command(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option match s("name").map(|n| n.as_deref().map(set_name).and_then(|n| preset(n).map(|p| (n.to_string(), p)))) { Ok(Some((n, p))) => { app.ui.shortcut_overrides = p; + // The presets have no hold shortcuts. + app.ui.shortcut_holds.clear(); app.ui.shortcut_set = n; sync(&app.ui); Ok(Value::Null) @@ -1300,7 +1465,7 @@ pub fn run_command(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option path, Err(e) => return Some(Err(e)), }; - let v = export_json(&app.ui.shortcut_set, &app.ui.shortcut_overrides); + let v = export_json_with(&app.ui.shortcut_set, &app.ui.shortcut_overrides, &app.ui.shortcut_holds); let bytes = serde_json::to_vec_pretty(&v).unwrap_or_default(); let pick = crate::FilePick { filters: vec![crate::FilePick::filter("Shortcut sets", &["json"])], @@ -1329,7 +1494,9 @@ pub fn run_command(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option Option Err("no file reader".into()), } }; - data.and_then(|v| import_json(&v)).map(|(set, ov)| { + data.and_then(|v| Ok((import_json(&v)?, import_holds(&v)?))).map(|((set, ov), holds)| { let n = ov.len(); app.ui.shortcut_overrides = ov; + app.ui.shortcut_holds = holds; app.ui.shortcut_set = set; sync(&app.ui); if let Some(d) = app.ui.dialog.as_mut().filter(|d| d.kind == "shortcuts") { d.fields.insert("overrides".into(), stored::to_value(&app.ui.shortcut_overrides)); + d.fields.insert("holds".into(), json!(app.ui.shortcut_holds)); d.fields.insert("set".into(), json!(app.ui.shortcut_set)); } json!({"overrides": n}) @@ -1466,7 +1635,10 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) { let mut cancel = false; drop_hidden(&mut d, km.overrides()); let saved = dialog_overrides(&d); + let mut holds = dialog_holds(&d); let recording = d.str("__recording"); + // Which column records: the Hold column, or the Shortcut column. + let recording_hold = !recording.is_empty() && d.bool("__recordingHold"); // Record a chord (before widgets see the keys). Modifiers held down are part of the next key's // chord, not a chord of their own. if !recording.is_empty() { @@ -1481,7 +1653,11 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) { if key == Key::Escape { d.fields.insert("__recording".into(), json!("")); } else if let Some(chord) = chord_from_event(key, m) { - record(&mut d, km.to_mut(), &recording, &chord); + if recording_hold { + record_hold(&mut d, &mut holds, &recording, &chord); + } else { + record(&mut d, km.to_mut(), &recording, &chord); + } } } } @@ -1503,6 +1679,8 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) { && let Some(p) = preset(name) { km.to_mut().set_overrides(p); + // The presets have no hold shortcuts. + holds.clear(); d.fields.insert("set".into(), json!(name)); d.fields.insert("__message".into(), json!("")); } @@ -1518,10 +1696,13 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) { } if ui.button(tl!("Reset to Defaults")).clicked() { km.to_mut().reset_all(); + holds.clear(); d.fields.insert("set".into(), json!(PRESETS[0])); d.fields.insert("__message".into(), json!(tl!("All shortcuts reset to defaults."))); } }); + ui.add_space(6.0); + hold_row(ui, &t, &mut d); ui.add_space(8.0); // Tabs + search. ui.horizontal(|ui| { @@ -1544,14 +1725,25 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) { let q = d.str("query").to_lowercase(); let selected = d.str("__selected"); let rec = d.str("__recording"); + let rec_hold = d.bool("__recordingHold"); + let holds_on = dialog_holds_on(&d); let scroll_to = d.fields.remove("__scrollTo").and_then(|v| v.as_str().map(str::to_string)); egui::Frame::NONE.fill(t.input).stroke(egui::Stroke::new(1.0, t.input_border)).inner_margin(egui::Margin::same(4)).show(ui, |ui| { ui.horizontal(|ui| { - ui.allocate_ui_with_layout(egui::vec2(360.0, 16.0), egui::Layout::left_to_right(egui::Align::Center), |ui| { - ui.set_min_width(360.0); + let name_width = if holds_on { 340.0 } else { 360.0 }; + ui.allocate_ui_with_layout(egui::vec2(name_width, 16.0), egui::Layout::left_to_right(egui::Align::Center), |ui| { + ui.set_min_width(name_width); ui.label(egui::RichText::new(if tools { tl!("Tool") } else { tl!("Command") }).color(t.text_dim).size(11.0)); }); - ui.label(egui::RichText::new(tl!("Shortcut")).color(t.text_dim).size(11.0)); + if holds_on { + ui.allocate_ui_with_layout(egui::vec2(150.0, 16.0), egui::Layout::left_to_right(egui::Align::Center), |ui| { + ui.set_min_width(150.0); + ui.label(egui::RichText::new(tl!("Shortcut")).color(t.text_dim).size(11.0)); + }); + ui.label(egui::RichText::new(tl!("Hold")).color(t.text_dim).size(11.0)); + } else { + ui.label(egui::RichText::new(tl!("Shortcut")).color(t.text_dim).size(11.0)); + } }); egui::ScrollArea::vertical().max_height(360.0).auto_shrink([false, false]).show(ui, |ui| { for (i, e) in view.entries.iter().enumerate().filter(|(_, e)| e.is_tool == tools && listed(km.overrides(), e)) { @@ -1564,23 +1756,44 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) { } let row = ui.horizontal(|ui| { let name = shown_name(e); + let name_width = if holds_on { 340.0 } else { 360.0 }; let r = ui - .allocate_ui_with_layout(egui::vec2(360.0, 20.0), egui::Layout::left_to_right(egui::Align::Center), |ui| { - ui.set_min_width(360.0); + .allocate_ui_with_layout(egui::vec2(name_width, 20.0), egui::Layout::left_to_right(egui::Align::Center), |ui| { + ui.set_min_width(name_width); ui.add(egui::Button::selectable(selected == e.key, egui::RichText::new(name).color(t.text)).truncate()) }) .inner; if r.clicked() { d.fields.insert("__selected".into(), json!(e.key)); } - let label = if rec == e.key { tl!("Press keys…").to_string() } else { sc.unwrap_or_else(|| "—".into()) }; + let recording_here = rec == e.key && !rec_hold; + let label = if recording_here { tl!("Press keys…").to_string() } else { sc.unwrap_or_else(|| "—".into()) }; let changed = crate::keymap::has_override(&saved, &e.key); let txt = egui::RichText::new(label).color(if changed { t.accent } else { t.text }); let b = ui - .add_sized([150.0, 20.0], egui::Button::new(txt).selected(rec == e.key)) + .add_sized([150.0, 20.0], egui::Button::new(txt).selected(recording_here)) .on_hover_text(tl!("Click, then press the new shortcut (Esc cancels)")); if b.clicked() { d.fields.insert("__recording".into(), json!(e.key)); + d.fields.insert("__recordingHold".into(), json!(false)); + d.fields.insert("__selected".into(), json!(e.key)); + } + if !holds_on { + return; + } + let holding_here = rec == e.key && rec_hold; + let hold = hold_of(&holds, &e.key); + let label = if holding_here { + tl!("Press keys…").to_string() + } else { + hold.as_deref().map_or_else(|| "—".into(), menus::pretty_shortcut) + }; + let h = ui.add_sized([90.0, 20.0], egui::Button::new(egui::RichText::new(label).color(t.text)).selected(holding_here)).on_hover_text( + tl!("Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut."), + ); + if h.clicked() { + d.fields.insert("__recording".into(), json!(e.key)); + d.fields.insert("__recordingHold".into(), json!(true)); d.fields.insert("__selected".into(), json!(e.key)); } }); @@ -1604,6 +1817,10 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) { if ui.button(tl!("Use Default")).clicked() { km.to_mut().reset(&command_of(&sel)); } + if dialog_holds_on(&d) && ui.add_enabled(holds.contains_key(&sel), egui::Button::new(tl!("Clear Hold"))).clicked() { + holds.remove(&sel); + d.fields.insert("set".into(), json!(CUSTOM)); + } }); let conflict = d.str("__conflict"); if !conflict.is_empty() && ui.button(tl!("Go to Conflict")).clicked() { @@ -1622,7 +1839,7 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) { let n = match &km { Cow::Borrowed(_) => view.conflicts, Cow::Owned(km) => conflicts_in(km).len(), - }; + } + if dialog_holds_on(&d) { hold_conflicts(&holds).len() } else { 0 }; if n > 0 { ui.label( egui::RichText::new(crate::i18n::tn( @@ -1648,6 +1865,10 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) { if let Cow::Owned(km) = &km { d.fields.insert("overrides".into(), stored::to_value(&saved_overrides(km.overrides(), &saved))); } + d.fields.insert("holds".into(), json!(holds)); + if d.str("__recording").is_empty() { + d.fields.insert("__recordingHold".into(), json!(false)); + } let import = d.fields.remove("__import").is_some(); let export = d.fields.remove("__export").is_some(); let export_text = d.fields.remove("__exportText").is_some(); @@ -1682,14 +1903,15 @@ fn import_into_dialog(app: &mut VectorcraftApp) { app.status(crate::picks::dialog_gone()); return; } - let saved = (app.ui.shortcut_overrides.clone(), app.ui.shortcut_set.clone()); + let saved = (app.ui.shortcut_overrides.clone(), app.ui.shortcut_holds.clone(), app.ui.shortcut_set.clone()); match run_command(app, "shortcuts.import", &json!({})) { Some(Ok(_)) => { - let (o, s) = (app.ui.shortcut_overrides.clone(), app.ui.shortcut_set.clone()); - (app.ui.shortcut_overrides, app.ui.shortcut_set) = saved; + let (o, h, s) = (app.ui.shortcut_overrides.clone(), app.ui.shortcut_holds.clone(), app.ui.shortcut_set.clone()); + (app.ui.shortcut_overrides, app.ui.shortcut_holds, app.ui.shortcut_set) = saved; sync(&app.ui); if let Some(d) = app.ui.dialog.as_mut().filter(|d| d.kind == "shortcuts") { d.fields.insert("overrides".into(), stored::to_value(&o)); + d.fields.insert("holds".into(), json!(h)); d.fields.insert("set".into(), json!(s)); d.fields.insert("__message".into(), json!(tl!("Imported. Press OK to keep the imported set."))); } @@ -1715,13 +1937,19 @@ fn export_dialog_set(app: &mut VectorcraftApp, command: &str) { app.status(crate::picks::dialog_gone()); return; } - let (ov, set) = app.ui.dialog.as_ref().map(|d| (dialog_overrides(d), d.str("set"))).unwrap_or_default(); + let (ov, holds, set, on) = + app.ui.dialog.as_ref().map(|d| (dialog_overrides(d), dialog_holds(d), d.str("set"), dialog_holds_on(d))).unwrap_or_default(); let saved = std::mem::replace(&mut app.ui.shortcut_overrides, ov); + let saved_holds = std::mem::replace(&mut app.ui.shortcut_holds, holds); let saved_set = std::mem::replace(&mut app.ui.shortcut_set, set); + // Export Text… lists the hold shortcuts while the dialog's Hold Shortcuts is on. + let saved_on = std::mem::replace(&mut app.session.prefs.hold_shortcuts, on); if let Some(Err(e)) = run_command(app, command, &json!({})) { app.status(e); } + app.session.prefs.hold_shortcuts = saved_on; app.ui.shortcut_overrides = saved; + app.ui.shortcut_holds = saved_holds; app.ui.shortcut_set = saved_set; } @@ -1779,6 +2007,107 @@ fn record(d: &mut Dialog, km: &mut Keymap, key: &str, chord: &str) { } } +/// The Hold Shortcuts row of the Keyboard Shortcuts dialog: the checkbox that turns hold shortcuts +/// on (and shows the Hold column), a button that shows how they work, and, while on, the Hold +/// Shortcut Delay. +fn hold_row(ui: &mut egui::Ui, t: &Tokens, d: &mut Dialog) { + ui.horizontal(|ui| { + let mut on = dialog_holds_on(d); + if ui.checkbox(&mut on, egui::RichText::new(tl!("Hold Shortcuts")).color(t.text)).changed() { + d.fields.insert("holdShortcuts".into(), json!(on)); + if !on && d.bool("__recordingHold") { + d.fields.insert("__recording".into(), json!("")); + d.fields.insert("__recordingHold".into(), json!(false)); + } + } + let info = d.bool("__holdInfo"); + if ui + .add(egui::Button::new(egui::RichText::new("?").color(t.text_dim)).selected(info).small()) + .on_hover_text(tl!("How hold shortcuts work")) + .clicked() + { + d.fields.insert("__holdInfo".into(), json!(!info)); + } + if on { + ui.add_space(12.0); + ui.label(egui::RichText::new(tl!("Hold Shortcut Delay")).color(t.text_dim)); + let (min, max) = vectorcraft_engine::KEY_HOLD_DELAY_RANGE; + let mut delay = dialog_hold_delay(d); + if ui.add(egui::DragValue::new(&mut delay).range(min..=max).speed(0.01).fixed_decimals(2).suffix(" s")).changed() { + d.fields.insert("keyHoldDelay".into(), json!(delay)); + } + } + }); + if d.bool("__holdInfo") { + egui::Frame::NONE.stroke(egui::Stroke::new(1.0, t.input_border)).inner_margin(egui::Margin::same(8)).show(ui, |ui| { + ui.horizontal(|ui| { + hold_illustration(ui, t); + ui.add_space(8.0); + ui.add( + egui::Label::new( + egui::RichText::new(tl!( + "A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift." + )) + .color(t.text) + .size(11.5), + ) + .wrap(), + ); + }); + }); + } +} + +/// A key and two presses of it drawn in code: a short press (Tap) ends before the delay, and a long +/// one (Hold) reaches it. +fn hold_illustration(ui: &mut egui::Ui, t: &Tokens) { + let (rect, _) = ui.allocate_exact_size(egui::vec2(200.0, 52.0), egui::Sense::hover()); + let p = ui.painter_at(rect); + let key = egui::Rect::from_min_size(rect.min + egui::vec2(2.0, 12.0), egui::vec2(28.0, 28.0)); + p.rect(key, 4.0, t.input, egui::Stroke::new(1.0, t.input_border), egui::StrokeKind::Inside); + p.text(key.center(), egui::Align2::CENTER_CENTER, "X", egui::FontId::proportional(13.0), t.text); + let start = key.right() + 10.0; + let delay_x = start + 70.0; + let rows = [(tl!("Tap"), 40.0, key.top() + 6.0), (tl!("Hold"), 100.0, key.bottom() - 6.0)]; + for (label, len, y) in rows { + let color = if start + len >= delay_x { t.accent } else { t.text_dim }; + p.line_segment([egui::pos2(start, y), egui::pos2(start + len, y)], egui::Stroke::new(4.0, color)); + p.text(egui::pos2(start + len + 4.0, y), egui::Align2::LEFT_CENTER, label, egui::FontId::proportional(10.5), t.text); + } + // The delay. + let mut y = rect.top() + 4.0; + while y < rect.bottom() - 4.0 { + p.line_segment([egui::pos2(delay_x, y), egui::pos2(delay_x, (y + 3.0).min(rect.bottom() - 4.0))], egui::Stroke::new(1.0, t.text_dim)); + y += 6.0; + } +} + +/// Apply a recorded key as `key`'s hold shortcut in the working set. Another entry that held the +/// key loses it, with the same warning as a shortcut; a key that can't hold says why. +fn record_hold(d: &mut Dialog, holds: &mut Holds, key: &str, chord: &str) { + d.fields.insert("__recording".into(), json!("")); + d.fields.insert("__recordingHold".into(), json!(false)); + match assign_hold(holds, key, Some(chord), true) { + Ok(removed) => { + d.fields.insert("set".into(), json!(CUSTOM)); + let names: Vec = removed.iter().map(|k| entry(k).map(|e| shown_name(&e)).unwrap_or(k.clone())).collect(); + let message = if names.is_empty() { + String::new() + } else { + crate::i18n::fmt( + tl!("⚠ {chord} was already used by {names} — it has been removed there."), + &[("chord", &menus::pretty_shortcut(chord)), ("names", &names.join(", "))], + ) + }; + d.fields.insert("__message".into(), json!(message)); + d.fields.insert("__conflict".into(), json!("")); + } + Err(e) => { + d.fields.insert("__message".into(), json!(e)); + } + } +} + #[cfg(test)] mod tests { use super::*; @@ -2839,4 +3168,168 @@ mod tests { assert_eq!(r["shortcut"], "Cmd+Alt+Shift+F11"); assert!(app.run("shortcuts.preset", json!({"name": null})).unwrap_err().starts_with("unknown preset")); } + + /// `shortcuts.set {hold}` gives an entry a hold shortcut and leaves its shortcut, its default + /// and its overridden state alone; `shortcuts.list` shows it; Clear (`shortcut: null`) keeps it. + #[test] + fn a_hold_shortcut_is_kept_apart_from_the_shortcut() { + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + let before = effective_in(&app.ui.shortcut_overrides, "paint.swap"); + let r = app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "x"})).unwrap(); + assert_eq!((r["hold"].as_str(), r["shortcut"].as_str().map(str::to_string)), (Some("X"), before.clone())); + assert!(app.ui.shortcut_overrides.is_empty(), "no shortcut changed"); + assert_eq!(app.ui.shortcut_set, CUSTOM); + let rows = with_steady_plugins(|| app.run("shortcuts.list", json!({"query": "paint.swap"})).unwrap()); + let row = rows.as_array().unwrap().iter().find(|r| r["id"] == "paint.swap").unwrap().clone(); + assert_eq!((row["hold"].as_str(), row["overridden"].as_bool()), (Some("X"), Some(false))); + app.run("shortcuts.set", json!({"id": "paint.swap", "shortcut": null})).unwrap(); + assert_eq!(hold_of(&app.ui.shortcut_holds, "paint.swap").as_deref(), Some("X"), "Use Default keeps the hold"); + app.run("shortcuts.set", json!({"id": "paint.swap", "shortcut": "Cmd+Alt+Shift+F9"})).unwrap(); + assert_eq!(hold_of(&app.ui.shortcut_holds, "paint.swap").as_deref(), Some("X"), "a new shortcut keeps the hold"); + app.run("shortcuts.set", json!({"id": "paint.swap", "hold": ""})).unwrap(); + assert!(app.ui.shortcut_holds.is_empty(), "an empty hold removes it"); + app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "Shift+1"})).unwrap(); + app.run("shortcuts.set", json!({"id": "paint.swap", "hold": null})).unwrap(); + assert!(app.ui.shortcut_holds.is_empty(), "a null hold removes it"); + } + + /// A hold shortcut is a key that types a character, alone or with Shift; other keys, a clash + /// without `force` and a hold that is not a string are refused and change nothing. + #[test] + fn hold_shortcuts_refuse_keys_that_cannot_wait() { + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + for bad in ["Space", "Shift+Space", "~", "Shift+~", "Cmd+X", "Alt+X", "Ctrl+X", "Left", "F5", "Enter", "Delete"] { + let r = app.run("shortcuts.set", json!({"id": "paint.swap", "hold": bad})); + assert!(r.is_err(), "{bad}: {r:?}"); + } + assert_eq!(app.run("shortcuts.set", json!({"id": "paint.swap", "hold": 5})), Err("`hold` must be a string".to_string())); + assert!(app.ui.shortcut_holds.is_empty()); + app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "Shift+X"})).unwrap(); + let clash = app.run("shortcuts.set", json!({"id": "select.none", "hold": "Shift+X"})).unwrap_err(); + assert!(clash.starts_with("Hold "), "{clash}"); + // A refused hold leaves the shortcut given with it unchanged too. + let r = app.run("shortcuts.set", json!({"id": "select.none", "shortcut": "Cmd+Alt+Shift+F9", "hold": "Shift+X"})); + assert!(r.is_err()); + assert!(app.ui.shortcut_overrides.is_empty()); + let r = app.run("shortcuts.set", json!({"id": "select.none", "hold": "Shift+X", "force": true})).unwrap(); + assert_eq!(r["removedFrom"], json!(["paint.swap"])); + assert_eq!(app.ui.shortcut_holds.keys().collect::>(), ["select.none"]); + } + + /// Reset All and a preset clear the hold shortcuts; two entries holding one key are a conflict. + #[test] + fn hold_shortcut_conflicts_reset_and_presets() { + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + app.ui.shortcut_holds.insert("paint.swap".into(), "X".into()); + app.ui.shortcut_holds.insert("select.none".into(), "X".into()); + let c = app.run("shortcuts.conflicts", json!({})).unwrap(); + assert!(c.as_array().unwrap().iter().any(|c| c["shortcut"] == "Hold X"), "{c}"); + app.run("shortcuts.reset", json!({})).unwrap(); + assert!(app.ui.shortcut_holds.is_empty()); + app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "X"})).unwrap(); + app.run("shortcuts.preset", json!({"name": PRESETS[0]})).unwrap(); + assert!(app.ui.shortcut_holds.is_empty()); + } + + /// Export… writes the hold shortcuts as `holds` (version 1) only when there are any; Import… + /// reads them, a file without them has none, and a bad one fails and applies nothing. + #[test] + fn hold_shortcuts_export_and_import() { + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + let none = export_json("Studio", &Overrides::new()); + assert!(none.get("holds").is_none()); + let holds: Holds = [("paint.swap".to_string(), "X".to_string())].into(); + let v = export_json_with("Studio", &Overrides::new(), &holds); + assert_eq!((v["version"].as_u64(), v["holds"].clone()), (Some(1), json!({"paint.swap": "X"}))); + app.run("shortcuts.import", json!({"data": v})).unwrap(); + assert_eq!(app.ui.shortcut_holds, holds); + for bad in [json!("X"), json!({"paint.swap": 5}), json!({"paint.swap": "Space"})] { + let mut v = export_json("Other", &Overrides::new()); + v["holds"] = bad.clone(); + assert!(app.run("shortcuts.import", json!({"data": v})).is_err(), "{bad}"); + assert_eq!((app.ui.shortcut_holds.clone(), app.ui.shortcut_set.as_str()), (holds.clone(), "Studio"), "{bad}"); + } + app.run("shortcuts.import", json!({"data": none})).unwrap(); + assert!(app.ui.shortcut_holds.is_empty(), "an import replaces the whole set"); + } + + /// Export Text… gives a row with a hold shortcut a third column while Hold Shortcuts is on. + #[test] + fn export_text_lists_hold_shortcuts_while_they_act() { + type Files = std::rc::Rc>>; + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + let written: Files = Default::default(); + let w = written.clone(); + app.services.write = Some(Box::new(move |_: &str, b: &[u8]| { + w.borrow_mut().push(String::from_utf8(b.to_vec()).map_err(|e| e.to_string())?); + Ok(()) + })); + app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "X"})).unwrap(); + let row = |text: &str| text.lines().find(|l| l.starts_with(&english_name(&entry("paint.swap").unwrap()))).map(str::to_string); + with_steady_plugins(|| { + written.borrow_mut().clear(); + app.run("shortcuts.exportText", json!({"path": "/a.txt"})).unwrap(); + app.run("prefs.set", json!({"key": "holdShortcuts", "value": true})).unwrap(); + app.run("shortcuts.exportText", json!({"path": "/b.txt"})).unwrap(); + app.run("prefs.set", json!({"key": "holdShortcuts", "value": false})).unwrap(); + }); + let files = written.borrow(); + let (off, on) = (row(&files[0]).unwrap(), row(&files[1]).unwrap()); + assert_eq!(off.split('\t').count(), 2, "{off}"); + assert_eq!(on.split('\t').nth(2), Some(format!("Hold {}", menus::pretty_shortcut("X")).as_str()), "{on}"); + } + + /// The text the Keyboard Shortcuts dialog draws in its second frame. + fn dialog_texts(app: &mut VectorcraftApp) -> Vec { + let ctx = egui::Context::default(); + theme::install_fonts(&ctx); + // The modal draws nothing in its first frame, which only sizes it. + let mut out = ctx.run_ui(egui::RawInput::default(), |ui| show(app, ui.ctx())); + out.textures_delta.clear(); + let mut out = ctx.run_ui(egui::RawInput::default(), |ui| show(app, ui.ctx())); + out.textures_delta.clear(); + out.shapes + .iter() + .filter_map(|c| match &c.shape { + egui::Shape::Text(t) => Some(t.galley.text().to_string()), + _ => None, + }) + .collect() + } + + /// Hold Shortcuts is off by default: the dialog shows its checkbox and no Hold column. Turned + /// on, the dialog shows the column and the delay, and OK turns hold shortcuts on; Cancel keeps + /// them off. + #[test] + fn the_hold_shortcuts_checkbox_shows_the_hold_column() { + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + assert!(!app.session.prefs.hold_shortcuts); + open(&mut app); + let off = dialog_texts(&mut app); + assert!(off.iter().any(|t| t == "Hold Shortcuts"), "{off:?}"); + assert!(!off.iter().any(|t| t == "Hold" || t == "Hold Shortcut Delay"), "{off:?}"); + app.ui.dialog.as_mut().unwrap().fields.insert("holdShortcuts".into(), json!(true)); + let on = dialog_texts(&mut app); + assert!(on.iter().any(|t| t == "Hold") && on.iter().any(|t| t == "Hold Shortcut Delay"), "{on:?}"); + app.ui.dialog = None; + assert!(!app.session.prefs.hold_shortcuts, "Cancel keeps them off"); + open(&mut app); + let d = app.ui.dialog.as_mut().unwrap(); + d.fields.insert("holdShortcuts".into(), json!(true)); + d.fields.insert("keyHoldDelay".into(), json!(0.5)); + confirm(&mut app).unwrap(); + assert!(app.session.prefs.hold_shortcuts); + assert_eq!(app.session.prefs.key_hold_delay, 0.5); + } + + /// The info button shows how hold shortcuts work. + #[test] + fn the_info_button_explains_hold_shortcuts() { + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + open(&mut app); + assert!(!dialog_texts(&mut app).iter().any(|t| t.starts_with("A quick press"))); + app.ui.dialog.as_mut().unwrap().fields.insert("__holdInfo".into(), json!(true)); + let texts = dialog_texts(&mut app); + assert!(texts.iter().any(|t| t.starts_with("A quick press")) && texts.iter().any(|t| t == "Tap"), "{texts:?}"); + } } diff --git a/crates/ui-egui/src/shortcuts.rs b/crates/ui-egui/src/shortcuts.rs index d102c40d7e..257e63ecfc 100644 --- a/crates/ui-egui/src/shortcuts.rs +++ b/crates/ui-egui/src/shortcuts.rs @@ -12,11 +12,13 @@ use vectorcraft_tools::{Mods, SurroundingUnit, ToolKey}; use crate::VectorcraftApp; mod held_tool; +mod hold_keys; mod paste; mod presentation; mod typing; pub(crate) use held_tool::{HeldTool, note_tool_use}; +pub(crate) use hold_keys::HoldKeys; use paste::unclip_chords; pub(crate) use paste::{PasteChord, paste_command}; pub(crate) use presentation::presentation_step; @@ -196,6 +198,8 @@ pub fn handle(app: &mut VectorcraftApp, ctx: &egui::Context) { note_key_surfaces(app, ctx); forget_opening_key(ctx); let focused = ctx.input(|input| input.focused) || app.forwarded_frame && ctx.viewport_id() == egui::ViewportId::ROOT; + // The repeats of a key with a hold shortcut stay out of every frame until it is let go. + hold_keys::guard(app, ctx, focused); // A held tool shortcut that is let go returns to the tool active before it. held_tool::follow(app, ctx, focused); if !focused { @@ -243,6 +247,11 @@ pub fn handle(app: &mut VectorcraftApp, ctx: &egui::Context) { presentation_keys(app, ctx); return; } + // Keys with a hold shortcut wait before anything else reads the frame's keys, so a key pressed + // after one acts after it. + if hold_keys::intake(app, ctx) { + return; + } // Escape that cancels a ruler-origin drag or floating Tools move skips the tool and later Escape actions, // and so do its repeats while it is held. let escape_ended_gesture = escape_ended_gesture(ctx); @@ -580,42 +589,60 @@ fn single_key_shortcuts(app: &mut VectorcraftApp, ctx: &egui::Context) { }) .collect() }); - let keymap = crate::shortcut_editor::current(); for (text, m, pressed, repeat) in events { if m.command || m.alt || m.ctrl { continue; } - let upper = text.to_uppercase(); - let key = if m.shift && text.chars().all(|c| c.is_alphabetic()) { format!("Shift+{upper}") } else { upper.clone() }; - // A shifted punctuation character can also be written with its Shift (the Curvature tool's - // Shift+~ arrives as `~`). - let shifted = m.shift.then(|| format!("Shift+{text}")); - let mut chords: Vec = - [Some(key), Some(text), shifted].into_iter().flatten().filter_map(|t| crate::keymap::vc_chord(&t)).collect(); - // A character no chord names (`"`, which the backtick key types on Turkish Q) is read as - // the key that typed it, as the Keyboard Shortcuts editor records that press. - if chords.is_empty() { - let typed_by = pressed.and_then(|k| crate::shortcut_editor::chord_from_event(k, Modifiers { shift: m.shift, ..Modifiers::NONE })); - chords.extend(typed_by.and_then(|t| crate::keymap::vc_chord(&t))); + let chords = text_chords(&text, m, pressed); + if run_single_key(app, ctx, &chords, pressed, repeat) { + break; } - let hits: Vec = chords.iter().filter_map(|c| crate::keymap::lookup(&keymap.keymap, c)).collect(); - // Single-key command shortcuts (X, Shift+X, D, /, Shift+D, F, Shift+F by default) before - // tools. - let Some(hit) = hits.iter().find(|c| !c.id.starts_with("tool:")).or(hits.first()) else { continue }; - // A command runs as it does on a chord ([`run_hit`]): what its menu item runs. Smooth opens - // its slider, and Move opens its dialog. - match hit.id.strip_prefix("tool:") { - Some(tool) => held_tool::choose(app, ctx, tool, pressed, repeat), - None => { - run_hit(app, ctx, hit); - if dialog_or_palette_open(app) { - if let Some(key) = pressed { - let id = opening_key_id(ctx); - ctx.data_mut(|m| m.insert_temp(id, key)); - } - break; - } + } +} + +/// The chords a single-key shortcut reads for `text`, typed with `m` by the key `pressed`. +fn text_chords(text: &str, m: Modifiers, pressed: Option) -> Vec { + let upper = text.to_uppercase(); + let key = if m.shift && text.chars().all(|c| c.is_alphabetic()) { format!("Shift+{upper}") } else { upper.clone() }; + // A shifted punctuation character can also be written with its Shift (the Curvature tool's + // Shift+~ arrives as `~`). + let shifted = m.shift.then(|| format!("Shift+{text}")); + let mut chords: Vec = + [Some(key), Some(text.to_string()), shifted].into_iter().flatten().filter_map(|t| crate::keymap::vc_chord(&t)).collect(); + // A character no chord names (`"`, which the backtick key types on Turkish Q) is read as + // the key that typed it, as the Keyboard Shortcuts editor records that press. + if chords.is_empty() { + let typed_by = pressed.and_then(|k| crate::shortcut_editor::chord_from_event(k, Modifiers { shift: m.shift, ..Modifiers::NONE })); + chords.extend(typed_by.and_then(|t| crate::keymap::vc_chord(&t))); + } + chords +} + +/// Runs the single-key shortcut of `chords`, typed by the key `pressed`. True when it opened a +/// dialog or the palette: the shortcuts after it in the frame do not run. +fn run_single_key(app: &mut VectorcraftApp, ctx: &egui::Context, chords: &[craft_keymap::Chord], pressed: Option, repeat: bool) -> bool { + let keymap = crate::shortcut_editor::current(); + let hits: Vec = chords.iter().filter_map(|c| crate::keymap::lookup(&keymap.keymap, c)).collect(); + // Single-key command shortcuts (X, Shift+X, D, /, Shift+D, F, Shift+F by default) before + // tools. + let Some(hit) = hits.iter().find(|c| !c.id.starts_with("tool:")).or(hits.first()) else { return false }; + // A command runs as it does on a chord ([`run_hit`]): what its menu item runs. Smooth opens + // its slider, and Move opens its dialog. + match hit.id.strip_prefix("tool:") { + Some(tool) => { + held_tool::choose(app, ctx, tool, pressed, repeat); + false + } + None => { + run_hit(app, ctx, hit); + if !dialog_or_palette_open(app) { + return false; } + if let Some(key) = pressed { + let id = opening_key_id(ctx); + ctx.data_mut(|m| m.insert_temp(id, key)); + } + true } } } @@ -1077,7 +1104,7 @@ fn run_hit(app: &mut VectorcraftApp, ctx: &egui::Context, c: &CommandRef) { } /// Keys that type a character: letters, digits and punctuation (not Space). -fn types_text(key: craft_keymap::Key) -> bool { +pub(crate) fn types_text(key: craft_keymap::Key) -> bool { key.name().chars().count() == 1 } diff --git a/crates/ui-egui/src/shortcuts/hold_keys.rs b/crates/ui-egui/src/shortcuts/hold_keys.rs new file mode 100644 index 0000000000..eb7c92ab04 --- /dev/null +++ b/crates/ui-egui/src/shortcuts/hold_keys.rs @@ -0,0 +1,321 @@ +//! Hold shortcuts (Edit › Keyboard Shortcuts, Hold Shortcuts on, the Hold column): a character key +//! with a hold shortcut waits when it goes down. Held for the Hold Shortcut Delay (`keyHoldDelay`), +//! it runs its hold shortcut once, and its repeats are ignored until it is let go. Let go sooner, it +//! runs what a press of the key runs without a hold shortcut, at the release. A key without a hold +//! shortcut runs on its press, as before, and so does every key while Hold Shortcuts is off. + +use super::{Key, Modifiers, VectorcraftApp}; +use vectorcraft_tools::ToolKey; + +/// A press of a key with a hold shortcut, waiting for its release or for the delay to pass. +pub(crate) struct Pending { + /// The entry the hold shortcut runs (`tool:`, a command id or `panel:`). + entry: String, + /// The chords the press names, first match first, for the tap. + chords: Vec, + /// The key as egui reported the press, before any rewrite of the dispatcher. + key: Key, + /// The key's position, when the press gave one. + physical: Option, + /// The modifiers held at the press. + mods: Modifiers, + /// When the key went down (`egui::InputState::time`). + since: f64, + /// The Hold Shortcut Delay read at the press: a later change does not move this wait. + delay: f64, + /// The viewport whose frame saw the press. Frames of other viewports leave the wait alone. + viewport: egui::ViewportId, +} + +/// A key whose repeats, and the text they type, are dropped until it is let go. +#[derive(Clone, Copy, PartialEq)] +struct Swallowed { + key: Key, + physical: Option, + viewport: egui::ViewportId, +} + +/// The hold shortcut state of the app: at most one waiting press, and the keys held down after +/// their wait ended. +#[derive(Default)] +pub(crate) struct HoldKeys { + pending: Option, + swallowed: Vec, +} + +/// Is `e` the release of the key `key` at `physical`? The position decides when both events give +/// one; otherwise the key decides. +fn releases(e: &egui::Event, key: Key, physical: Option) -> bool { + matches!(e, egui::Event::Key { key: k, physical_key: p, pressed: false, .. } if same_key(*k, *p, key, physical)) +} + +fn same_key(k: Key, p: Option, key: Key, physical: Option) -> bool { + match (p, physical) { + (Some(p), Some(q)) => p == q, + _ => k == key || Some(k) == physical, + } +} + +/// Is the key still down? egui keeps the keys down by the key it reported for the press. +fn is_down(i: &egui::InputState, key: Key, physical: Option) -> bool { + i.key_down(key) || physical.is_some_and(|p| i.key_down(p)) +} + +/// What stops a wait: anything that takes the keyboard from the canvas. +fn blocked(app: &VectorcraftApp, ctx: &egui::Context) -> bool { + crate::scrub::phase(ctx) != crate::scrub::Phase::Idle + || crate::updates_ui::blocks_input(app) + || app.ui.dialog.is_some() + || app.ui.palette_open + || app.ui.screen_mode == 3 + || ctx.egui_wants_keyboard_input() + || app.session.tool_wants_text() + || app.session.tool_composing() + || app.session.tool_busy() + // An input method composing on the canvas with any tool. + || ctx.input(|i| i.events.iter().any(|e| matches!(e, egui::Event::Ime(egui::ImeEvent::Preedit { text, .. }) if !text.is_empty()))) +} + +/// Every frame, before anything can return: drops the repeats of the keys held after their wait +/// ended or while it waits, and the text they type, also on frames that run no shortcut. Ends the +/// wait without running anything when the window lost the keyboard, or when a field, a dialog, +/// Presentation Mode, a numeric scrub, an IME composition or a busy tool has it. +pub(super) fn guard(app: &mut VectorcraftApp, ctx: &egui::Context, focused: bool) { + let viewport = ctx.viewport_id(); + if !focused { + // egui lets go of every key when the window loses the keyboard. + if app.hold_keys.pending.as_ref().is_some_and(|p| p.viewport == viewport) { + app.hold_keys.pending = None; + } + app.hold_keys.swallowed.retain(|s| s.viewport != viewport); + return; + } + if app.hold_keys.pending.as_ref().is_some_and(|p| p.viewport == viewport) && (blocked(app, ctx) || !app.session.prefs.hold_shortcuts) { + cancel(app, ctx); + } + let mut held: Vec<(Key, Option)> = app.hold_keys.swallowed.iter().filter(|s| s.viewport == viewport).map(|s| (s.key, s.physical)).collect(); + held.extend(app.hold_keys.pending.as_ref().filter(|p| p.viewport == viewport).map(|p| (p.key, p.physical))); + if held.is_empty() { + return; + } + drop_repeats(ctx, &held); + // A key let go, or pressed anew, is no longer held back after this frame: a repeat that came + // in the same frame as its release was dropped above. + ctx.input(|i| { + app.hold_keys.swallowed.retain(|s| { + s.viewport != viewport + || is_down(i, s.key, s.physical) + && !i.events.iter().any(|e| { + releases(e, s.key, s.physical) + || matches!(e, egui::Event::Key { key, physical_key, pressed: true, repeat: false, .. } if same_key(*key, *physical_key, s.key, s.physical)) + }) + }); + }); +} + +/// Removes this frame's repeats of the keys `held`, and the text they type. +fn drop_repeats(ctx: &egui::Context, held: &[(Key, Option)]) { + let repeat = |e: Option<&egui::Event>| { + matches!(e, Some(egui::Event::Key { key, physical_key, pressed: true, repeat: true, .. }) + if held.iter().any(|(k, p)| same_key(*key, *physical_key, *k, *p))) + }; + ctx.input_mut(|i| { + let typed_by = super::typing_presses(&i.events); + let drop: Vec = i + .events + .iter() + .zip(typed_by) + .map(|(e, by)| repeat(Some(e)) || matches!(e, egui::Event::Text(_)) && repeat(by.and_then(|k| i.events.get(k)))) + .collect(); + let mut drop = drop.into_iter(); + i.events.retain(|_| !drop.next().unwrap_or(false)); + }); +} + +/// Ends the wait without running anything; the key's repeats stay held back until it is let go. +fn cancel(app: &mut VectorcraftApp, ctx: &egui::Context) { + let Some(p) = app.hold_keys.pending.take() else { return }; + if ctx.input(|i| is_down(i, p.key, p.physical)) { + app.hold_keys.swallowed.push(Swallowed { key: p.key, physical: p.physical, viewport: p.viewport }); + } +} + +/// Runs the result of the wait: the hold shortcut when `hold`, otherwise the tap. `down`: the key +/// is still down, so its repeats are held back until it is let go. True when the result opened a +/// dialog or the palette. +fn settle(app: &mut VectorcraftApp, ctx: &egui::Context, hold: bool, down: bool) -> bool { + let Some(p) = app.hold_keys.pending.take() else { return false }; + if down { + app.hold_keys.swallowed.push(Swallowed { key: p.key, physical: p.physical, viewport: p.viewport }); + } + if hold { + super::run_hit(app, ctx, &crate::keymap::command_of(&p.entry)); + } else { + // The key is already up, or another key went down: a tool it chooses is chosen for good. + super::run_single_key(app, ctx, &p.chords, None, false); + } + let opened = super::dialog_or_palette_open(app); + if opened && down { + // The key's repeats do not reach the dialog. + let id = super::opening_key_id(ctx); + ctx.data_mut(|m| m.insert_temp(id, p.key)); + } + opened +} + +/// The chords a press names for a hold shortcut, first match first: those of the text it typed, as +/// a single-key shortcut reads them, then the key itself with its Shift (Shift+1 typing `!`). A +/// letter names only the chord with its own Shift state: a hold on X does not catch Shift+X. +fn press_chords(text: &str, key: Key, m: Modifiers) -> Vec { + let mut chords = super::text_chords(text, m, Some(key)); + if !text.is_empty() && text.chars().all(char::is_alphabetic) { + chords.retain(|c| c.mods.shift == m.shift); + } + let shift = Modifiers { shift: m.shift, ..Modifiers::NONE }; + if let Some(c) = crate::shortcut_editor::chord_from_event(key, shift).and_then(|t| crate::keymap::vc_chord(&t)) + && !chords.contains(&c) + { + chords.push(c); + } + chords +} + +/// The chords a quick press runs, as the key runs without a hold shortcut: a shortcut on a shifted +/// punctuation key itself (Shift+.), which the shortcuts read from the key press, then those of +/// the text it typed. +fn tap_chords(text: &str, key: Key, m: Modifiers) -> Vec { + let shift = Modifiers { shift: m.shift, ..Modifiers::NONE }; + let pressed = crate::shortcut_editor::chord_from_event(key, shift) + .and_then(|t| crate::keymap::vc_chord(&t)) + .filter(|c| c.mods.shift && c.key.name().chars().all(|ch| !ch.is_alphanumeric())); + let mut chords: Vec = super::text_chords(text, m, Some(key)).into_iter().filter(|c| pressed.as_ref() != Some(c)).collect(); + if let Some(c) = pressed { + chords.insert(0, c); + } + chords +} + +/// Does the active tool take this key itself (a digit with the perspective grid showing, a bracket +/// with the Blob Brush, E with the Extend Path tool)? Then the key keeps doing that and does not +/// wait. +fn tool_takes(app: &mut VectorcraftApp, key: Key, text: &str) -> bool { + let view = app.view_info(); + let tool_key = match text { + "[" | "{" => Some(ToolKey::BracketLeft), + "]" | "}" => Some(ToolKey::BracketRight), + _ => super::digit_of(key).map(ToolKey::Digit).or_else(|| super::letter_of(key).map(ToolKey::Letter)), + }; + tool_key.is_some_and(|k| app.session.tool_claims_key(k, view)) +} + +/// Before the frame's shortcuts run: goes through the frame's events in order. A release of the +/// waiting key ends the wait (the hold when the delay has passed, otherwise the tap); a press of +/// another key, or a change of Cmd, Ctrl or Alt, ends it first, so the keys act in the order they +/// went down; and a new press of a key with a hold shortcut starts a wait, taking the press and +/// its text from the frame. Then a wait whose delay has passed with the key down runs the hold +/// shortcut. True when a result opened a dialog or the palette: the rest of the frame's keys are +/// dropped and no other shortcut runs. +pub(super) fn intake(app: &mut VectorcraftApp, ctx: &egui::Context) -> bool { + // Off (Keyboard Shortcuts › Hold Shortcuts), every key runs on its press. + if !app.session.prefs.hold_shortcuts || blocked(app, ctx) { + return false; + } + let viewport = ctx.viewport_id(); + let (events, now) = ctx.input(|i| (i.events.clone(), i.time)); + let typed_by = super::typing_presses(&events); + let text_of = |k: usize| typed_by.iter().position(|by| *by == Some(k)).and_then(|j| events.get(j).map(|e| (j, e))); + let mut taken: Vec = vec![]; + let mut stop_at = None; + for (j, e) in events.iter().enumerate() { + if let Some(p) = app.hold_keys.pending.as_ref().filter(|p| p.viewport == viewport) { + let overdue = now - p.since >= p.delay; + let ended = if releases(e, p.key, p.physical) { + Some((overdue, false)) + } else { + match e { + egui::Event::Key { key, physical_key, pressed: true, .. } + if !super::is_modifier(*key) && !same_key(*key, *physical_key, p.key, p.physical) => + { + Some((overdue, true)) + } + // A new press of the waiting key whose release was never seen. + egui::Event::Key { key, physical_key, pressed: true, repeat: false, .. } if same_key(*key, *physical_key, p.key, p.physical) => { + Some((false, false)) + } + egui::Event::ModifiersChanged(m) if (m.command, m.ctrl, m.alt) != (p.mods.command, p.mods.ctrl, p.mods.alt) => { + Some((false, true)) + } + _ => None, + } + }; + if let Some((hold, down)) = ended + && settle(app, ctx, hold, down) + { + stop_at = Some(j); + break; + } + } + let egui::Event::Key { key, physical_key, pressed: true, repeat: false, modifiers: m } = e else { continue }; + if m.command || m.ctrl || m.alt || m.mac_cmd || super::is_modifier(*key) { + continue; + } + // Only a press that typed a text waits: a text alone has no key to let go. + let Some((t, egui::Event::Text(text))) = text_of(j) else { continue }; + let typed = super::latin(text, *physical_key); + let Some(entry) = + press_chords(&typed, *key, *m).iter().find_map(|c| crate::shortcut_editor::hold_for(&app.ui.shortcut_holds, c)).map(str::to_string) + else { + continue; + }; + let chords = tap_chords(&typed, *key, *m); + if tool_takes(app, *key, text) { + continue; + } + taken.extend([j, t]); + // A wait left in another viewport ends without running: that window lost the keyboard to + // this one. Its key's repeats stay held back there until it is let go. + if let Some(old) = app.hold_keys.pending.take_if(|p| p.viewport != viewport) { + app.hold_keys.swallowed.push(Swallowed { key: old.key, physical: old.physical, viewport: old.viewport }); + } + let delay = app.session.prefs.key_hold_delay(); + app.hold_keys.pending = Some(Pending { entry, chords, key: *key, physical: *physical_key, mods: *m, since: now, delay, viewport }); + } + // Take the waiting presses and their texts, and after a result that opened a dialog, the key + // event that ended the wait and every later key event and text of the frame, with the text a + // press typed before it (the web build sends a press's text first): none of them reaches the + // dialog. + ctx.input_mut(|i| { + if i.events.len() != events.len() { + return; + } + let mut j = 0; + i.events.retain(|e| { + let k = j; + j += 1; + let later = stop_at.is_some_and(|s| { + k >= s && matches!(e, egui::Event::Key { .. } | egui::Event::Text(_)) + || matches!(e, egui::Event::Text(_)) && typed_by.get(k).copied().flatten().is_some_and(|by| by >= s) + }); + !(taken.contains(&k) || later) + }); + }); + if stop_at.is_some() { + return true; + } + let Some(p) = app.hold_keys.pending.as_ref().filter(|p| p.viewport == viewport) else { return false }; + let deadline = p.since + p.delay; + let down = ctx.input(|i| is_down(i, p.key, p.physical)); + if !down { + // Let go without a release this frame saw. + return settle(app, ctx, now >= deadline, false); + } + if now >= deadline { + return settle(app, ctx, true, true); + } + // egui draws only on input, and a held key need not repeat: draw again at the deadline. + ctx.request_repaint_after_secs((deadline - now) as f32); + false +} + +#[cfg(test)] +mod tests; diff --git a/crates/ui-egui/src/shortcuts/hold_keys/tests.rs b/crates/ui-egui/src/shortcuts/hold_keys/tests.rs new file mode 100644 index 0000000000..be7765f8f3 --- /dev/null +++ b/crates/ui-egui/src/shortcuts/hold_keys/tests.rs @@ -0,0 +1,517 @@ +use serde_json::json; + +use super::super::handle; +use super::*; + +/// A keyboard on one context, so egui keeps the keys held down from frame to frame and marks a +/// held key's later presses as repeats, with the frame times the test sets. +struct Keyboard { + ctx: egui::Context, +} + +impl Keyboard { + fn new() -> Self { + Self { ctx: egui::Context::default() } + } + + /// One frame at `time` seconds delivering `events`, with the window having the keyboard + /// (`focused`) or not. + fn frame_with_focus(&self, app: &mut VectorcraftApp, time: f64, events: Vec, focused: bool) { + let screen_rect = Some(egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(800.0, 600.0))); + let mut out = self.ctx.run_ui(egui::RawInput { events, screen_rect, time: Some(time), focused, ..Default::default() }, |ui| { + app.logic(ui.ctx()); + handle(app, ui.ctx()); + }); + out.textures_delta.clear(); + } + + fn frame(&self, app: &mut VectorcraftApp, time: f64, events: Vec) { + self.frame_with_focus(app, time, events, true); + } + + /// [`Self::frame`], giving the events the shortcuts left in the first pass for what is drawn + /// after them. + fn frame_left(&self, app: &mut VectorcraftApp, time: f64, events: Vec) -> Vec { + let screen_rect = Some(egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(800.0, 600.0))); + let mut left = None; + let mut out = self.ctx.run_ui(egui::RawInput { events, screen_rect, time: Some(time), focused: true, ..Default::default() }, |ui| { + app.logic(ui.ctx()); + handle(app, ui.ctx()); + if left.is_none() { + left = Some(ui.ctx().input(|i| i.events.clone())); + } + }); + out.textures_delta.clear(); + left.unwrap_or_default() + } + + /// `key` pressed (a repeat when it is already down) at `time`, typing `text`. + fn press(&self, app: &mut VectorcraftApp, time: f64, key: Key, text: &str) { + self.frame(app, time, press(key, text, Modifiers::NONE)); + } + + fn release(&self, app: &mut VectorcraftApp, time: f64, key: Key) { + self.frame(app, time, vec![release(key)]); + } +} + +fn press(key: Key, text: &str, modifiers: Modifiers) -> Vec { + vec![egui::Event::Key { key, physical_key: Some(key), pressed: true, repeat: false, modifiers }, egui::Event::Text(text.into())] +} + +fn release(key: Key) -> egui::Event { + egui::Event::Key { key, physical_key: Some(key), pressed: false, repeat: false, modifiers: Modifiers::NONE } +} + +/// A document with a selected rectangle filled red with a blue stroke, the Pen tool chosen, and +/// Hold Shortcuts `on`. +fn app_with(on: bool) -> VectorcraftApp { + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + crate::shortcut_editor::sync(&app.ui); + app.run("file.new", json!({"width": 400, "height": 300})).unwrap(); + app.run("shape.rectangle", json!({"x": 100, "y": 100, "width": 100, "height": 50})).unwrap(); + app.run("paint.setFill", json!({"color": "#ff0000"})).unwrap(); + app.run("paint.setStroke", json!({"color": "#0000ff"})).unwrap(); + app.run("prefs.set", json!({"key": "holdShortcuts", "value": on})).unwrap(); + app.select_tool("pen"); + app +} + +/// erolka's X: a quick press chooses the Eyedropper, and holding X swaps fill and stroke. +fn erolka_x(on: bool) -> VectorcraftApp { + let mut app = app_with(on); + app.run("shortcuts.set", json!({"id": "tool:eyedropper", "shortcut": "X", "force": true})).unwrap(); + app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "X"})).unwrap(); + app +} + +/// The fill of the selected object, as `#rrggbb`. +fn fill(app: &VectorcraftApp) -> String { + let d = app.session.active().unwrap(); + let id = *d.selection.objects.first().unwrap(); + d.doc.node(id).unwrap().appearance.fill_paint().color().unwrap().to_hex() +} + +fn selected(app: &VectorcraftApp) -> usize { + app.session.active().unwrap().selection.objects.len() +} + +/// A quick press of X runs its tap at the release, and holding X runs the hold once at the delay, +/// also with no repeats; the repeats until the release run nothing more. +#[test] +fn a_tap_runs_the_key_and_a_hold_runs_the_hold_shortcut() { + let mut app = erolka_x(true); + let keys = Keyboard::new(); + keys.press(&mut app, 0.0, Key::X, "x"); + assert_eq!(app.session.tool_id(), "pen", "the press waits"); + keys.release(&mut app, 0.1, Key::X); + assert_eq!(app.session.tool_id(), "eyedropper", "the quick press chooses the Eyedropper"); + assert_eq!(fill(&app), "#ff0000", "and swaps nothing"); + + app.select_tool("pen"); + keys.press(&mut app, 1.0, Key::X, "x"); + keys.frame(&mut app, 1.2, vec![]); + assert_eq!(fill(&app), "#ff0000", "before the delay nothing runs"); + keys.frame(&mut app, 1.35, vec![]); + assert_eq!(fill(&app), "#0000ff", "at the delay the hold swaps fill and stroke"); + assert_eq!(app.session.tool_id(), "pen", "and chooses no tool"); + for t in [1.5, 1.6, 1.7] { + keys.press(&mut app, t, Key::X, "x"); + } + keys.release(&mut app, 1.8, Key::X); + assert_eq!(fill(&app), "#0000ff", "the repeats and the release swap nothing more"); + assert_eq!(app.session.tool_id(), "pen"); +} + +/// The delay is the Hold Shortcut Delay read at the press. +#[test] +fn the_hold_waits_for_the_hold_shortcut_delay() { + let mut app = erolka_x(true); + app.run("prefs.set", json!({"key": "keyHoldDelay", "value": 0.8})).unwrap(); + let keys = Keyboard::new(); + keys.press(&mut app, 0.0, Key::X, "x"); + app.run("prefs.set", json!({"key": "keyHoldDelay", "value": 0.2})).unwrap(); + keys.frame(&mut app, 0.5, vec![]); + assert_eq!(fill(&app), "#ff0000", "a later change does not move the wait"); + keys.frame(&mut app, 0.8, vec![]); + assert_eq!(fill(&app), "#0000ff"); +} + +/// erolka's `.`: a quick press keeps the key's own command (Apply Last Gradient) and keeps the +/// selection, and holding it deselects. +#[test] +fn the_period_key_taps_its_own_command_and_holds_to_deselect() { + let mut app = app_with(true); + app.run("shortcuts.set", json!({"id": "select.none", "hold": "."})).unwrap(); + let keys = Keyboard::new(); + keys.press(&mut app, 0.0, Key::Period, "."); + keys.release(&mut app, 0.1, Key::Period); + assert_eq!(selected(&app), 1, "the quick press keeps the selection"); + let d = app.session.active().unwrap(); + let id = *d.selection.objects.first().unwrap(); + let appearance = &d.doc.node(id).unwrap().appearance; + let gradient = |p: vectorcraft_color::Paint| matches!(p, vectorcraft_color::Paint::Gradient(_)); + assert!(gradient(appearance.fill_paint()) || gradient(appearance.stroke_paint()), "and applies the last gradient"); + // Solid paint again, so a hold that also ran the tap would show. + app.run("paint.setFill", json!({"color": "#ff0000"})).unwrap(); + app.run("paint.setStroke", json!({"color": "#0000ff"})).unwrap(); + keys.press(&mut app, 1.0, Key::Period, "."); + keys.frame(&mut app, 1.4, vec![]); + assert_eq!(selected(&app), 0, "the hold deselects"); + keys.release(&mut app, 1.5, Key::Period); + let appearance = &app.session.active().unwrap().doc.node(id).unwrap().appearance; + assert!(!gradient(appearance.fill_paint()) && !gradient(appearance.stroke_paint()), "and applies no gradient"); +} + +/// A hold on a letter alone does not catch the letter with Shift: Shift+X, held, does with Hold +/// Shortcuts on what it does with them off, and does not wait. +#[test] +fn a_hold_on_a_letter_leaves_the_letter_with_shift_alone() { + let mut results = vec![]; + for on in [false, true] { + let mut app = erolka_x(on); + let keys = Keyboard::new(); + keys.frame(&mut app, 0.0, press(Key::X, "X", Modifiers::SHIFT)); + assert!(app.hold_keys.pending.is_none(), "Shift+X does not wait (on {on})"); + let pressed = (fill(&app), app.session.tool_id().to_string()); + keys.frame(&mut app, 1.0, vec![]); + keys.frame(&mut app, 1.1, vec![release(Key::X)]); + results.push((pressed, fill(&app), app.session.tool_id().to_string())); + } + assert_eq!(results[0], results[1], "holding Shift+X does not run X's hold"); +} + +/// A letter the active tool takes itself (E with the Extend Path tool) does not wait, also with a +/// hold shortcut on it. +#[test] +fn a_letter_the_tool_takes_does_not_wait() { + let mut app = app_with(true); + app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "E"})).unwrap(); + app.select_tool(vectorcraft_tools::addons::extend_path::ID); + assert_eq!(app.session.tool_id(), vectorcraft_tools::addons::extend_path::ID); + let keys = Keyboard::new(); + keys.press(&mut app, 0.0, Key::E, "e"); + assert!(app.hold_keys.pending.is_none(), "E stays the tool's"); + keys.frame(&mut app, 1.0, vec![]); + keys.release(&mut app, 1.1, Key::E); + assert_eq!(fill(&app), "#ff0000", "the hold does not run"); + assert_eq!(app.session.tool_id(), vectorcraft_tools::addons::extend_path::ID); +} + +/// An input method that starts composing while a key waits ends the wait without running anything. +#[test] +fn an_input_method_composition_ends_the_wait() { + let mut app = erolka_x(true); + let keys = Keyboard::new(); + keys.press(&mut app, 0.0, Key::X, "x"); + assert!(app.hold_keys.pending.is_some()); + keys.frame(&mut app, 0.1, vec![egui::Event::Ime(egui::ImeEvent::Preedit { text: "か".into(), active_range_chars: Some(1..1) })]); + assert!(app.hold_keys.pending.is_none(), "the composition ends the wait"); + keys.frame(&mut app, 1.0, vec![]); + keys.release(&mut app, 1.1, Key::X); + assert_eq!(app.session.tool_id(), "pen", "no tap ran"); + assert_eq!(fill(&app), "#ff0000", "and no hold"); +} + +/// A dialog opened, or Presentation Mode entered, while a key waits ends the wait without running +/// anything. +#[test] +fn a_dialog_or_presentation_mode_ends_the_wait() { + for what in ["dialog", "Presentation Mode"] { + let mut app = erolka_x(true); + let keys = Keyboard::new(); + keys.press(&mut app, 0.0, Key::X, "x"); + assert!(app.hold_keys.pending.is_some(), "{what}"); + if what == "dialog" { + app.ui.dialog = Some(crate::state::Dialog::new("preferences", json!({}))); + } else { + app.ui.screen_mode = 3; + } + keys.frame(&mut app, 0.1, vec![]); + assert!(app.hold_keys.pending.is_none(), "{what} ends the wait"); + app.ui.dialog = None; + app.ui.screen_mode = 0; + keys.frame(&mut app, 1.0, vec![]); + keys.release(&mut app, 1.1, Key::X); + assert_eq!(app.session.tool_id(), "pen", "{what}: no tap ran"); + assert_eq!(fill(&app), "#ff0000", "{what}: and no hold"); + } +} + +/// A new wait does not drop a wait left in another viewport unseen: that wait ends, and its key's +/// repeats stay held back in its viewport. +#[test] +fn a_wait_in_another_viewport_ends_when_a_new_one_starts() { + let mut app = erolka_x(true); + let other = egui::ViewportId::from_hash_of("another window"); + app.hold_keys.pending = Some(Pending { + entry: "paint.swap".into(), + chords: vec![], + key: Key::X, + physical: Some(Key::X), + mods: Modifiers::NONE, + since: 0.0, + delay: 0.35, + viewport: other, + }); + let keys = Keyboard::new(); + keys.press(&mut app, 0.1, Key::X, "x"); + assert!(app.hold_keys.pending.as_ref().is_some_and(|p| p.viewport == egui::ViewportId::ROOT), "the new press waits here"); + assert!(app.hold_keys.swallowed.iter().any(|s| s.viewport == other && s.key == Key::X), "the other window's key stays held back"); + assert_eq!(fill(&app), "#ff0000", "the other wait ran nothing"); +} + +/// With Hold Shortcuts off, a key with a hold shortcut runs on its press, as every key does, and +/// holding it runs nothing else. +#[test] +fn with_hold_shortcuts_off_every_key_runs_on_its_press() { + let mut app = erolka_x(false); + let keys = Keyboard::new(); + keys.press(&mut app, 0.0, Key::X, "x"); + assert_eq!(app.session.tool_id(), "eyedropper", "the press runs at once"); + keys.frame(&mut app, 1.0, vec![]); + keys.release(&mut app, 1.2, Key::X); + assert_eq!(fill(&app), "#ff0000", "the hold shortcut does not act"); + assert!(app.hold_keys.pending.is_none()); +} + +/// Turning Hold Shortcuts off while a key waits ends the wait without running anything. +#[test] +fn turning_hold_shortcuts_off_ends_the_wait() { + let mut app = erolka_x(true); + let keys = Keyboard::new(); + keys.press(&mut app, 0.0, Key::X, "x"); + assert!(app.hold_keys.pending.is_some()); + app.run("prefs.set", json!({"key": "holdShortcuts", "value": false})).unwrap(); + keys.frame(&mut app, 0.5, vec![]); + keys.release(&mut app, 0.6, Key::X); + assert!(app.hold_keys.pending.is_none()); + assert_eq!(fill(&app), "#ff0000", "no hold ran"); + assert_eq!(app.session.tool_id(), "pen", "and no tap"); +} + +/// A key without a hold shortcut runs in its press frame, and a waiting key pressed before it acts +/// first. +#[test] +fn another_key_ends_the_wait_and_runs_after_it() { + let mut app = erolka_x(true); + let keys = Keyboard::new(); + keys.press(&mut app, 0.0, Key::P, "p"); + assert_eq!(app.session.tool_id(), "pen", "P runs on its press"); + keys.release(&mut app, 0.05, Key::P); + keys.press(&mut app, 0.1, Key::X, "x"); + keys.press(&mut app, 0.2, Key::V, "v"); + assert_eq!(app.session.tool_id(), "selection", "X's tap (Eyedropper) ran, then V (Selection)"); + assert_eq!(fill(&app), "#ff0000"); + keys.release(&mut app, 0.3, Key::X); + assert_eq!(app.session.tool_id(), "selection", "the release of X runs nothing more"); +} + +/// Two keys pressed in one frame act in the order they went down. +#[test] +fn keys_in_one_frame_act_in_order() { + let mut app = erolka_x(true); + let keys = Keyboard::new(); + let mut events = press(Key::X, "x", Modifiers::NONE); + events.extend(press(Key::V, "v", Modifiers::NONE)); + keys.frame(&mut app, 0.0, events); + assert_eq!(app.session.tool_id(), "selection", "X's tap first, then V"); + let mut events = press(Key::V, "v", Modifiers::NONE); + events.extend(press(Key::X, "x", Modifiers::NONE)); + app.select_tool("pen"); + keys.frame(&mut app, 1.0, vec![release(Key::X), release(Key::V)]); + keys.frame(&mut app, 2.0, events); + keys.frame(&mut app, 2.1, vec![release(Key::X)]); + assert_eq!(app.session.tool_id(), "eyedropper", "V first, then X's tap at its release"); +} + +/// A press and its release in one frame are a tap, run in that frame. +#[test] +fn a_press_and_release_in_one_frame_is_a_tap() { + let mut app = erolka_x(true); + let keys = Keyboard::new(); + let mut events = press(Key::X, "x", Modifiers::NONE); + events.push(release(Key::X)); + keys.frame(&mut app, 0.0, events); + assert_eq!(app.session.tool_id(), "eyedropper"); + assert!(app.hold_keys.pending.is_none()); + keys.frame(&mut app, 5.0, vec![]); + assert_eq!(fill(&app), "#ff0000", "nothing waits after it"); +} + +/// Another key pressed after the delay has passed, before a frame ran the hold, runs the hold. +#[test] +fn an_overdue_wait_ended_by_another_key_runs_the_hold() { + let mut app = erolka_x(true); + let keys = Keyboard::new(); + keys.press(&mut app, 0.0, Key::X, "x"); + keys.press(&mut app, 0.5, Key::V, "v"); + assert_eq!(fill(&app), "#0000ff", "the hold ran"); + assert_eq!(app.session.tool_id(), "selection", "then V"); +} + +/// The window losing the keyboard ends the wait without running anything. +#[test] +fn losing_the_keyboard_ends_the_wait() { + let mut app = erolka_x(true); + let keys = Keyboard::new(); + keys.press(&mut app, 0.0, Key::X, "x"); + keys.frame_with_focus(&mut app, 0.1, vec![], false); + keys.frame(&mut app, 1.0, vec![]); + assert_eq!(app.session.tool_id(), "pen"); + assert_eq!(fill(&app), "#ff0000"); + assert!(app.hold_keys.pending.is_none()); +} + +/// Cmd, Ctrl or Alt pressed while a key waits ends the wait as a tap, before the chord runs. +#[test] +fn a_command_modifier_ends_the_wait_as_a_tap() { + let mut app = erolka_x(true); + let keys = Keyboard::new(); + keys.press(&mut app, 0.0, Key::X, "x"); + keys.frame(&mut app, 0.1, vec![egui::Event::ModifiersChanged(Modifiers::COMMAND)]); + assert_eq!(app.session.tool_id(), "eyedropper"); + keys.frame(&mut app, 1.0, vec![]); + assert_eq!(fill(&app), "#ff0000", "nothing waits after it"); +} + +/// A tool key with a hold shortcut runs the hold, and the tool is not chosen for the time the key +/// is held (`holdToolKeys`); a quick press chooses the tool for good. +#[test] +fn a_hold_shortcut_takes_a_tool_key_from_hold_tool_keys() { + let mut app = app_with(true); + assert!(app.session.prefs.hold_tool_keys); + app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "S"})).unwrap(); + let keys = Keyboard::new(); + keys.press(&mut app, 0.0, Key::S, "s"); + keys.frame(&mut app, 0.4, vec![]); + assert_eq!(fill(&app), "#0000ff", "the hold runs"); + assert_eq!(app.session.tool_id(), "pen", "Scale is not chosen while S is held"); + keys.release(&mut app, 1.0, Key::S); + assert_eq!(app.session.tool_id(), "pen"); + keys.press(&mut app, 2.0, Key::S, "s"); + keys.release(&mut app, 2.1, Key::S); + assert_eq!(app.session.tool_id(), "scale", "a quick press chooses Scale"); + keys.frame(&mut app, 3.0, vec![]); + assert_eq!(app.session.tool_id(), "scale", "for good"); + assert!(app.held_tool.is_empty()); +} + +/// A tool key without a hold shortcut still chooses its tool while held when another key has one. +#[test] +fn other_tool_keys_keep_hold_tool_keys() { + let mut app = erolka_x(true); + let keys = Keyboard::new(); + keys.press(&mut app, 0.0, Key::S, "s"); + assert_eq!(app.session.tool_id(), "scale"); + keys.frame(&mut app, 1.0, vec![]); + keys.release(&mut app, 1.1, Key::S); + assert_eq!(app.session.tool_id(), "pen", "the Pen comes back"); +} + +/// A hold on Shift and a digit recorded in the dialog (Shift+1) holds when the press types `!`. +#[test] +fn a_shifted_digit_holds_when_it_types_its_symbol() { + let mut app = app_with(true); + app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "Shift+1"})).unwrap(); + let keys = Keyboard::new(); + keys.frame(&mut app, 0.0, press(Key::Num1, "!", Modifiers::SHIFT)); + keys.frame(&mut app, 0.4, vec![]); + assert_eq!(fill(&app), "#0000ff"); +} + +/// A quick press of a shifted key with a hold shortcut runs what the key runs without one: a +/// shortcut on Shift+. (typing `>`) runs, and Shift+1 (typing `!`) runs what `!` runs. +#[test] +fn a_quick_press_of_a_shifted_key_runs_what_it_runs_without_a_hold() { + for (key, text, chord) in [(Key::Period, ">", "Shift+."), (Key::Num1, "!", "Shift+1")] { + let mut app = app_with(true); + app.run("shortcuts.set", json!({"id": "tool:eyedropper", "shortcut": chord, "force": true})).unwrap(); + let keys = Keyboard::new(); + keys.frame(&mut app, 0.0, press(key, text, Modifiers::SHIFT)); + keys.frame(&mut app, 0.05, vec![release(key)]); + let without = app.session.tool_id().to_string(); + app.select_tool("pen"); + app.run("shortcuts.set", json!({"id": "paint.swap", "hold": chord})).unwrap(); + keys.frame(&mut app, 1.0, press(key, text, Modifiers::SHIFT)); + assert_eq!(app.session.tool_id(), "pen", "{chord} waits"); + keys.frame(&mut app, 1.05, vec![release(key)]); + assert_eq!(app.session.tool_id(), without, "a quick press of {chord}"); + assert_eq!(fill(&app), "#ff0000"); + } +} + +/// The Shift+. shortcut runs on its press without a hold shortcut, and at the release of a quick +/// press with one. +#[test] +fn a_quick_press_of_shift_period_runs_its_shortcut() { + let mut app = app_with(true); + app.run("shortcuts.set", json!({"id": "tool:eyedropper", "shortcut": "Shift+.", "force": true})).unwrap(); + app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "Shift+."})).unwrap(); + let keys = Keyboard::new(); + keys.frame(&mut app, 0.0, press(Key::Period, ">", Modifiers::SHIFT)); + keys.frame(&mut app, 0.05, vec![release(Key::Period)]); + assert_eq!(app.session.tool_id(), "eyedropper"); +} + +/// A text with no key press that typed it does not wait: it has no key to let go. +#[test] +fn a_text_without_its_key_press_does_not_wait() { + let mut app = erolka_x(true); + let keys = Keyboard::new(); + keys.frame(&mut app, 0.0, vec![egui::Event::Text("x".into())]); + assert!(app.hold_keys.pending.is_none()); + assert_eq!(app.session.tool_id(), "eyedropper", "it runs as a single-key shortcut, as before"); +} + +/// A hold whose command opens a dialog holds back the key's repeats from it. +#[test] +fn a_hold_that_opens_a_dialog_keeps_the_repeats_from_it() { + let mut app = app_with(true); + app.run("shortcuts.set", json!({"id": "edit.preferences", "hold": "K"})).unwrap(); + let keys = Keyboard::new(); + keys.press(&mut app, 0.0, Key::K, "k"); + keys.frame(&mut app, 0.4, vec![]); + assert!(app.ui.dialog.is_some(), "the hold opened Preferences"); + let opening = keys.ctx.data(|m| m.get_temp::(super::super::opening_key_id(&keys.ctx))); + assert_eq!(opening, Some(Key::K), "K is the key that opened it"); + keys.press(&mut app, 0.5, Key::K, "k"); + assert!(app.hold_keys.swallowed.iter().any(|s| s.key == Key::K), "K's repeats are held back until it is let go"); + // A repeat in the same frame as the release is held back too. + let mut events = press(Key::K, "k", Modifiers::NONE); + events.push(release(Key::K)); + let left = keys.frame_left(&mut app, 0.6, events); + assert!(!left.iter().any(|e| matches!(e, egui::Event::Text(_) | egui::Event::Key { pressed: true, .. })), "{left:?}"); + assert!(app.hold_keys.swallowed.is_empty()); +} + +/// A key that ends a wait whose tap opens a dialog does not reach the dialog: Enter does not +/// confirm it. +#[test] +fn the_key_that_ends_a_wait_does_not_reach_the_dialog_it_opened() { + let mut app = app_with(true); + app.run("shortcuts.set", json!({"id": "edit.preferences", "shortcut": "K", "force": true})).unwrap(); + app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "K"})).unwrap(); + let keys = Keyboard::new(); + keys.press(&mut app, 0.0, Key::K, "k"); + let enter = egui::Event::Key { key: Key::Enter, physical_key: Some(Key::Enter), pressed: true, repeat: false, modifiers: Modifiers::NONE }; + let left = keys.frame_left(&mut app, 0.1, vec![enter]); + assert!(app.ui.dialog.is_some(), "the tap opened Preferences"); + assert!(!left.iter().any(|e| matches!(e, egui::Event::Key { key: Key::Enter, .. })), "{left:?}"); + assert_eq!(fill(&app), "#ff0000"); +} + +/// On the web build a press's text comes before it: the text of the key that ends such a wait +/// does not reach the dialog either. +#[test] +fn the_text_before_the_key_that_ends_a_wait_does_not_reach_the_dialog() { + let mut app = app_with(true); + app.run("shortcuts.set", json!({"id": "edit.preferences", "shortcut": "K", "force": true})).unwrap(); + app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "K"})).unwrap(); + let keys = Keyboard::new(); + keys.press(&mut app, 0.0, Key::K, "k"); + let m = egui::Event::Key { key: Key::M, physical_key: Some(Key::M), pressed: true, repeat: false, modifiers: Modifiers::NONE }; + let left = keys.frame_left(&mut app, 0.1, vec![egui::Event::Text("m".into()), m]); + assert!(app.ui.dialog.is_some(), "the tap opened Preferences"); + assert!(!left.iter().any(|e| matches!(e, egui::Event::Text(_) | egui::Event::Key { pressed: true, .. })), "{left:?}"); +} diff --git a/crates/ui-egui/src/state.rs b/crates/ui-egui/src/state.rs index 2fbe54d633..dc83db59bc 100644 --- a/crates/ui-egui/src/state.rs +++ b/crates/ui-egui/src/state.rs @@ -670,6 +670,12 @@ pub struct UiState { /// stored in the form every earlier version reads. #[serde(default, with = "crate::keymap::stored")] pub shortcut_overrides: craft_keymap::Overrides, + /// Hold shortcuts: command id, `tool:` or `panel:` → a character key, alone or with + /// Shift ("X", "Shift+X", "."). Holding the key for the Hold Shortcut Delay runs the entry; a + /// quick press runs the key's own shortcut when it is let go. Kept apart from + /// `shortcut_overrides`, so earlier versions read the settings without them. + #[serde(default, skip_serializing_if = "std::collections::BTreeMap::is_empty")] + pub shortcut_holds: std::collections::BTreeMap, /// Name of the shortcut set (preset or "Custom"). #[serde(default = "default_shortcut_set", deserialize_with = "crate::shortcut_editor::deserialize_set_name")] pub shortcut_set: String, @@ -1221,6 +1227,7 @@ impl Default for UiState { action_playback: Default::default(), action_playing: None, shortcut_overrides: Default::default(), + shortcut_holds: Default::default(), shortcut_set: default_shortcut_set(), workspace: default_workspace(), touch_workspace_restore: None, diff --git a/docs/mcp.md b/docs/mcp.md index e623b86cac..d67835d549 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -6330,6 +6330,33 @@ page describes saving the list from the Keyboard Shortcuts dialog as a text file {"name":"run_command","arguments":{"command":"shortcuts.exportText","params":{"path":"/Users/me/Shortcuts.txt"}}} ``` +A tool or command can also have a hold shortcut: a key that types a character (a letter, a digit or a punctuation +key), alone or with Shift. Space and the backtick key cannot be hold shortcuts, and neither can a key with Cmd, Ctrl or +Alt. Hold shortcuts act only while the preference `holdShortcuts` is on; it is off by default, and Edit › Keyboard +Shortcuts shows it as the Hold Shortcuts checkbox, with a ? button that explains it. While it is off, the dialog shows +no Hold column and every key runs on its press. While it is on, the dialog shows a Hold column and the Hold Shortcut +Delay (`keyHoldDelay`, 0.2 to 1.0 s, 0.35 s by default; VectorCraft's own values). Preferences › General › Options +lists both settings too, with Hold Shortcut Delay dimmed while Hold Shortcuts is off. A key with a hold shortcut then +waits when it goes down: held for the delay, it runs its hold shortcut once and its repeats are ignored until it is let +go; let go sooner, it runs what the key runs without a hold shortcut, at the release. Another key pressed while one +waits, or Cmd, Ctrl or Alt pressed then, ends the wait first, so keys act in the order they went down. The window losing +the keyboard, a dialog, a text field, Presentation Mode or an input method composition ends the wait and runs nothing. +Keys without a hold shortcut run on their press as before, and so does a letter with Shift when only the letter alone +has a hold shortcut, or a key the active tool uses itself (E with the Extend Path tool). + +`shortcuts.set {id, hold}` sets a hold shortcut, and `hold: ""` or `null` removes it; `hold` alone leaves the entry's +shortcut as it is, and a key that another entry already holds is refused unless `force` is true. Hold shortcuts are +kept apart from shortcuts: Use Default, Clear and `shortcut: null` leave them, and `overridden` in `shortcuts.list` is +about the shortcut only. `shortcuts.list` rows give the hold shortcut as `hold`, `shortcuts.conflicts` lists a key two +entries hold as `"Hold X"`, and Reset to Defaults and a preset remove every hold shortcut. `shortcuts.export` writes +them as a `holds` object (entry id to key) when there are any, and `shortcuts.import` reads it; a file without `holds` +has none, and a `holds` value that is not a usable hold shortcut fails the import, which then changes nothing. +`shortcuts.exportText` adds a third `Hold X` column to a row with a hold shortcut while `holdShortcuts` is on. + +```json +{"name":"run_command","arguments":{"command":"shortcuts.set","params":{"id":"paint.swap","hold":"X"}}} +``` + The desktop app adds its active artboard, the one the Artboards panel highlights, to the `object.align`, `object.distribute`, `object.distributeSpacing` and `select.allOnArtboard` calls it runs without `artboard`, as it does for `edit.pasteInPlace`, `edit.pasteInFront` and `edit.pasteInBack` (while the Artboard tool has several artboards @@ -6556,8 +6583,9 @@ interface and not the art: a zoom shows the art at the same size at every UI Sca preference `holdToolKeys` also needs the desktop app. It is on by default: a single-key tool shortcut held for 0.25 s or more, or held while its tool is used, chooses the tool until the key is let go and then returns to the tool active before, after any drag in progress; a quicker press chooses the tool for good. With it off, every press and every key -repeat chooses the tool. The canvas preference `boundingBoxWhileMovingAndDrawing` (off by default) also needs the -desktop app: on, with View › Show Bounding Box, the bounding box and its handles stay visible while a drag moves the +repeat chooses the tool. While `holdShortcuts` is on, a tool key that also has a hold shortcut runs the hold shortcut +when held, and a quick press chooses its tool for good. The canvas preference `boundingBoxWhileMovingAndDrawing` (off +by default) also needs the desktop app: on, with View › Show Bounding Box, the bounding box and its handles stay visible while a drag moves the selection, and the Rectangle, Rounded Rectangle, Ellipse, Polygon and Star tools draw the box around the shape being drawn; off, the box hides during both, except that a Selection tool move with `realTimeDrawing` off still moves the box. `highlightAlternateGlyphs` (off by default: on, the canvas paints a pink cell behind glyphs OpenType features diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 10d476361a..566c19f635 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1233,6 +1233,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur A Space+Shift drag rotates the view whatever the tool, as a Rotate View tool drag does, and Shift does not round the angle to 15°. While the Type tool edits text, Space types a space: held, it does not show the hand, pan or rotate the view, and Cmd+Space still zooms ([the help page](https://web.archive.org/web/20260726060015/https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html) lists the Spacebar as the Hand tool when not in text-edit mode). Test: `canvas::tests::space_types_a_space_while_editing_text_and_does_not_pan`. As VectorCraft's own rule, a zoom marquee that Cmd+Space starts while the Type tool edits text keeps the marquee's Space rules after Cmd is let go: Space held since the press sizes it, Space pressed again moves it ([the help page](https://helpx.adobe.com/illustrator/using/viewing-artwork.html) describes holding the spacebar to move the marquee), and that Space types no space, nor does it during an animated zoom drag. With no zoom drag, Space types a space. Test: `canvas::tests::space_moves_a_text_edit_zoom_marquee_after_cmd_is_let_go`. + - **Hold shortcuts:** Edit › Keyboard Shortcuts › Hold Shortcuts (off by default, `holdShortcuts`) shows a Hold column, where a tool or command gets a letter, digit or punctuation key, alone or with Shift. Holding that key for the Hold Shortcut Delay (`keyHoldDelay`, 0.35 s, 0.2 to 1.0 s) runs it once; a quicker press runs what the key runs without one, at the release (`shortcuts.set {id, hold}`). On a tool key, the hold shortcut takes precedence over Hold a Tool Shortcut to Use the Tool Temporarily. This is VectorCraft's own feature and its own delay. Tests `shortcuts::hold_keys::tests` and `shortcut_editor::tests::{a_hold_shortcut_is_kept_apart_from_the_shortcut, hold_shortcuts_refuse_keys_that_cannot_wait, the_hold_shortcuts_checkbox_shows_the_hold_column}`. - **Swatches panel clicks:** Ctrl/Cmd-clicking New Swatch makes a spot color, and Ctrl/Cmd+Shift-clicking it makes a global process color. - **Panel drag and drop:** art dragged off the canvas onto the Symbols panel becomes a symbol, art dragged onto the Swatches panel becomes a pattern swatch, and art dropped on the Brushes panel opens New Brush for that art; a symbol dragged onto the canvas places an instance where it is dropped, and a brush dragged onto a path is applied to it. New Brush asks for the type of brush first, as the [Brushes](https://web.archive.org/web/20241230205225/https://helpx.adobe.com/illustrator/using/brushes.html) page (archived copy) describes. The Brushes panel's New Brush button, its menu's New Brush… and art dropped on the panel open the New Brush dialog, where Scatter Brush, Art Brush and Pattern Brush need selected or dropped art. OK opens that type's Brush Options for the new brush, and their OK makes the brush with the name and options set; Cancel in either dialog adds no brush (`ui.newBrush`). The menu's New Calligraphic Brush, New Bristle Brush and New Art, Scatter and Pattern Brush from Selection items still make a brush at once. From c4af93eea906b21d8c1b7d2af93926425f0f2d63 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 12:17:00 -0800 Subject: [PATCH 011/102] MCP: the Tool Options entry in the UI catalog describes editing a selected flare The flare change updated the Tool Options description in crates/ui-egui/src/menus/ui_commands.rs but not its generated mirror, crates/mcp/src/ui_catalog.rs, so `cargo xtask ui-commands --check` stopped the gate. The mirror now carries the same text. --- crates/mcp/src/ui_catalog.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index ecbdf780fb..43824ba015 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -967,7 +967,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "tool.options", "Tool Options…", "", - "{tool: id} what double-clicking a tool button opens: hand → fits the artboard in the window (view.fitArtboard), zoom → 100% (view.actualSize), rotate|scale|reflect|shear → that Object › Transform dialog (dialog `rotate`, `scale`, `reflect` or `shear`; error `nothing selected` without a selection), selection|directSelection|groupSelection → the Move dialog (dialog `move`; the same error), gradient|magicWand → the Gradient or Magic Wand panel (window.panel), artboard → Artboard Options of the active artboard (dialog `artboardOptions`, fields index, name, x, y, width, height, showCenterMark, showCrossHairs; OK runs artboard.setProps, and with other artboards selected with the Artboard tool a new width or height goes to each of them too, in its `artboards` list, each resized about the reference point the form used for that size, or about its top-left corner when the size was set in the fields directly), flare → Flare Tool Options (dialog `flareOptions`, fields diameter and pathLength (pt), opacity, brightness, growth, fuzziness, longest, rayFuzziness, largest (%), rays, rings, direction (°), raysOn, ringsOn; OK runs tool.setOption {tool: \"flare\", values}: the next flare dragged out uses them, and a Flare click's dialog, which also has x, y and preview (on initially), previews one there and accepts it as one Undo step; Cancel rolls back the preview), lineSegment|arc|rectangularGrid|polarGrid → that tool's Tool Options, its click dialog without x and y (dialog kind = the tool id, `__toolOptions: true`; lineSegment: length (pt), angle (°), fillLine; arc: lengthX, lengthY (pt), reference (0–8), arcType: open|closed, baseAlong: x|y, slope (−100…100), fillArc; rectangularGrid: width, height (pt, the Default Size), reference (0–8), rows, columns, rowSkew, columnSkew (%), frame, fill; polarGrid: the same with concentric, radial, concentricSkew, radialSkew and compound for rows, columns, the skews and frame; OK runs tool.setOption {tool, values} and draws nothing: the next drag uses them (Fill Line, the arc's type, base, slope and fill, the grids' dividers, skews and switches) and a click's dialog opens at them), columnGraph|stackedColumnGraph|barGraph|stackedBarGraph|lineGraph|areaGraph|scatterGraph|pieGraph|radarGraph → Graph Type for the selected graph, or for the series picked in it with Group Selection (dialog `graphType`, fields the options graph.setType {} returns under their names, with legend, pieLegend, piePosition, pieSort, firstRowInFront, firstColumnInFront and filledLines held for every type; overrideValues and rightOverrideValues, Override Calculated Values of the left or only value axis and of the right one: while one is on OK sends axisMin, axisMax and ticks, or rightAxisMin, rightAxisMax and rightTicks, filled with the calculated values where the graph has none, and one turned off sends null, null and 0; __page: options|valueAxis|rightAxis|categoryAxis, the page shown, options when the type picked has no such page; OK runs graph.setType, and with nothing changed closes without a step of history; an overridden value axis whose maximum is not more than its minimum is an error and the dialog stays open; an error without a selected graph), typeOnPath|verticalTypeOnPath → Type on a Path Options for the selected type on a path (dialog `command` running type.pathOptions; error `nothing selected` without a selection, and the command's error when no type on a path is selected),symbolSprayer|symbolShifter|symbolScruncher|symbolSizer|symbolSpinner|symbolStainer|symbolScreener|symbolStyler → Symbolism Tools Options (dialog `symbolismOptions`, fields tool, diameter (pt), intensity and density (1–10), shared by the eight tools; OK runs tool.setOption {tool, values}), blend → Blend Options, perspectiveGrid → Perspective Grid Options, eyedropper → Eyedropper Options (dialog `eyedropperOptions`, fields sampleSize, pickUp, apply; OK runs eyedropper.setOptions), printTiling → resets the print tiling (print.tiling.set {reset: true}), warp|twirl|pucker|bloat|scallop|crystallize|wrinkle → that tool's Tool Options (dialog `liquifyOptions`, fields tool, width, height, angle, intensity %, usePressure, detail, simplify, simplifyOn, rate, complexity, horizontal %, vertical %, affectAnchors, affectIn, affectOut, showBrush; OK runs tool.setOption {tool, values}), pencil|paintbrush|smooth|blobBrush|eraser → that tool's Tool Options (dialog `freehandOptions`, fields tool and the options the tool keeps: fidelity (px for pencil, paintbrush and smooth, the same at any zoom; pt for blobBrush), fill, keepSelected (on for pencil and paintbrush, off for blobBrush), mergeOnlySelection (off), closeWithin and editWithin (px, 0 is off), livePreview (pencil, on: off draws a thin line while the stroke is drawn, and the path's fill and stroke on release), size (pt), angle (°, −180–180; 0) and roundness (%, 1–100; 100) of the eraser's tip; OK runs tool.setOption {tool, values}), livePaintSelection → Live Paint Selection Tool Options (dialog `livePaintSelectionOptions`, fields selectFills and selectStrokes (both on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the highlight's width, 1–20 px; 4); OK runs tool.setOption {tool: \"livePaintSelection\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), livePaintBucket → Live Paint Bucket Options (dialog `livePaintBucketOptions`, fields paintFills (on) and paintStrokes (off), cursorSwatchPreview (on: the active fill or stroke shows above the pointer between the color swatches before and after it; Left and Right without modifiers step it through the color swatches whether it is on or off), highlight (on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the face highlight's width, 1–20 px; 4; an edge's highlight is half as wide); OK runs tool.setOption {tool: \"livePaintBucket\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), shapeBuilder → Shape Builder Tool Options (dialog `shapeBuilderOptions`, fields gapDetection (off), gapLength (pt, 0–72; 3), openFilledAsClosed (on), clickStrokeSplitsPath (off), pickColorFrom: artwork|swatches (artwork), cursorSwatchPreview (off), selection: freeform|straightLine (freeform), highlightFill (on), highlightStroke (on), highlightColor (#rrggbb or a layer color's name; #ff4f4f); OK runs tool.setOption {tool: \"shapeBuilder\", values}; a highlightColor with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), objectsOnPath → Objects on Path Tool Options (dialog `objectsOnPathOptions`, fields pivot (0–8, row by row from the top left; 4, the center) and rotate (°, −360–360; 0); Reset puts 4 and 0 back; Save runs tool.setOption {tool: \"objectsOnPath\", values}: the objects attached next use them, groups attached before keep theirs)", + "{tool: id} what double-clicking a tool button opens: hand → fits the artboard in the window (view.fitArtboard), zoom → 100% (view.actualSize), rotate|scale|reflect|shear → that Object › Transform dialog (dialog `rotate`, `scale`, `reflect` or `shear`; error `nothing selected` without a selection), selection|directSelection|groupSelection → the Move dialog (dialog `move`; the same error), gradient|magicWand → the Gradient or Magic Wand panel (window.panel), artboard → Artboard Options of the active artboard (dialog `artboardOptions`, fields index, name, x, y, width, height, showCenterMark, showCrossHairs; OK runs artboard.setProps, and with other artboards selected with the Artboard tool a new width or height goes to each of them too, in its `artboards` list, each resized about the reference point the form used for that size, or about its top-left corner when the size was set in the fields directly), flare → Flare Tool Options (dialog `flareOptions`, fields diameter and pathLength (pt), opacity, brightness, growth, fuzziness, longest, rayFuzziness, largest (%), rays, rings, direction (°), raysOn, ringsOn; OK runs tool.setOption {tool: \"flare\", values}: the next flare dragged out uses them, and a Flare click's dialog, which also has x, y and preview (on initially), previews one there and accepts it as one Undo step; Cancel rolls back the preview; with flares selected, the fields show the first one's settings, `flares` lists them and OK runs shape.editFlare with the settings changed instead, leaving the tool's options), lineSegment|arc|rectangularGrid|polarGrid → that tool's Tool Options, its click dialog without x and y (dialog kind = the tool id, `__toolOptions: true`; lineSegment: length (pt), angle (°), fillLine; arc: lengthX, lengthY (pt), reference (0–8), arcType: open|closed, baseAlong: x|y, slope (−100…100), fillArc; rectangularGrid: width, height (pt, the Default Size), reference (0–8), rows, columns, rowSkew, columnSkew (%), frame, fill; polarGrid: the same with concentric, radial, concentricSkew, radialSkew and compound for rows, columns, the skews and frame; OK runs tool.setOption {tool, values} and draws nothing: the next drag uses them (Fill Line, the arc's type, base, slope and fill, the grids' dividers, skews and switches) and a click's dialog opens at them), columnGraph|stackedColumnGraph|barGraph|stackedBarGraph|lineGraph|areaGraph|scatterGraph|pieGraph|radarGraph → Graph Type for the selected graph, or for the series picked in it with Group Selection (dialog `graphType`, fields the options graph.setType {} returns under their names, with legend, pieLegend, piePosition, pieSort, firstRowInFront, firstColumnInFront and filledLines held for every type; overrideValues and rightOverrideValues, Override Calculated Values of the left or only value axis and of the right one: while one is on OK sends axisMin, axisMax and ticks, or rightAxisMin, rightAxisMax and rightTicks, filled with the calculated values where the graph has none, and one turned off sends null, null and 0; __page: options|valueAxis|rightAxis|categoryAxis, the page shown, options when the type picked has no such page; OK runs graph.setType, and with nothing changed closes without a step of history; an overridden value axis whose maximum is not more than its minimum is an error and the dialog stays open; an error without a selected graph), typeOnPath|verticalTypeOnPath → Type on a Path Options for the selected type on a path (dialog `command` running type.pathOptions; error `nothing selected` without a selection, and the command's error when no type on a path is selected),symbolSprayer|symbolShifter|symbolScruncher|symbolSizer|symbolSpinner|symbolStainer|symbolScreener|symbolStyler → Symbolism Tools Options (dialog `symbolismOptions`, fields tool, diameter (pt), intensity and density (1–10), shared by the eight tools; OK runs tool.setOption {tool, values}), blend → Blend Options, perspectiveGrid → Perspective Grid Options, eyedropper → Eyedropper Options (dialog `eyedropperOptions`, fields sampleSize, pickUp, apply; OK runs eyedropper.setOptions), printTiling → resets the print tiling (print.tiling.set {reset: true}), warp|twirl|pucker|bloat|scallop|crystallize|wrinkle → that tool's Tool Options (dialog `liquifyOptions`, fields tool, width, height, angle, intensity %, usePressure, detail, simplify, simplifyOn, rate, complexity, horizontal %, vertical %, affectAnchors, affectIn, affectOut, showBrush; OK runs tool.setOption {tool, values}), pencil|paintbrush|smooth|blobBrush|eraser → that tool's Tool Options (dialog `freehandOptions`, fields tool and the options the tool keeps: fidelity (px for pencil, paintbrush and smooth, the same at any zoom; pt for blobBrush), fill, keepSelected (on for pencil and paintbrush, off for blobBrush), mergeOnlySelection (off), closeWithin and editWithin (px, 0 is off), livePreview (pencil, on: off draws a thin line while the stroke is drawn, and the path's fill and stroke on release), size (pt), angle (°, −180–180; 0) and roundness (%, 1–100; 100) of the eraser's tip; OK runs tool.setOption {tool, values}), livePaintSelection → Live Paint Selection Tool Options (dialog `livePaintSelectionOptions`, fields selectFills and selectStrokes (both on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the highlight's width, 1–20 px; 4); OK runs tool.setOption {tool: \"livePaintSelection\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), livePaintBucket → Live Paint Bucket Options (dialog `livePaintBucketOptions`, fields paintFills (on) and paintStrokes (off), cursorSwatchPreview (on: the active fill or stroke shows above the pointer between the color swatches before and after it; Left and Right without modifiers step it through the color swatches whether it is on or off), highlight (on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the face highlight's width, 1–20 px; 4; an edge's highlight is half as wide); OK runs tool.setOption {tool: \"livePaintBucket\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), shapeBuilder → Shape Builder Tool Options (dialog `shapeBuilderOptions`, fields gapDetection (off), gapLength (pt, 0–72; 3), openFilledAsClosed (on), clickStrokeSplitsPath (off), pickColorFrom: artwork|swatches (artwork), cursorSwatchPreview (off), selection: freeform|straightLine (freeform), highlightFill (on), highlightStroke (on), highlightColor (#rrggbb or a layer color's name; #ff4f4f); OK runs tool.setOption {tool: \"shapeBuilder\", values}; a highlightColor with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), objectsOnPath → Objects on Path Tool Options (dialog `objectsOnPathOptions`, fields pivot (0–8, row by row from the top left; 4, the center) and rotate (°, −360–360; 0); Reset puts 4 and 0 back; Save runs tool.setOption {tool: \"objectsOnPath\", values}: the objects attached next use them, groups attached before keep theirs)", ), ( "ui.colorGuideOptions", From cf869562d1edb693cf7c719731ad5d5d81fe3e7e Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 14:20:17 -0800 Subject: [PATCH 012/102] Flare: a flare scaled far down, or with a narrow gradient, keeps its settings A flare whose transform had a determinant under 1e-12, for example one scaled to 0.00001%, lost its handles and shape.editFlare answered "select a flare", although the transform can be undone. The flare's parts are now compared with its settings for any finite transform that can be inverted. A part's gradient ellipse was compared as squared lengths, so at a small scale, or for a narrow gradient, an edited shape could fall within the tolerance and be redrawn over. The ellipse is now compared as the length of its longer half-axis, which a pixel-aligned part may move by up to a pixel, and its shape: the ratio of its axes and its orientation, which are compared without that allowance. --- crates/doc/src/flare.rs | 111 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 106 insertions(+), 5 deletions(-) diff --git a/crates/doc/src/flare.rs b/crates/doc/src/flare.rs index 024714b0ea..2a180fa7fc 100644 --- a/crates/doc/src/flare.rs +++ b/crates/doc/src/flare.rs @@ -127,8 +127,33 @@ fn ellipse(geom: &GradientGeom) -> [f64; 3] { [u.x * u.x + w.x * w.x, u.x * u.y + w.x * w.y, u.y * u.y + w.y * w.y] } +/// The ellipse `[xx, xy, yy]` ([`ellipse`]) as its size, the length of its longer half-axis, and +/// its shape: the ratio of its shorter axis to its longer one, then the cosine and sine of twice +/// the longer axis's angle, each times one minus that ratio (0 for a circle). Each number is a +/// length or a ratio of lengths, never a squared length that a tiny flare or a narrow gradient +/// makes smaller than the tolerance. +fn ellipse_size_and_shape(geom: &GradientGeom) -> (f64, [f64; 3]) { + let [xx, xy, yy] = ellipse(geom); + let half_diff = (xx - yy) / 2.0; + let d = half_diff.hypot(xy); + let longer = (xx + yy) / 2.0 + d; + if longer.is_nan() || longer <= 0.0 { + return (0.0, [0.0; 3]); + } + // The product of the half-axes is the area factor of the map from the unit circle, `u` across + // `w` as [`ellipse`] builds them: a sum of squares times the aspect, without the cancellation + // of `xx * yy - xy * xy` for a narrow ellipse. + let u = geom.end - geom.start; + let w = Vec2::new(-u.y, u.x) * geom.aspect; + let ratio = ((u.x * w.y - u.y * w.x).abs() / longer).min(1.0); + let (cos, sin) = if d > 0.0 { (half_diff / d, xy / d) } else { (0.0, 0.0) }; + (longer.sqrt(), [ratio, (1.0 - ratio) * cos, (1.0 - ratio) * sin]) +} + /// `n` as JSON without what depends on how its transforms were applied: its id, the angle of its -/// bounding box, and which axis of a gradient's ellipse its end point is on (the ellipse stays). +/// bounding box, and which axis of a gradient's ellipse its end point is on (the ellipse stays: its +/// size in the placement, and its shape beside the placement, out of reach of a pixel-aligned +/// part's snap allowance, which is a length). fn comparable(n: &Node) -> Value { fn strip(v: &mut Value) { match v { @@ -140,9 +165,11 @@ fn comparable(n: &Node) -> Value { && let Ok(g) = serde_json::from_value::(geom.clone()) && let Value::Object(geom) = geom { + let (size, shape) = ellipse_size_and_shape(&g); geom.remove("end"); geom.remove("aspect"); - geom.insert("ellipse".into(), serde_json::json!(ellipse(&g))); + geom.insert("ellipse".into(), serde_json::json!(size)); + m.insert("ellipseShape".into(), serde_json::json!(shape)); } m.values_mut().for_each(strip); } @@ -173,7 +200,12 @@ fn close(a: &Value, b: &Value, tol: f64, snap: f64, geometry: bool) -> bool { }, (Value::Array(x), Value::Array(y)) => x.len() == y.len() && x.iter().zip(y).all(|(x, y)| close(x, y, tol, snap, geometry)), (Value::Object(x), Value::Object(y)) => { - x.len() == y.len() && x.iter().all(|(k, v)| y.get(k).is_some_and(|w| close(v, w, tol, snap, geometry || k == "path" || k == "geom"))) + x.len() == y.len() + && x.iter().all(|(k, v)| { + // A gradient's shape is ratios: compared as closely as geometry, without the snap. + let snap = if k == "ellipseShape" { 0.0 } else { snap }; + y.get(k).is_some_and(|w| close(v, w, tol, snap, geometry || k == "path" || k == "geom" || k == "ellipseShape")) + }) } _ => a == b, } @@ -237,10 +269,11 @@ impl FlareSpec { } /// Whether `group`'s parts are still the ones these settings draw, in place: none was edited, - /// distorted, removed or added, and the transform can be undone. + /// distorted, removed or added, and the transform can be undone. The parts are compared where + /// they are in the document, at any scale. pub fn draws(&self, group: &Node) -> bool { let NodeKind::Group { children, .. } = &group.kind else { return false }; - if self.transform.determinant().abs() < 1e-12 || !self.transform.as_coeffs().iter().all(|c| c.is_finite()) { + if !self.transform.is_finite() || self.transform.determinant() == 0.0 || !self.transform.inverse().is_finite() { return false; } let expected = parts(&self.params); @@ -330,4 +363,72 @@ mod tests { assert!(!spec(&squashed).draws(&squashed), "gradient shape, aligned {aligned}"); } } + + /// An ellipse's size and shape are the same whichever axis its end point is on, and a narrow + /// gradient made narrower, or turned, changes its shape by more than [`GEOMETRY_TOL`]. + #[test] + fn an_ellipse_shape_tells_narrow_gradients_apart() { + let geom = |end: (f64, f64), aspect: f64| GradientGeom { start: Point::new(1.0, 2.0), end: Point::new(end.0, end.1), aspect, focal: None }; + let of = ellipse_size_and_shape; + let (size, shape) = of(&geom((11.0, 2.0), 0.5)); + // The same ellipse with its end point on the other axis. + let (size2, shape2) = of(&geom((1.0, 7.0), 2.0)); + assert!((size - size2).abs() < 1e-12 && shape.iter().zip(shape2).all(|(a, b)| (a - b).abs() < 1e-12), "{shape:?} {shape2:?}"); + // A very narrow ellipse, given both ways, keeps its shape to within the tolerance. + let (thin, thin2) = (of(&geom((11.0, 2.0), 1e-8)).1, of(&geom((1.0, 2.0 + 1e-7), 1e8)).1); + assert!(thin.iter().zip(thin2).all(|(a, b)| (a - b).abs() < GEOMETRY_TOL), "{thin:?} {thin2:?}"); + let narrow = of(&geom((11.0, 2.0), 1e-4)).1; + for other in [of(&geom((11.0, 2.0), 5e-5)).1, of(&geom((1.0, 12.0), 1e-4)).1] { + assert!(narrow.iter().zip(other).any(|(a, b)| (a - b).abs() > 1e3 * GEOMETRY_TOL), "{narrow:?} {other:?}"); + } + assert_eq!(of(&geom((1.0, 2.0), 1.0)), (0.0, [0.0; 3])); + } + + /// A flare scaled far down, in one direction or in all, anywhere on the canvas, still draws its + /// settings, and a part's gradient whose shape was edited is still told apart; a flattened flare + /// does not draw its settings. + #[test] + fn a_flare_scaled_far_down_still_draws_its_settings() { + let v = json!({ "cx": 50.0, "cy": 50.0, "x2": 250.0, "y2": 50.0, "rays": 5, "rings": 2, "seed": 9, "diameter": 40.0 }); + let flare_aligned = |xf: Affine, aligned: bool| { + let children = parts(&v).into_iter().enumerate().map(|(i, p)| std::sync::Arc::new(part_node(NodeId(10 + i as u64), p, xf, aligned))); + let mut g = Node::group(NodeId(1), children.collect()); + g.extras_mut().flare = Some(Box::new(FlareSpec { params: v.clone(), transform: xf })); + g + }; + let flare = |xf: Affine| flare_aligned(xf, false); + // The center's gradient placement, to edit. + let center_geom = |g: &mut Node, f: &dyn Fn(&mut GradientGeom)| { + let NodeKind::Group { children, .. } = &mut g.kind else { panic!("not a group") }; + if let Some(crate::AppearanceItem::Fill(fill)) = std::sync::Arc::make_mut(&mut children[2]).appearance.items.first_mut() + && let Paint::Gradient(gp) = &mut fill.paint + && let Some(geom) = &mut gp.geom + { + f(geom); + } else { + panic!("the center has no gradient fill"); + } + }; + let draws = |g: &Node| g.extras().flare.as_deref().is_some_and(|spec| spec.draws(g)); + assert!(draws(&flare(Affine::scale(1e-7))), "scaled to 0.00001%"); + assert!(draws(&flare(Affine::rotate(0.3) * Affine::scale_non_uniform(1.0, 1e-10))), "shrunk far on one axis"); + assert!(draws(&flare(Affine::translate((crate::MAX_COORD - 1000.0, 0.0)) * Affine::scale(0.5))), "near the edge of the canvas"); + assert!(draws(&flare(Affine::translate((1000.0, 0.0)) * Affine::scale(1e-5))), "scaled to 0.001% and moved away"); + assert!(!draws(&flare(Affine::scale_non_uniform(1.0, 0.0))), "flattened"); + // At that size a part whose gradient's shape was edited no longer draws the settings. + let mut squashed = flare(Affine::scale(1e-6)); + assert!(draws(&squashed), "scaled to 0.0001%"); + center_geom(&mut squashed, &|geom| geom.aspect *= 0.5); + assert!(!draws(&squashed), "gradient shape at 0.0001%"); + // A pixel-aligned part may sit up to a pixel off, but its gradient's shape may not change, + // even when the ellipse keeps its size. + let mut reshaped = flare_aligned(Affine::IDENTITY, true); + assert!(draws(&reshaped), "aligned"); + center_geom(&mut reshaped, &|geom| { + let a = geom.aspect; + geom.aspect = a * 0.5; + geom.end = geom.start + (geom.end - geom.start) * ((1.0 + a * a) / (1.0 + a * a / 4.0)).sqrt(); + }); + assert!(!draws(&reshaped), "gradient shape of the same size, aligned"); + } } From dfa2b5aac9f72a2ab4edc07cfeba39ce533a5c5d Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 16:10:42 -0800 Subject: [PATCH 013/102] i18n: Spanish rows for three literal-brace messages use doubled-brace keys The rows for the `scope`, quantifier and freeform-gradient messages had placeholders where the messages print braces as text, so each row also matched other text with the same start and end. They now use the doubled-brace keys the catalog scanner writes, next to the composite font rows that use the same form. --- crates/ui-egui/src/i18n/es.tsv | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 84ab97441e..8a9d775519 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -3765,6 +3765,9 @@ digits Malayalam Malayálam @msg `{_1}` is the name of an installed font `{_1}` es el nombre de una fuente instalada @msg `{_1}`: {_2} is set in `{font}`, a composite font `{_1}`: {_2} usa `{font}`, una fuente compuesta @msg give fonts: [{name, parts}…] indique fonts: [{name, parts}…] +@msg `scope` must be "document", {{artboards: [index, …]}} or {{layers: [id, …]}} `scope` debe ser "document", {{artboards: [index, …]}} o {{layers: [id, …]}} +@msg numbers out of order in {{}} quantifier números desordenados en el cuantificador {{}} +@msg the paint is not a freeform gradient (apply one with paint.editGradient {{kind: "freeform"}}) la pintura no es un degradado de forma libre (aplique uno con paint.editGradient {{kind: "freeform"}}) @msg path is empty path está vacío @msg fonts must be a list of composite fonts fonts debe ser una lista de fuentes compuestas @msg names must be strings names debe contener cadenas @@ -7790,7 +7793,6 @@ breakText Glyphs Glifos @msg `rows` must be lists of numbers or nulls, not {r} `rows` deben ser listas de números o valores null, no {r} @msg `scale` must be a number from 0.001 to 1000 `scale` debe ser un número entre 0.001 y 1000 @msg `scope.{key}` must be a non-empty array `scope.{key}` debe ser una lista que no esté vacía -@msg `scope` must be "document", {artboards} or {layers} `scope` debe ser "document", {artboards} o {layers} @msg `side` must be "left", "right", "top" or "bottom" `side` debe ser "left", "right", "top" o "bottom" @msg `side` places the artboard: leave out x, y, width and height `side` coloca la mesa de trabajo: omite x, y, width y height @msg `source` is the only path in series group `target` `source` es el único trazado del grupo de serie `target` @@ -7963,7 +7965,6 @@ breakText Glyphs Glifos @msg not a regular expression no es una expresión regular @msg not an action set: the text doesn't start with /version and a number no es un conjunto de acciones: el texto no empieza con /version y un número @msg nothing to repeat nada que repetir -@msg numbers out of order in {_1} quantifier números desordenados en el cuantificador {_1} @msg object {_1} needs a 3D effect el objeto {_1} necesita un efecto 3D @msg object {_1}: a hollow Extrude & Bevel has no caps: turn on Cap to map a graphic objeto {_1}: una Extrusión y biselado hueca no tiene extremos: activa Extremo para asignar un gráfico @msg object {_1}: with a depth of 0 the object has one face: map its graphics onto the front objeto {_1}: con una profundidad de 0 el objeto tiene una sola cara: asigna sus gráficos a la parte frontal @@ -8031,7 +8032,6 @@ breakText Glyphs Glifos @msg the guide is hidden or locked la guía está oculta o bloqueada @msg the library's file is outside the read roots el archivo de la biblioteca está fuera de las raíces de lectura @msg the method needs an XML value el método necesita un valor XML -@msg the paint is not a freeform gradient (apply one with paint.editGradient {kind}) la pintura no es un degradado de forma libre (aplica uno con paint.editGradient {kind}) @msg the parameters or body do not form one function los parámetros o el cuerpo no forman una sola función @msg the pasted SVG filter {name} draws differently from the document's filter of that name, and no free name fits it el filtro SVG pegado {name} dibuja de forma distinta al filtro del documento con ese nombre, y no hay ningún nombre libre para él @msg the pen table holds more than 255 pens la tabla de plumillas contiene más de 255 plumillas From 81faa1787db78bbe69e5fe5a548e63f75d62928b Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 15:47:53 -0800 Subject: [PATCH 014/102] PDF export: warn when art at the trim edge stops short of the bleed When a PDF page carries a bleed (a PDF/X preset, bleed.useDocument or an explicit bleed), the export now adds one warning that counts the objects that reach an artboard's trim edge (within 0.5 pt) on a side whose bleed is more than 0.5 pt but end before that side's bleed edge. Hidden objects, guides, unpainted paths and objects at 0% opacity are left out. Objects with brushed strokes or an opacity mask, area type, type on a path, and groups that hold one of them are not measured. Template layers, layers with an opacity mask, and layers that don't print unless includeNonPrinting is on are left out. Clip groups and clipping layers are measured by the art inside the clipping path's geometric bounds and by the fill and stroke the clipping path paints itself. Art and page boxes are written unchanged. When OK in File > Document Setup raises the bleed on a side, the status bar counts the objects that stop short of the new bleed on the sides OK raised. A page of the art's bounds does not warn, and neither does an Export for Screens PDF row when Include Bleed grows the artboards or the page holds assets, layers or a selection. .ai saves do not warn. The message has a row in every catalog; docs/mcp.md and the exportPdf params text describe the check. --- crates/engine/src/cmd/fileio/pdf.rs | 209 ++++++++++++++++- crates/engine/src/cmd/fileio/screens.rs | 8 +- crates/engine/src/cmd/fileio/tests_pdfx.rs | 220 ++++++++++++++++++ crates/engine/src/cmd/fileio/tests_screens.rs | 19 ++ crates/ui-egui/src/dialogs/document_setup.rs | 67 +++++- crates/ui-egui/src/i18n/bg.tsv | 1 + crates/ui-egui/src/i18n/bs.tsv | 1 + crates/ui-egui/src/i18n/ca.tsv | 1 + crates/ui-egui/src/i18n/cs.tsv | 1 + crates/ui-egui/src/i18n/da.tsv | 1 + crates/ui-egui/src/i18n/de.tsv | 1 + crates/ui-egui/src/i18n/el.tsv | 1 + crates/ui-egui/src/i18n/es.tsv | 1 + crates/ui-egui/src/i18n/fi.tsv | 1 + crates/ui-egui/src/i18n/fr.tsv | 1 + crates/ui-egui/src/i18n/gu.tsv | 1 + crates/ui-egui/src/i18n/hi.tsv | 1 + crates/ui-egui/src/i18n/hu.tsv | 1 + crates/ui-egui/src/i18n/id.tsv | 1 + crates/ui-egui/src/i18n/it.tsv | 1 + crates/ui-egui/src/i18n/ja.tsv | 1 + crates/ui-egui/src/i18n/ka.tsv | 1 + crates/ui-egui/src/i18n/ko.tsv | 1 + crates/ui-egui/src/i18n/nl.tsv | 1 + crates/ui-egui/src/i18n/pl.tsv | 1 + crates/ui-egui/src/i18n/pt-br.tsv | 1 + crates/ui-egui/src/i18n/ru.tsv | 1 + crates/ui-egui/src/i18n/sv.tsv | 1 + crates/ui-egui/src/i18n/tests.rs | 15 ++ crates/ui-egui/src/i18n/tr.tsv | 1 + crates/ui-egui/src/i18n/uk.tsv | 1 + crates/ui-egui/src/i18n/vi.tsv | 1 + crates/ui-egui/src/i18n/zh-hans.tsv | 1 + crates/ui-egui/src/i18n/zh-hant.tsv | 1 + docs/mcp.md | 14 ++ docs/target-app-parity.md | 1 + 36 files changed, 572 insertions(+), 9 deletions(-) diff --git a/crates/engine/src/cmd/fileio/pdf.rs b/crates/engine/src/cmd/fileio/pdf.rs index 78f40a0072..006c3ae898 100644 --- a/crates/engine/src/cmd/fileio/pdf.rs +++ b/crates/engine/src/cmd/fileio/pdf.rs @@ -69,7 +69,7 @@ pub(crate) const OPTIONS: &[FormatOption] = &[ name: "bleed", ty: "object", default: "null", - description: "{useDocument, top, bottom, left, right} in points: the page grows by the bleed (BleedBox) around its artboard (TrimBox); a PDF/X file with no bleed on a side where the document's bleed has one comes back with a warning", + description: "{useDocument, top, bottom, left, right} in points: the page grows by the bleed (BleedBox) around its artboard (TrimBox); a PDF/X file with no bleed on a side where the document's bleed has one comes back with a warning, and so do objects that reach the trim edge on a side with a bleed but stop short of the bleed edge", }, FormatOption { name: "output", @@ -128,7 +128,7 @@ pub fn specs() -> Vec { "Export PDF", [], None, - "{path?, preset?: \"VectorCraft Default\" (built-in or saved: pdf.preset.list), artboard? | artboards?: [i…] | range?: \"1-3, 5\" (1-based; default all, one page each), useArtboards?: true (false: one page, the bounds of the visible art the page draws (non-printing layers left out unless includeNonPrinting or createLayers keeps them), as document.export writes it; artboard, artboards and range are then ignored, Preserve Editing is left out (with a warning when it is on), and a document with no visible art is refused), standard?: none|pdfA2b|pdfX1a (CMYK, grey and spot colours only: colours and images converted to output.destination or the CMYK output intent, untagged; transparency flattened with flattenerPreset; PDF 1.3)|pdfX3 (colours ICC-tagged; transparency flattened; PDF 1.3)|pdfX4 (transparency and layers kept; colours ICC-tagged; PDF 1.6 at most) (PDF/X: a /GTS_PDFX output intent, by default the CMYK profile in effect, embedded; TrimBox, Trapped, GTS_PDFXVersion, title and dates; fonts embedded or outlined), compatibility?: 1.3 (no transparency: it is flattened with flattenerPreset, without the layers the file leaves out; images keep no see-through pixels)|1.4|1.5|1.6|1.7 (default)|2.0 (choosing a standard sets its version: 1.7 for pdfA2b, 1.6 for pdfX4, 1.3 for pdfX1a and pdfX3, which write 1.4 as 1.3 too; pdfA2b refuses 1.3; in pdfA2b files, and with longPagesInPoints: false, a page with a side longer than 14,400 pt keeps its size with a UserUnit from 1.6 on: 1.5 is then written as 1.6, with 1.5's encryption, and so is 1.4 in pdfA2b files, with a warning; PDF/X files and other 1.3 and 1.4 files write it in points, and 1.3 and 1.4 (pdfX1a and pdfX3 too) refuse a page past 32,767 pt whose size or art needs a real number past 32,767; a page whose short side is 3 pt or longer but would be under 3 units at that UserUnit gets a smaller one that keeps the short side at 3 units; a warning gives each such page's size), longPagesInPoints?: true (such a page is written at its size in points, without a UserUnit, at every version, and 1.5 stays 1.5, in files without a standard (PDF/A files keep the UserUnit); apps that keep to the limit cut it to 200 in; false: the UserUnit as above, with a warning that names this option), preserveEditing? (on in VectorCraft Default: the native document as an embedded file, which document.open restores; choosing a standard turns it off, a standard refuses it), thumbnails? (each page drawn as a /Thumb image, 106 px on its long side), fastWebView? (a linearised file: the first page shows while the rest downloads; it stays linearised when encrypted), viewAfterSaving? (the app opens the written file), createLayers? (each layer and sublayer but template layers as a PDF layer, an optional content group listed under its layer's: hidden layers off, non-printing ones /PrintState /OFF, locked ones locked; needs 1.5 or later; they reopen as layers; choosing pdfX1a or pdfX3 turns it off; they refuse it), includeNonPrinting? (keep layers whose Print option is off; left out by default unless createLayers), flattenerPreset?: \"\" (High Resolution) | high | medium | low | a saved preset (flattener.presets.list): what PDF 1.3 files flatten transparency with, flattener?: {object.flattenTransparency options over it}, compression?: {color?, gray?: {downsample: none|average|subsample|bicubic, ppi: 300, abovePpi: 450, compression: none|zip|jpeg|jpeg2000|auto, quality: minimum|low|medium|high|maximum}, mono?: {downsample, ppi: 1200, abovePpi: 1800, compression: none|ccittG3|ccittG4|zip|runLength} (black-and-white images), compressText?: true} (images above abovePpi are resampled to ppi; auto keeps JPEGs JPEG, the others lossless; JPEG needs opaque images; none, jpeg2000, CCITT and runLength are written as ZIP with a warning), marks?: {trim, registration, colorBars, pageInfo, kind: roman|japanese, weight: 0.25 (trim marks and targets), offset: 6 (pt from the artboard, at least the bleed)} (printer's marks in [Registration], every plate: trim marks, registration targets mid-side, CMYK/spot/black-tint colour bars on top, page information (title, artboard, date UTC) below), bleed?: {useDocument (the document's bleed, document.setup), top, bottom, left, right} (pt; art in the bleed is kept; a PDF/X file with no bleed on a side where the document's bleed has one comes back with a warning). Each page: TrimBox = artboard, BleedBox = artboard + bleed, MediaBox = that + the marks' room (art clipped to the BleedBox), output?: {conversion: none (default)|destination (every colour into the destination profile's model, CMYK or RGB, also colours of that model in another profile)|preserveNumbers (only colours of the other model and Lab; those in the destination's model keep their numbers) (grey stays grey; images are converted too, and with destination and an sRGB destination a gray or RGB image tagged with an ICC profile is converted from it and written untagged; with destination and a CMYK destination, or another RGB one images are converted to (not when colours are ICC-tagged), an RGB image tagged with one is converted from it through sRGB; with preserveNumbers (and pdfX1a) only untagged images keep their numbers: an RGB image tagged with one is converted from it to sRGB or through sRGB to the destination, and a gray one is converted from it in an sRGB destination; any other image whose colors are converted (a CMYK image, an RGB one going to a CMYK destination, or with destination to an RGB one other than sRGB) but whose pixels can't be decoded or written that way is left out with a warning; printer's marks are not), destination: profile name (edit.colorSettings lists them; default: the document's profile for its colour mode), profiles: none (device colours; images are written without the ICC profiles they carry, a JPEG without its ICC_PROFILE segments, but in PDF/A, pdfX3 and pdfX4)|all|destination|taggedSource (documents assigned a profile: edit.assignProfile)|default (not set, the default; \"default\" unsets a preset's value, null keeps it: device colours, and gray and RGB images keep the profiles they carry, but in pdfX1a) (ICC-based colours: CMYK with the destination or document CMYK profile, RGB as sRGB, grey with the sRGB tone curve; PDF/A, pdfX3 and pdfX4 always, whatever profiles says; a CMYK image that keeps its numbers carries the CMYK profile it embeds with all and taggedSource, and in PDF/A, pdfX3 and pdfX4 unless destination, never in pdfX1a), outputIntent: profile name (embedded as the catalog's /GTS_PDFX output intent; a name that isn't a profile is only named, which pdfX1a and pdfX3 allow only with a registry and pdfX4 refuses; pdfX1a needs a CMYK one), outputCondition, outputConditionId (default: outputIntent), registry, trapped (/Trapped /True; /False when an output intent is written)} (PDF/A files keep their own output intent), advanced?: {fontSubsetPercent: 100 (below 100 is accepted with a warning: fonts are always embedded as subsets), outlineText: false (type as real, selectable and searchable text in embedded subset fonts with a ToUnicode map; fonts whose licence forbids embedding, or allows only whole fonts, stay outlines with a warning; true: every glyph as an outline), overprint: preserve (overprinting fills and strokes set /OP /op true, /OPM 1; white ones knock out with document.setup discardWhiteOverprint)|discard (they knock out)}, security?: {openPassword, permissionsPassword, printing: none|low|high, changes: none|pages|forms|comments|any, copy, screenReader, plaintextMetadata}, acknowledgeLoss?: bool (write over the file the document was read from although reading it left things out), format?: \"pdf\"} → {path, bytes, warnings}; no path → {dataBase64, bytes, warnings}. The options apply over the preset (null keeps its value); options accepted but not applied yet come back as warnings; a standard with a PDF version it doesn't allow and a password with a standard are refused, and so is a PDF/X file that would still break its standard (transparency the flattener left, RGB in pdfX1a, a font not embedded) or a PDF 1.3 file with transparency left. document.export {format: pdf} takes the same options. A key PDF doesn't take, and an unknown key inside one of the option objects, are refused", + "{path?, preset?: \"VectorCraft Default\" (built-in or saved: pdf.preset.list), artboard? | artboards?: [i…] | range?: \"1-3, 5\" (1-based; default all, one page each), useArtboards?: true (false: one page, the bounds of the visible art the page draws (non-printing layers left out unless includeNonPrinting or createLayers keeps them), as document.export writes it; artboard, artboards and range are then ignored, Preserve Editing is left out (with a warning when it is on), and a document with no visible art is refused), standard?: none|pdfA2b|pdfX1a (CMYK, grey and spot colours only: colours and images converted to output.destination or the CMYK output intent, untagged; transparency flattened with flattenerPreset; PDF 1.3)|pdfX3 (colours ICC-tagged; transparency flattened; PDF 1.3)|pdfX4 (transparency and layers kept; colours ICC-tagged; PDF 1.6 at most) (PDF/X: a /GTS_PDFX output intent, by default the CMYK profile in effect, embedded; TrimBox, Trapped, GTS_PDFXVersion, title and dates; fonts embedded or outlined), compatibility?: 1.3 (no transparency: it is flattened with flattenerPreset, without the layers the file leaves out; images keep no see-through pixels)|1.4|1.5|1.6|1.7 (default)|2.0 (choosing a standard sets its version: 1.7 for pdfA2b, 1.6 for pdfX4, 1.3 for pdfX1a and pdfX3, which write 1.4 as 1.3 too; pdfA2b refuses 1.3; in pdfA2b files, and with longPagesInPoints: false, a page with a side longer than 14,400 pt keeps its size with a UserUnit from 1.6 on: 1.5 is then written as 1.6, with 1.5's encryption, and so is 1.4 in pdfA2b files, with a warning; PDF/X files and other 1.3 and 1.4 files write it in points, and 1.3 and 1.4 (pdfX1a and pdfX3 too) refuse a page past 32,767 pt whose size or art needs a real number past 32,767; a page whose short side is 3 pt or longer but would be under 3 units at that UserUnit gets a smaller one that keeps the short side at 3 units; a warning gives each such page's size), longPagesInPoints?: true (such a page is written at its size in points, without a UserUnit, at every version, and 1.5 stays 1.5, in files without a standard (PDF/A files keep the UserUnit); apps that keep to the limit cut it to 200 in; false: the UserUnit as above, with a warning that names this option), preserveEditing? (on in VectorCraft Default: the native document as an embedded file, which document.open restores; choosing a standard turns it off, a standard refuses it), thumbnails? (each page drawn as a /Thumb image, 106 px on its long side), fastWebView? (a linearised file: the first page shows while the rest downloads; it stays linearised when encrypted), viewAfterSaving? (the app opens the written file), createLayers? (each layer and sublayer but template layers as a PDF layer, an optional content group listed under its layer's: hidden layers off, non-printing ones /PrintState /OFF, locked ones locked; needs 1.5 or later; they reopen as layers; choosing pdfX1a or pdfX3 turns it off; they refuse it), includeNonPrinting? (keep layers whose Print option is off; left out by default unless createLayers), flattenerPreset?: \"\" (High Resolution) | high | medium | low | a saved preset (flattener.presets.list): what PDF 1.3 files flatten transparency with, flattener?: {object.flattenTransparency options over it}, compression?: {color?, gray?: {downsample: none|average|subsample|bicubic, ppi: 300, abovePpi: 450, compression: none|zip|jpeg|jpeg2000|auto, quality: minimum|low|medium|high|maximum}, mono?: {downsample, ppi: 1200, abovePpi: 1800, compression: none|ccittG3|ccittG4|zip|runLength} (black-and-white images), compressText?: true} (images above abovePpi are resampled to ppi; auto keeps JPEGs JPEG, the others lossless; JPEG needs opaque images; none, jpeg2000, CCITT and runLength are written as ZIP with a warning), marks?: {trim, registration, colorBars, pageInfo, kind: roman|japanese, weight: 0.25 (trim marks and targets), offset: 6 (pt from the artboard, at least the bleed)} (printer's marks in [Registration], every plate: trim marks, registration targets mid-side, CMYK/spot/black-tint colour bars on top, page information (title, artboard, date UTC) below), bleed?: {useDocument (the document's bleed, document.setup), top, bottom, left, right} (pt; art in the bleed is kept; a PDF/X file with no bleed on a side where the document's bleed has one comes back with a warning, and so does a count of the visible objects that reach the trim edge (within 0.5 pt) on a side with a bleed but end before the bleed edge; layers that don't print are left out unless includeNonPrinting, and art and boxes are written unchanged). Each page: TrimBox = artboard, BleedBox = artboard + bleed, MediaBox = that + the marks' room (art clipped to the BleedBox), output?: {conversion: none (default)|destination (every colour into the destination profile's model, CMYK or RGB, also colours of that model in another profile)|preserveNumbers (only colours of the other model and Lab; those in the destination's model keep their numbers) (grey stays grey; images are converted too, and with destination and an sRGB destination a gray or RGB image tagged with an ICC profile is converted from it and written untagged; with destination and a CMYK destination, or another RGB one images are converted to (not when colours are ICC-tagged), an RGB image tagged with one is converted from it through sRGB; with preserveNumbers (and pdfX1a) only untagged images keep their numbers: an RGB image tagged with one is converted from it to sRGB or through sRGB to the destination, and a gray one is converted from it in an sRGB destination; any other image whose colors are converted (a CMYK image, an RGB one going to a CMYK destination, or with destination to an RGB one other than sRGB) but whose pixels can't be decoded or written that way is left out with a warning; printer's marks are not), destination: profile name (edit.colorSettings lists them; default: the document's profile for its colour mode), profiles: none (device colours; images are written without the ICC profiles they carry, a JPEG without its ICC_PROFILE segments, but in PDF/A, pdfX3 and pdfX4)|all|destination|taggedSource (documents assigned a profile: edit.assignProfile)|default (not set, the default; \"default\" unsets a preset's value, null keeps it: device colours, and gray and RGB images keep the profiles they carry, but in pdfX1a) (ICC-based colours: CMYK with the destination or document CMYK profile, RGB as sRGB, grey with the sRGB tone curve; PDF/A, pdfX3 and pdfX4 always, whatever profiles says; a CMYK image that keeps its numbers carries the CMYK profile it embeds with all and taggedSource, and in PDF/A, pdfX3 and pdfX4 unless destination, never in pdfX1a), outputIntent: profile name (embedded as the catalog's /GTS_PDFX output intent; a name that isn't a profile is only named, which pdfX1a and pdfX3 allow only with a registry and pdfX4 refuses; pdfX1a needs a CMYK one), outputCondition, outputConditionId (default: outputIntent), registry, trapped (/Trapped /True; /False when an output intent is written)} (PDF/A files keep their own output intent), advanced?: {fontSubsetPercent: 100 (below 100 is accepted with a warning: fonts are always embedded as subsets), outlineText: false (type as real, selectable and searchable text in embedded subset fonts with a ToUnicode map; fonts whose licence forbids embedding, or allows only whole fonts, stay outlines with a warning; true: every glyph as an outline), overprint: preserve (overprinting fills and strokes set /OP /op true, /OPM 1; white ones knock out with document.setup discardWhiteOverprint)|discard (they knock out)}, security?: {openPassword, permissionsPassword, printing: none|low|high, changes: none|pages|forms|comments|any, copy, screenReader, plaintextMetadata}, acknowledgeLoss?: bool (write over the file the document was read from although reading it left things out), format?: \"pdf\"} → {path, bytes, warnings}; no path → {dataBase64, bytes, warnings}. The options apply over the preset (null keeps its value); options accepted but not applied yet come back as warnings; a standard with a PDF version it doesn't allow and a password with a standard are refused, and so is a PDF/X file that would still break its standard (transparency the flattener left, RGB in pdfX1a, a font not embedded) or a PDF 1.3 file with transparency left. document.export {format: pdf} takes the same options. A key PDF doesn't take, and an unknown key inside one of the option objects, are refused", has_doc, export_pdf ), @@ -295,6 +295,8 @@ pub(super) fn encode_art_page(cmd: &str, doc: &Document, p: &Value) -> Result Result, non_printing: bool) -> usize { + let bleed = bleed.map(|b| if b.is_finite() && b > EDGE_TOLERANCE { b } else { 0.0 }); + if bleed.iter().all(|b| *b == 0.0) { + return 0; + } + let trims: Vec = match artboards { + Some(picked) => picked.iter().filter_map(|&i| doc.artboards.get(i)).map(|a| a.rect).collect(), + None => doc.artboards.iter().map(|a| a.rect).collect(), + }; + let symbols = doc.symbol_boxes(); + let mut count = 0; + // Each object with the clipping path of the layers above it. + let mut stack: Vec<(&Node, Option)> = doc.layers.iter().map(|l| (&**l, None)).collect(); + while let Some((n, clip)) = stack.pop() { + if let NodeKind::Layer { template, printable, children, clip: clipping, .. } = &n.kind { + // An opacity mask decides what shows, so a masked layer's art is not measured. + if !n.visible || *template || !(*printable || non_printing) || n.opacity <= 0.0 || n.extras().mask.is_some() { + continue; + } + // A clipping layer's first child clips the others, and its fills and strokes are an + // object of their own. + let (inner, members) = if *clipping { + let Some(own) = clip_region(children, &symbols) else { continue }; + let inner = clip.map_or(own, |c| c.intersect(own)); + if let Some(first) = children.first() + && let Drawn::Bounds(b) = clip_paint_drawn(first, inner, &symbols) + { + let b = clip.map_or(b, |c| c.intersect(b)); + if b.area() > 0.0 && trims.iter().any(|t| stops_short(b, *t, bleed)) { + count += 1; + } + } + (Some(inner), children.get(1..).unwrap_or_default()) + } else { + (clip, &children[..]) + }; + stack.extend(members.iter().map(|c| (&**c, inner))); + continue; + } + let Drawn::Bounds(b) = drawn_bounds(n, &symbols) else { continue }; + let b = clip.map_or(b, |c| c.intersect(b)); + if b.area() > 0.0 && trims.iter().any(|t| stops_short(b, *t, bleed)) { + count += 1; + } + } + count +} + +/// What [`drawn_bounds`] finds an object draws. +enum Drawn { + /// Nothing: it is hidden, a guide, at 0% opacity, or a path that paints nothing. + Nothing, + /// Art within these bounds. + Bounds(vectorcraft_geom::Rect), + /// Art whose bounds aren't known, which is not measured: brush art paints past the visual + /// bounds by an amount they don't give, an opacity mask hides part of what they hold, and area + /// type and type on a path are bounded by their frame or path. + Unknown, +} + +/// Whether path or compound path `n` paints: one of its fills and strokes is visible, has a paint +/// and an opacity above 0 and, a stroke, a width above 0. Other objects count as painting. +fn paints(n: &Node) -> bool { + !matches!(n.kind, NodeKind::Path { .. } | NodeKind::Compound { .. }) + || n.appearance.items.iter().any(|i| { + i.visible() && i.opacity() > 0.0 && !i.paint().is_none() && !matches!(i, vectorcraft_doc::AppearanceItem::Stroke(s) if s.width <= 0.0) + }) +} + +/// What `n` draws on a page, by its visual bounds (strokes included): a group without a clipping +/// path by the members that draw, and a clip group by the part of them inside its clipping path +/// together with what the clipping path paints itself ([`clip_paint_drawn`]). +/// Hidden objects, guides, objects at 0% opacity and paths that paint nothing draw nothing. Art +/// with a brushed stroke that draws, in `n` or (outside groups) in the objects it holds, art with +/// an opacity mask, and area type and type on a path are [`Drawn::Unknown`]. +fn drawn_bounds(n: &Node, symbols: &vectorcraft_doc::SymbolBoxes) -> Drawn { + if !n.visible || n.is_guide() || n.opacity <= 0.0 || !paints(n) { + return Drawn::Nothing; + } + // An opacity mask decides what shows of the object, and the bounds of area type and type on a + // path are its frame or path, not its glyphs. + let frame_bounds = matches!(&n.kind, NodeKind::Text(t) if !matches!(t.kind, vectorcraft_doc::TextKind::Point)); + if vectorcraft_brush::reach(n) > 0.0 || n.extras().mask.is_some() || frame_bounds { + return Drawn::Unknown; + } + let members = |children: &[Arc]| { + let mut out = Some(None); + for c in children { + out = match (out, drawn_bounds(c, symbols)) { + (None, _) | (_, Drawn::Unknown) => None, + (Some(acc), Drawn::Bounds(b)) => Some(vectorcraft_geom::union_opt(acc, Some(b))), + (keep, Drawn::Nothing) => keep, + }; + } + out + }; + let measured = match &n.kind { + NodeKind::Group { clip: false, .. } => match members(n.editing_children()) { + Some(art) => art.and_then(|_| n.visual_of_members(std::iter::once(art))), + None => return Drawn::Unknown, + }, + NodeKind::Group { clip: true, children } => { + let Some(region) = clip_region(children, symbols) else { return Drawn::Nothing }; + let Some(art) = members(children.get(1..).unwrap_or_default()) else { return Drawn::Unknown }; + let art = art.map(|a| region.intersect(a)).filter(|b| b.area() > 0.0); + match children.first().map_or(Drawn::Nothing, |first| clip_paint_drawn(first, region, symbols)) { + Drawn::Unknown => return Drawn::Unknown, + Drawn::Bounds(b) => vectorcraft_geom::union_opt(art, Some(b)), + Drawn::Nothing => art, + } + } + _ if vectorcraft_brush::reach_within(n) > 0.0 => return Drawn::Unknown, + _ => n.visual_bounds_with(symbols), + }; + measured.map_or(Drawn::Nothing, Drawn::Bounds) +} + +/// The region the clipping path of a clip group or clipping layer with `children` clips to: its +/// geometric bounds, without its strokes. +fn clip_region(children: &[Arc], symbols: &vectorcraft_doc::SymbolBoxes) -> Option { + children.first()?.geometric_bounds_with(symbols) +} + +/// What clipping path `clip` paints itself ([`Node::clip_paint`]): its fills inside `region`, the +/// region it clips to, and its strokes over the clipped art, unclipped. +fn clip_paint_drawn(clip: &Node, region: vectorcraft_geom::Rect, symbols: &vectorcraft_doc::SymbolBoxes) -> Drawn { + let paint = clip.clip_paint(); + let mut out = None; + for (part, clipped) in [(paint.fill, true), (paint.stroke, false)] { + let Some(part) = part else { continue }; + match drawn_bounds(&part, symbols) { + Drawn::Unknown => return Drawn::Unknown, + Drawn::Nothing => {} + Drawn::Bounds(b) => { + let b = if clipped { region.intersect(b) } else { b }; + out = vectorcraft_geom::union_opt(out, Some(b).filter(|b| b.area() > 0.0)); + } + } + } + out.map_or(Drawn::Nothing, Drawn::Bounds) +} + +/// Whether bounds `b` reach the trim edge `t` (within [`EDGE_TOLERANCE`] on either side of it) on a +/// side where `bleed` (`[top, bottom, left, right]`) is above 0 and end before the bleed edge there. +/// Document space has y down. +fn stops_short(b: vectorcraft_geom::Rect, t: vectorcraft_geom::Rect, [top, bottom, left, right]: [f64; 4]) -> bool { + let tol = EDGE_TOLERANCE; + let across = b.x0 < t.x1 && b.x1 > t.x0; + let down = b.y0 < t.y1 && b.y1 > t.y0; + let reaches = |near: f64, far: f64, edge: f64| near <= edge + tol && far >= edge - tol; + (across && top > 0.0 && reaches(b.y0, b.y1, t.y0) && b.y0 > t.y0 - top + tol) + || (across && bottom > 0.0 && reaches(-b.y1, -b.y0, -t.y1) && b.y1 < t.y1 + bottom - tol) + || (down && left > 0.0 && reaches(b.x0, b.x1, t.x0) && b.x0 > t.x0 - left + tol) + || (down && right > 0.0 && reaches(-b.x1, -b.x0, -t.x1) && b.x1 < t.x1 + right - tol) +} + +/// The warning for `n` objects that [`short_of_bleed`] finds; `None` for none. +pub fn short_of_bleed_warning(n: usize) -> Option { + match n { + 0 => None, + 1 => Some(format!("1 object {SHORT_OF_BLEED_ONE}")), + _ => Some(format!("{n} objects {SHORT_OF_BLEED_OTHER}")), + } +} + +/// The end of [`short_of_bleed_warning`] for one object and for more. +const SHORT_OF_BLEED_ONE: &str = "reaches the trim edge but stops short of the bleed"; +const SHORT_OF_BLEED_OTHER: &str = "reach the trim edge but stop short of the bleed"; + +/// Whether `text` is a warning [`short_of_bleed_warning`] gives. +pub fn is_short_of_bleed(text: &str) -> bool { + text.ends_with(SHORT_OF_BLEED_ONE) || text.ends_with(SHORT_OF_BLEED_OTHER) +} + /// The end of the writer's warning for a page longer than 14,400 pt written with a `UserUnit` /// above 1. const SHOWN_SMALLER: &str = "so apps that ignore UserUnit show it that many times smaller"; @@ -338,7 +525,8 @@ pub(super) fn encode_at(cmd: &str, doc: &Document, p: &Value, modified: Option = placed.into_iter().map(Note::loss).collect(); - let (bytes, drawn) = encode_carrying_at(cmd, &full, p, modified, || Ok(vectorcraft_format::save(doc, false)), || Ok(None))?; + let native = || Ok(vectorcraft_format::save(doc, false)); + let (bytes, drawn) = encode_carrying_at(cmd, &full, p, modified, true, native, || Ok(None))?; notes.extend(drawn); if notes.iter().any(|n| n.text.ends_with(SHOWN_SMALLER)) && options(cmd, &full, p)?.settings.standard == Standard::None { for n in notes.iter_mut().filter(|n| n.text.ends_with(SHOWN_SMALLER)) { @@ -362,7 +550,8 @@ fn overflow_warning(cmd: &str, doc: &Document, p: &Value) -> Result Result>, private: impl FnOnce() -> Result)>>, ) -> Result<(Vec, Vec)> { - encode_carrying_at(cmd, doc, p, None, native, private) + encode_carrying_at(cmd, doc, p, None, false, native, private) } /// [`encode_carrying`] modified at `modified` (Unix seconds) when given, instead of the time of -/// writing. +/// writing, warning about art that stops short of the bleed when `bleed_check` is true. fn encode_carrying_at( cmd: &str, doc: &Document, p: &Value, modified: Option, + bleed_check: bool, native: impl FnOnce() -> Result>, private: impl FnOnce() -> Result)>>, ) -> Result<(Vec, Vec)> { let mut opts = options_at(cmd, doc, p, modified.or_else(vectorcraft_doc::metadata::output_time))?; + // Measured before the pages' background colors join the art. Only art that prints counts: + // createLayers writes non-printing layers with /PrintState /OFF, so they count only with + // includeNonPrinting, which writes them as printing art. + let set = &opts.settings; + let short = if bleed_check { short_of_bleed(doc, set.bleed_of(doc), opts.artboards.as_deref(), set.include_non_printing) } else { 0 }; // The pages' background colors, behind the art (the editing data keeps them as colors). let pages = opts.artboards.clone().unwrap_or_else(|| (0..doc.artboards.len()).collect()); let filled = super::export::with_artboard_fills(doc, p, pages).map_err(|e| bad(cmd, e))?; @@ -399,6 +594,8 @@ fn encode_carrying_at( if opts.settings.leaves_out_bleed(doc) { notes.push(Note::loss(BLEED_LEFT_OUT)); } + // Art that reaches the trim edge but leaves part of the page's bleed empty. + notes.extend(short_of_bleed_warning(short).map(Note::loss)); if opts.settings.preserve_editing { if opts.artboards.as_ref().is_none_or(|v| v.iter().copied().eq(0..doc.artboards.len())) { opts.native = Some(native()?); diff --git a/crates/engine/src/cmd/fileio/screens.rs b/crates/engine/src/cmd/fileio/screens.rs index 61e5fede2a..75aba76edf 100644 --- a/crates/engine/src/cmd/fileio/screens.rs +++ b/crates/engine/src/cmd/fileio/screens.rs @@ -1237,10 +1237,16 @@ fn encode_and_write(export: ScreenExport, writer: &mut dyn FnMut(&str, &[u8]) -> // Include Bleed: a grown artboard already holds the bleed. Assets, layers and a selection are // written on a page of their own bounds, which it doesn't grow. let bleed_on_page = o.include_bleed && o.assets.is_none() && o.layers.is_none() && o.selection.is_none(); + // A grown artboard's trim edge is the bleed edge, and a page of its art's bounds has every + // object at its edge: neither says whether art stops short of the bleed. + let artboard_page = o.assets.is_none() && o.layers.is_none() && o.selection.is_none(); let mut write = |doc: &Document, format: &str, options: &Value| -> Result> { + // Include Bleed grows the artboards only when the document has a bleed. + let trim_on_page = artboard_page && !(o.include_bleed && doc.setup.has_bleed()); // The steps are the files: an encoder's own steps (artboards, pages) are not reported. let (bytes, given) = vectorcraft_doc::cancel::quiet(|| encode_with_notes(doc, format, options))?; - for n in given.into_iter().filter(|n| !(bleed_on_page && n.text == super::pdf::BLEED_LEFT_OUT)) { + let shown = |n: &Note| !(bleed_on_page && n.text == super::pdf::BLEED_LEFT_OUT) && (trim_on_page || !super::pdf::is_short_of_bleed(&n.text)); + for n in given.into_iter().filter(shown) { add_note(&mut notes, n); } Ok(bytes) diff --git a/crates/engine/src/cmd/fileio/tests_pdfx.rs b/crates/engine/src/cmd/fileio/tests_pdfx.rs index 68df66bd93..608418b6e9 100644 --- a/crates/engine/src/cmd/fileio/tests_pdfx.rs +++ b/crates/engine/src/cmd/fileio/tests_pdfx.rs @@ -139,6 +139,226 @@ fn a_pdfx_file_that_leaves_out_the_document_bleed_warns() { assert!(!left_out(&warnings), "{warnings:?}"); } +/// A 200 × 100 pt document with no art, bleed `bleed` (pt). +fn bleed_session(bleed: Value) -> Session { + let mut s = Session::new(); + s.execute("file.new", &json!({"width": 200, "height": 100})).unwrap(); + s.execute("document.setup", &json!({ "bleed": bleed })).unwrap(); + s +} + +/// A rectangle from (x0, y0) to (x1, y1) without a stroke, on the current layer. +fn plain_rect(s: &mut Session, [x0, y0, x1, y1]: [f64; 4]) -> Value { + let id = s.execute("shape.rectangle", &json!({"x": x0, "y": y0, "width": x1 - x0, "height": y1 - y0})).unwrap()["id"].clone(); + s.execute("paint.setStroke", &json!({"ids": [id], "none": true})).unwrap(); + id +} + +/// The warnings of a PDF that carries the document's bleed that say art stops short of it. +fn short_of_bleed(s: &mut Session) -> Vec { + let (_, warnings) = pdf(s, json!({"bleed": {"useDocument": true}})); + warnings.into_iter().filter(|w| super::pdf::is_short_of_bleed(w)).collect() +} + +const MM: f64 = 72.0 / 25.4; + +/// A bleed raised from 2 mm to 5 mm leaves a background that filled the old bleed, and a band +/// placed against the trim edge, short of the new one: the export warns once, counting both. +#[test] +fn art_that_reaches_the_trim_edge_but_stops_short_of_the_bleed_warns() { + let mut s = bleed_session(json!(2.0 * MM)); + let (b, w, h) = (2.0 * MM, 200.0, 100.0); + plain_rect(&mut s, [-b, -b, w + b, h + b]); + plain_rect(&mut s, [0.0, 0.0, w, 20.0]); + // At 2 mm the background reaches the bleed; the band stops at the trim edge. + assert_eq!(short_of_bleed(&mut s), ["1 object reaches the trim edge but stops short of the bleed"]); + s.execute("document.setup", &json!({"bleed": 5.0 * MM})).unwrap(); + assert_eq!(short_of_bleed(&mut s), ["2 objects reach the trim edge but stop short of the bleed"]); + // The PDF/X presets carry the document's bleed. + let (_, warnings) = pdf(&mut s, json!({"preset": "PDF/X-4:2010"})); + assert!(warnings.iter().any(|w| super::pdf::is_short_of_bleed(w)), "{warnings:?}"); + // A PDF/X file with a bleed on the top alone leaves out the rest of the document's bleed, and + // the background and the band stop short at the top: the warning comes right after + // BLEED_LEFT_OUT. + let (_, warnings) = pdf(&mut s, json!({"standard": "pdfX4", "bleed": {"top": 9}})); + assert_eq!(warnings.first().map(String::as_str), Some(super::pdf::BLEED_LEFT_OUT), "{warnings:?}"); + assert_eq!(warnings.get(1).map(String::as_str), Some("2 objects reach the trim edge but stop short of the bleed"), "{warnings:?}"); + // A page without the bleed (the default preset) doesn't warn, and neither does a page of the art's bounds. + let (_, warnings) = pdf(&mut s, json!({})); + assert!(!warnings.iter().any(|w| super::pdf::is_short_of_bleed(w)), "{warnings:?}"); + let (_, warnings) = pdf(&mut s, json!({"bleed": {"useDocument": true}, "useArtboards": false})); + assert!(!warnings.iter().any(|w| super::pdf::is_short_of_bleed(w)), "{warnings:?}"); + // An explicit bleed counts too, and the Summary lists the warning. + let (_, warnings) = pdf(&mut s, json!({"bleed": {"top": 9, "bottom": 9, "left": 9, "right": 9}})); + assert!(warnings.iter().any(|w| super::pdf::is_short_of_bleed(w)), "{warnings:?}"); + let v = s.execute("document.pdfSettings", &json!({"bleed": {"useDocument": true}, "includeDocument": true})).unwrap(); + assert!(v["warnings"].as_array().unwrap().iter().any(|w| super::pdf::is_short_of_bleed(w.as_str().unwrap())), "{v}"); + // A group counts once, measured by its visible members: a hidden member that fills the bleed + // doesn't hide a visible one at the trim edge. + let mut s = bleed_session(json!(9)); + let fill = plain_rect(&mut s, [-9.0, -9.0, 209.0, 109.0]); + let band = plain_rect(&mut s, [0.0, 0.0, 200.0, 20.0]); + let side = plain_rect(&mut s, [0.0, 40.0, 20.0, 60.0]); + s.execute("object.group", &json!({"ids": [fill, band, side]})).unwrap(); + s.execute("object.hide", &json!({"ids": [fill]})).unwrap(); + assert_eq!(short_of_bleed(&mut s), ["1 object reaches the trim edge but stops short of the bleed"]); + // A clip group is measured by the art inside its clipping path, not by a clipping path that + // reaches the bleed edge. + let mut s = bleed_session(json!(9)); + let art = plain_rect(&mut s, [0.0, 0.0, 200.0, 20.0]); + let clip = plain_rect(&mut s, [-9.0, -9.0, 209.0, 109.0]); + s.execute("select.set", &json!({"ids": [art, clip]})).unwrap(); + s.execute("object.clippingMask.make", &json!({})).unwrap(); + assert_eq!(short_of_bleed(&mut s).len(), 1); + // A clipping path that paints a fill reaching the trim edge counts, though the art it clips is + // inside: in a clip group, and as an object of its own in a clipping layer. + let mut s = bleed_session(json!(9)); + let art = plain_rect(&mut s, [20.0, 30.0, 60.0, 60.0]); + let clip = plain_rect(&mut s, [0.0, 0.0, 200.0, 100.0]); + s.execute("select.set", &json!({"ids": [art, clip]})).unwrap(); + s.execute("object.clippingMask.make", &json!({})).unwrap(); + assert!(short_of_bleed(&mut s).is_empty()); + s.execute("paint.setFill", &json!({"ids": [clip], "color": "#ff0000"})).unwrap(); + assert_eq!(short_of_bleed(&mut s).len(), 1); + let mut s = bleed_session(json!(9)); + let clipping = s.execute("layer.new", &json!({})).unwrap()["id"].clone(); + plain_rect(&mut s, [20.0, 30.0, 60.0, 60.0]); + let clip = plain_rect(&mut s, [0.0, 0.0, 200.0, 100.0]); + s.execute("layer.clippingMask.toggle", &json!({"id": clipping})).unwrap(); + assert!(short_of_bleed(&mut s).is_empty()); + s.execute("paint.setFill", &json!({"ids": [clip], "color": "#ff0000"})).unwrap(); + assert_eq!(short_of_bleed(&mut s).len(), 1); + // A hidden brushed member doesn't keep a group's visible art at the trim edge from counting. + let mut s = bleed_session(json!(9)); + let brushed = plain_rect(&mut s, [-9.0, -9.0, 209.0, 109.0]); + s.execute("brush.apply", &json!({"ids": [brushed], "name": "Charcoal"})).unwrap(); + let band = plain_rect(&mut s, [0.0, 0.0, 200.0, 20.0]); + s.execute("object.group", &json!({"ids": [brushed, band]})).unwrap(); + s.execute("object.hide", &json!({"ids": [brushed]})).unwrap(); + assert_eq!(short_of_bleed(&mut s).len(), 1); + // A clipping layer clips its art to the clipping path's geometry, not to the stroke around it: + // the stroke reaches the trim edge, but the art it clips stops 5 pt inside. + let mut s = bleed_session(json!(9)); + let clipping = s.execute("layer.new", &json!({})).unwrap()["id"].clone(); + plain_rect(&mut s, [-9.0, -9.0, 209.0, 109.0]); + let clip = plain_rect(&mut s, [5.0, 5.0, 195.0, 95.0]); + s.execute("layer.clippingMask.toggle", &json!({"id": clipping})).unwrap(); + s.execute("paint.setStroke", &json!({"ids": [clip], "color": "#ff0000"})).unwrap(); + s.execute("stroke.set", &json!({"ids": [clip], "weight": 10})).unwrap(); + assert_eq!(short_of_bleed(&mut s), ["1 object reaches the trim edge but stops short of the bleed"]); +} + +/// No warning for art that already fills the bleed, art inside the trim, a document without a +/// bleed, art on hidden, non-printing or template layers, a side without a bleed, area type, a +/// masked object, or a `.ai` save. +#[test] +fn art_that_fills_the_bleed_or_stays_inside_does_not_warn() { + let mut s = bleed_session(json!(9)); + plain_rect(&mut s, [-9.0, -9.0, 209.0, 109.0]); + plain_rect(&mut s, [-20.0, 40.0, 50.0, 60.0]); + plain_rect(&mut s, [10.0, 10.0, 190.0, 90.0]); + assert!(short_of_bleed(&mut s).is_empty()); + // A document without a bleed has nothing to fall short of. + let mut s = bleed_session(json!(0)); + plain_rect(&mut s, [0.0, 0.0, 200.0, 20.0]); + assert!(short_of_bleed(&mut s).is_empty()); + // Layers that don't print. + for props in [json!({"visible": false}), json!({"printable": false}), json!({"template": true})] { + let mut s = bleed_session(json!(9)); + let layer = s.execute("layer.new", &json!({})).unwrap()["id"].clone(); + plain_rect(&mut s, [0.0, 0.0, 200.0, 20.0]); + let mut p = props.clone(); + p["id"] = layer; + s.execute("layer.setProps", &p).unwrap(); + assert!(short_of_bleed(&mut s).is_empty(), "{props}"); + } + // A hidden object, and a group whose hidden member is the one at the trim edge. + let mut s = bleed_session(json!(9)); + let id = plain_rect(&mut s, [0.0, 0.0, 200.0, 20.0]); + s.execute("object.hide", &json!({"ids": [id]})).unwrap(); + assert!(short_of_bleed(&mut s).is_empty()); + let mut s = bleed_session(json!(9)); + let edge = plain_rect(&mut s, [0.0, 0.0, 200.0, 20.0]); + let inside = plain_rect(&mut s, [10.0, 30.0, 50.0, 60.0]); + s.execute("object.group", &json!({"ids": [edge, inside]})).unwrap(); + s.execute("object.hide", &json!({"ids": [edge]})).unwrap(); + assert!(short_of_bleed(&mut s).is_empty()); + // Art that lies in the bleed alone, away from the trim edge. + let mut s = bleed_session(json!(9)); + plain_rect(&mut s, [20.0, -5.0, 60.0, -3.0]); + assert!(short_of_bleed(&mut s).is_empty()); + // A guide in a group at the trim edge. + let mut s = bleed_session(json!(9)); + let guide = plain_rect(&mut s, [0.0, 0.0, 200.0, 20.0]); + s.execute("view.guides.make", &json!({})).unwrap(); + let inside = plain_rect(&mut s, [10.0, 30.0, 50.0, 60.0]); + s.execute("object.group", &json!({"ids": [guide, inside]})).unwrap(); + assert!(short_of_bleed(&mut s).is_empty()); + // A brushed stroke, whose brush art can paint past its visual bounds, is not measured. + let mut s = bleed_session(json!(9)); + let id = plain_rect(&mut s, [0.0, 0.0, 200.0, 20.0]); + s.execute("brush.apply", &json!({"ids": [id], "name": "Charcoal"})).unwrap(); + assert!(short_of_bleed(&mut s).is_empty()); + // A path with no fill and no stroke paints nothing. + let mut s = bleed_session(json!(9)); + let id = plain_rect(&mut s, [0.0, 0.0, 200.0, 20.0]); + s.execute("paint.setFill", &json!({"ids": [id], "none": true})).unwrap(); + assert!(short_of_bleed(&mut s).is_empty()); + // An object at 0% opacity draws nothing. + let mut s = bleed_session(json!(9)); + let id = plain_rect(&mut s, [0.0, 0.0, 200.0, 20.0]); + s.execute("object.setProps", &json!({"ids": [id], "opacity": 0})).unwrap(); + assert!(short_of_bleed(&mut s).is_empty()); + // A clipping layer whose clipping path lies inside the trim draws none of its art at the edge. + let mut s = bleed_session(json!(9)); + let clipping = s.execute("layer.new", &json!({})).unwrap()["id"].clone(); + plain_rect(&mut s, [0.0, 0.0, 200.0, 20.0]); + plain_rect(&mut s, [10.0, 10.0, 60.0, 60.0]); + s.execute("layer.clippingMask.toggle", &json!({"id": clipping})).unwrap(); + assert!(short_of_bleed(&mut s).is_empty()); + // A bleed on the top alone: art short at the left doesn't count, art short at the top does. + let mut s = bleed_session(json!([9, 0, 0, 0])); + plain_rect(&mut s, [0.0, 30.0, 40.0, 60.0]); + assert!(short_of_bleed(&mut s).is_empty()); + plain_rect(&mut s, [60.0, 0.0, 100.0, 40.0]); + assert_eq!(short_of_bleed(&mut s).len(), 1); + // Area type is bounded by its frame, not its glyphs: a frame at the trim edge is not measured. + let mut s = bleed_session(json!(9)); + s.execute("text.create", &json!({"x": 0, "y": 0, "text": "Title", "size": 12, "area": {"width": 200, "height": 40}})).unwrap(); + assert!(short_of_bleed(&mut s).is_empty()); + // An opacity mask decides what shows of the object, so a masked object is not measured. + let mut s = bleed_session(json!(9)); + let band = plain_rect(&mut s, [0.0, 0.0, 200.0, 20.0]); + let mask = plain_rect(&mut s, [20.0, 30.0, 60.0, 60.0]); + s.execute("transparency.makeOpacityMask", &json!({"ids": [band, mask]})).unwrap(); + assert!(short_of_bleed(&mut s).is_empty()); + // A `.ai` save with a bleed doesn't warn: the check is PDF export's. + let mut s = bleed_session(json!(9)); + plain_rect(&mut s, [0.0, 0.0, 200.0, 20.0]); + assert_eq!(short_of_bleed(&mut s).len(), 1); + let r = s.execute("document.export", &json!({"format": "ai", "bleed": {"useDocument": true}})).unwrap(); + assert!(!r["warnings"].to_string().contains("short of the bleed"), "{}", r["warnings"]); +} + +/// The warning changes neither the art nor the page boxes. +#[test] +fn the_bleed_warning_changes_no_geometry_and_no_page_box() { + let mut s = bleed_session(json!(9)); + plain_rect(&mut s, [0.0, 0.0, 200.0, 20.0]); + let before = s.doc().unwrap().doc.clone(); + let v = s.execute("document.exportPdf", &json!({"bleed": {"useDocument": true}})).unwrap(); + assert!(v["warnings"].as_array().unwrap().iter().any(|w| super::pdf::is_short_of_bleed(w.as_str().unwrap())), "{v}"); + assert_eq!(s.doc().unwrap().doc, before); + let info = s.execute("document.pdfInfo", &json!({"name": "x.pdf", "dataBase64": v["dataBase64"]})).unwrap(); + let boxes = &info["pageInfo"][0]["boxes"]; + let side = |b: &Value| { + let n: Vec = b.as_array().unwrap().iter().map(|x| x.as_f64().unwrap()).collect(); + (((n[2] - n[0]) * 100.0).round() / 100.0, ((n[3] - n[1]) * 100.0).round() / 100.0) + }; + assert_eq!(side(&boxes["trim"]), (200.0, 100.0), "{info}"); + assert_eq!(side(&boxes["bleed"]), (218.0, 118.0), "{info}"); +} + /// The ink amounts (0..1) `doc` shows at `p` in its images (the topmost image there). fn image_inks_at(doc: &vectorcraft_doc::Document, p: vectorcraft_geom::Point) -> Option<[f32; 4]> { fn visit(n: &vectorcraft_doc::Node, out: &mut Vec) { diff --git a/crates/engine/src/cmd/fileio/tests_screens.rs b/crates/engine/src/cmd/fileio/tests_screens.rs index 1746be6c97..d950590241 100644 --- a/crates/engine/src/cmd/fileio/tests_screens.rs +++ b/crates/engine/src/cmd/fileio/tests_screens.rs @@ -569,6 +569,25 @@ fn include_bleed_pdfx_rows_do_not_warn_about_the_bleed() { assert!(warned(&export(&mut s, json!({"includeBleed": true, "selection": "one", "formats": row})))); } +/// A PDF row with the document's bleed warns about art that stops short of it on an artboard's +/// page, but not on a page Include Bleed grows or on a page of a selection's bounds. +#[test] +fn pdf_rows_warn_about_art_short_of_the_bleed_on_artboard_pages_only() { + let mut s = session(1); + s.execute("document.setup", &json!({"bleed": 6})).unwrap(); + // Against the artboard's top edge. + s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 40, "height": 10})).unwrap(); + let warned = |r: &Value| r["warnings"].as_array().unwrap().iter().any(|w| super::pdf::is_short_of_bleed(w.as_str().unwrap())); + let row = json!([{"format": "pdf", "bleed": {"useDocument": true}}]); + assert!(warned(&export(&mut s, json!({"formats": row})))); + assert!(!warned(&export(&mut s, json!({"includeBleed": true, "formats": row})))); + assert!(!warned(&export(&mut s, json!({"selection": "one", "formats": row})))); + // Without a document bleed, Include Bleed doesn't grow the artboard, so a row's own bleed warns. + s.execute("document.setup", &json!({"bleed": 0})).unwrap(); + let row = json!([{"format": "pdf", "bleed": {"top": 6, "bottom": 6, "left": 6, "right": 6}}]); + assert!(warned(&export(&mut s, json!({"includeBleed": true, "formats": row})))); +} + #[test] fn png_8_rows_write_indexed_colour() { let mut s = session(1); diff --git a/crates/ui-egui/src/dialogs/document_setup.rs b/crates/ui-egui/src/dialogs/document_setup.rs index 1946cc86b2..a56a619949 100644 --- a/crates/ui-egui/src/dialogs/document_setup.rs +++ b/crates/ui-egui/src/dialogs/document_setup.rs @@ -7,13 +7,16 @@ //! tab's `colorMode`, `convertColors`, `rgbProfile` and `cmykProfile` (null: the working space). //! OK runs `document.setup` with them: one undo step. When the Color tab changed something, OK runs //! `document.setup`, `edit.assignProfile` and `file.documentColorMode` in one `command.batch`, -//! and the document's changes are still one undo step. On an error the dialog stays open. +//! and the document's changes are still one undo step. On an error the dialog stays open. When OK +//! raises the bleed on a side, the status bar counts the objects that reach an artboard's trim edge +//! on a side OK raised but stop short of the new bleed there. use serde_json::{Map, Value, json}; use vectorcraft_color::cms::ProfileKind; -use vectorcraft_doc::setup::{GRID_COLOR_PRESETS, LANGUAGES}; +use vectorcraft_doc::setup::{GRID_COLOR_PRESETS, LANGUAGES, bleed_in_range}; use vectorcraft_doc::{ColorMode, GridSize, Quotes, Unit}; use vectorcraft_engine::cmd::colormgmt::doc_profiles; +use vectorcraft_engine::cmd::fileio::pdf; use super::{DialogSpec, form}; use crate::state::Dialog; @@ -102,6 +105,7 @@ fn color_commands(app: &VectorcraftApp, d: &Dialog) -> Result, String fn confirm(app: &mut VectorcraftApp, d: &Dialog) -> Result { let params: Map = d.fields.iter().filter(|(k, _)| !UI_ONLY.contains(&k.as_str())).map(|(k, v)| (k.clone(), v.clone())).collect(); let color = color_commands(app, d)?; + let before = app.session.active().map(|st| st.doc.setup.bleed); let r = if color.is_empty() { app.run("document.setup", Value::Object(params)) } else { @@ -110,10 +114,24 @@ fn confirm(app: &mut VectorcraftApp, d: &Dialog) -> Result { }; if r.is_ok() { app.ui.dialog = None; + if let Some(note) = before.and_then(|b| short_of_bleed_note(app, b)) { + app.status(note); + } } r } +/// The status note after OK raised the bleed on a side from `before`: how many objects reach an +/// artboard's trim edge on a side whose bleed grew but stop short of the new bleed there. `None` +/// when no side grew or no object stops short. +fn short_of_bleed_note(app: &VectorcraftApp, before: [f64; 4]) -> Option { + let doc = &app.session.active()?.doc; + // In the range the PDF pages keep the document's bleed to. + let (bleed, before) = (bleed_in_range(doc.setup.bleed), bleed_in_range(before)); + let raised: [f64; 4] = std::array::from_fn(|i| if bleed[i] > before[i] { bleed[i] } else { 0.0 }); + pdf::short_of_bleed_warning(pdf::short_of_bleed(doc, raised, None, false)) +} + fn body(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool { let tab = TABS.iter().position(|t| *t == d.str("tab")).unwrap_or(0); if let Some(i) = widgets::tab_bar(ui, &TABS, tab) { @@ -428,6 +446,51 @@ mod tests { assert!(app.ui.dialog.is_some()); } + /// OK with a larger bleed shows how many objects reach the trim edge but stop short of it; a + /// smaller bleed, or a larger one that no object falls short of, shows no such note. + #[test] + fn ok_with_a_larger_bleed_counts_the_art_short_of_it() { + let short = |app: &VectorcraftApp| app.ui.status.contains("short of the bleed"); + let ok_with_sides = |app: &mut VectorcraftApp, bleed: [f64; 4]| { + app.status(""); + app.run("file.documentSetup", json!({})).unwrap(); + app.ui.dialog.as_mut().unwrap().fields.insert("bleed".into(), json!(bleed)); + crate::dialogs::confirm(app).unwrap(); + }; + let ok_with_bleed = |app: &mut VectorcraftApp, bleed: f64| ok_with_sides(app, [bleed; 4]); + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.run("file.new", json!({"width": 200, "height": 200})).unwrap(); + // A background that fills a 4 pt bleed on the top, left and right. + let id = app.run("shape.rectangle", json!({"x": -4, "y": -4, "width": 208, "height": 50})).unwrap()["id"].clone(); + app.run("paint.setStroke", json!({"ids": [id], "none": true})).unwrap(); + ok_with_bleed(&mut app, 4.0); + assert!(!short(&app), "{}", app.ui.status); + ok_with_bleed(&mut app, 9.0); + assert_eq!(app.ui.status, "1 object reaches the trim edge but stops short of the bleed"); + ok_with_bleed(&mut app, 6.0); + assert!(!short(&app), "{}", app.ui.status); + // Only the sides whose bleed grows count: the background stops short at the top, left and + // right, so a larger bottom bleed alone shows no note, and a larger top bleed does. + ok_with_sides(&mut app, [6.0, 12.0, 6.0, 6.0]); + assert!(!short(&app), "{}", app.ui.status); + ok_with_sides(&mut app, [12.0, 12.0, 6.0, 6.0]); + assert!(short(&app), "{}", app.ui.status); + // Art inside the trim falls short of no bleed. + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.run("file.new", json!({"width": 200, "height": 200})).unwrap(); + app.run("shape.rectangle", json!({"x": 10, "y": 10, "width": 50, "height": 50})).unwrap(); + ok_with_bleed(&mut app, 9.0); + assert!(!short(&app), "{}", app.ui.status); + assert_eq!(app.session.active().unwrap().doc.setup.bleed, [9.0; 4]); + // A bleed that isn't a number, as a file can hold, counts as none before OK, as in the PDF. + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.run("file.new", json!({"width": 200, "height": 200})).unwrap(); + app.run("shape.rectangle", json!({"x": 0, "y": 0, "width": 200, "height": 50})).unwrap(); + std::sync::Arc::make_mut(&mut app.session.doc_mut().unwrap().doc).setup.bleed = [f64::NAN; 4]; + ok_with_bleed(&mut app, 9.0); + assert_eq!(app.ui.status, "1 object reaches the trim edge but stops short of the bleed"); + } + /// Highlight Substituted Fonts is in Preferences › Type, so the General tab shows only the /// substituted glyphs highlight, and OK still applies. #[test] diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index c18df53992..c955ce8354 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -4902,6 +4902,7 @@ axis Both И двете @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} свързано изображение е променено на диска: „Обновяване на връзките“ показва новата версия|{n} свързани изображения са променени на диска: „Обновяване на връзките“ показва новите версии @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk Обновен е {n} свързан файл, променен на диска|Обновени са {n} свързани файла, променени на диска @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings документът задава изтичане, което този PDF/X файл пропуска: включете „Използване на настройките за изтичане на документа“ +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} обект достига ръба на обрязване, но не стига до изтичането|{n} обекта достигат ръба на обрязване, но не стигат до изтичането @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} {what} е експортиран с {n} бележка: {first}|{what} е експортиран с {n} бележки: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} шрифтов файл вече е в {folder}|{n} шрифтови файла вече са в {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} шрифтов файл вече е в {folder}; {failed} не можаха да бъдат добавени: {reason}|{n} шрифтови файла вече са в {folder}; {failed} не можаха да бъдат добавени: {reason} diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 3484e06bdf..db8d4dbc61 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -5316,6 +5316,7 @@ imageTrace Outline Obris @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} povezana slika promijenjena je na disku: Ažuriraj veze prikazuje novu verziju|{n} povezane slike promijenjene su na disku: Ažuriraj veze prikazuje nove verzije|{n} povezanih slika promijenjeno je na disku: Ažuriraj veze prikazuje nove verzije @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk Ažurirana je {n} povezana datoteka promijenjena na disku|Ažurirane su {n} povezane datoteke promijenjene na disku|Ažurirano je {n} povezanih datoteka promijenjenih na disku @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings dokument zadaje napust koji ova PDF/X datoteka izostavlja: uključite „Koristi postavke napusta dokumenta“ +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} objekt doseže rub obreza, ali ne doseže napust|{n} objekta dosežu rub obreza, ali ne dosežu napust|{n} objekata doseže rub obreza, ali ne doseže napust @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} Izvezeno {what} s {n} bilješkom: {first}|Izvezeno {what} s {n} bilješke: {first}|Izvezeno {what} s {n} bilješki: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} datoteka fonta sada je u {folder}|{n} datoteke fontova sada su u {folder}|{n} datoteka fontova sada je u {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} datoteka fonta sada je u {folder}; {failed} nije moguće dodati: {reason}|{n} datoteke fontova sada su u {folder}; {failed} nije moguće dodati: {reason}|{n} datoteka fontova sada je u {folder}; {failed} nije moguće dodati: {reason} diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 5970f572d8..5f88354313 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -6243,6 +6243,7 @@ liquify-list-end {0}, {1} {0} i {1} @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} imatge enllaçada ha canviat al disc: Actualitza els enllaços mostra la versió nova|{n} imatges enllaçades han canviat al disc: Actualitza els enllaços mostra les versions noves @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk S’ha actualitzat {n} fitxer enllaçat que ha canviat al disc|S’han actualitzat {n} fitxers enllaçats que han canviat al disc @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings el document defineix un sangrat que aquest fitxer PDF/X omet: activeu «Utilitza la configuració de sangrat del document» +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} objecte arriba a la vora de tall però no arriba al sangrat|{n} objectes arriben a la vora de tall però no arriben al sangrat @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} S’ha exportat {what} amb {n} nota: {first}|S’ha exportat {what} amb {n} notes: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} fitxer de tipus de lletra ja és a {folder}|{n} fitxers de tipus de lletra ja són a {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} fitxer de tipus de lletra ja és a {folder}; {failed} no s’han pogut afegir: {reason}|{n} fitxers de tipus de lletra ja són a {folder}; {failed} no s’han pogut afegir: {reason} diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 3aecd729a9..69cc5c6c85 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -5586,6 +5586,7 @@ liquify-list-end {0}, {1} {0} a {1} @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions Na disku se změnil {n} propojený obrázek: novou verzi zobrazí Aktualizovat propojení|Na disku se změnily {n} propojené obrázky: nové verze zobrazí Aktualizovat propojení|Na disku se změnilo {n} propojených obrázků: nové verze zobrazí Aktualizovat propojení @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk Aktualizován {n} propojený soubor změněný na disku|Aktualizovány {n} propojené soubory změněné na disku|Aktualizováno {n} propojených souborů změněných na disku @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings dokument nastavuje spadávku, kterou tento soubor PDF/X vynechává: zapněte „Použít nastavení spadávky dokumentu“ +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} objekt sahá k hraně ořezu, ale nedosahuje do spadávky|{n} objekty sahají k hraně ořezu, ale nedosahují do spadávky|{n} objektů sahá k hraně ořezu, ale nedosahuje do spadávky @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} Exportováno: {what}, {n} poznámka: {first}|Exportováno: {what}, {n} poznámky: {first}|Exportováno: {what}, {n} poznámek: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} soubor písma je nyní ve složce {folder}|{n} soubory písem jsou nyní ve složce {folder}|{n} souborů písem je nyní ve složce {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} soubor písma je nyní ve složce {folder}; nepodařilo se přidat {failed}: {reason}|{n} soubory písem jsou nyní ve složce {folder}; nepodařilo se přidat {failed}: {reason}|{n} souborů písem je nyní ve složce {folder}; nepodařilo se přidat {failed}: {reason} diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 59a09bca8b..bf7d9216af 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -7677,6 +7677,7 @@ imageTrace Outline Kontur @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} linket billede er ændret på disken: Opdatér links viser den nye version|{n} linkede billeder er ændret på disken: Opdatér links viser de nye versioner @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk Opdaterede {n} linket fil ændret på disken|Opdaterede {n} linkede filer ændret på disken @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings dokumentet angiver et udløb, som denne PDF/X-fil udelader: slå „Brug dokumentets udløbsindstillinger“ til +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} objekt når til beskæringskanten, men stopper før udløbet|{n} objekter når til beskæringskanten, men stopper før udløbet @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} Eksporterede {what} med {n} note: {first}|Eksporterede {what} med {n} noter: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} skrifttypefil er nu i {folder}|{n} skrifttypefiler er nu i {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} skrifttypefil er nu i {folder}; {failed} kunne ikke tilføjes: {reason}|{n} skrifttypefiler er nu i {folder}; {failed} kunne ikke tilføjes: {reason} diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index afa0451e48..c6574608bc 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -5191,6 +5191,7 @@ liquify-list-end {0}, {1} {0} und {1} @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} verknüpftes Bild wurde auf dem Datenträger geändert: „Verknüpfungen aktualisieren“ zeigt die neue Version|{n} verknüpfte Bilder wurden auf dem Datenträger geändert: „Verknüpfungen aktualisieren“ zeigt die neuen Versionen @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk {n} auf dem Datenträger geänderte verknüpfte Datei aktualisiert|{n} auf dem Datenträger geänderte verknüpfte Dateien aktualisiert @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings das Dokument legt einen Anschnitt fest, den diese PDF/X-Datei auslässt: „Anschnitteinstellungen des Dokuments verwenden“ aktivieren +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} Objekt reicht bis zur Endformatkante, endet aber vor dem Anschnitt|{n} Objekte reichen bis zur Endformatkante, enden aber vor dem Anschnitt @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} {what} mit {n} Hinweis exportiert: {first}|{what} mit {n} Hinweisen exportiert: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} Schriftdatei liegt jetzt in {folder}|{n} Schriftdateien liegen jetzt in {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} Schriftdatei liegt jetzt in {folder}; {failed} konnten nicht hinzugefügt werden: {reason}|{n} Schriftdateien liegen jetzt in {folder}; {failed} konnten nicht hinzugefügt werden: {reason} diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 726e0630a0..e495db3ea3 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -5232,6 +5232,7 @@ digits Malayalam Μαλαγιάλαμ @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} συνδεδεμένη εικόνα άλλαξε στον δίσκο: η Ενημέρωση συνδέσμων εμφανίζει τη νέα έκδοση|{n} συνδεδεμένες εικόνες άλλαξαν στον δίσκο: η Ενημέρωση συνδέσμων εμφανίζει τις νέες εκδόσεις @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk Ενημερώθηκε {n} συνδεδεμένο αρχείο που άλλαξε στον δίσκο|Ενημερώθηκαν {n} συνδεδεμένα αρχεία που άλλαξαν στον δίσκο @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings το έγγραφο ορίζει ξάκρισμα που αυτό το αρχείο PDF/X παραλείπει: ενεργοποιήστε τη «Χρήση ρυθμίσεων ξακρίσματος εγγράφου» +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} αντικείμενο φτάνει στο άκρο κοπής αλλά σταματά πριν από το ξάκρισμα|{n} αντικείμενα φτάνουν στο άκρο κοπής αλλά σταματούν πριν από το ξάκρισμα @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} Εξήχθη το {what} με {n} σημείωση: {first}|Εξήχθη το {what} με {n} σημειώσεις: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} αρχείο γραμματοσειράς βρίσκεται πλέον στον φάκελο {folder}|{n} αρχεία γραμματοσειρών βρίσκονται πλέον στον φάκελο {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} αρχείο γραμματοσειράς βρίσκεται πλέον στον φάκελο {folder}· δεν ήταν δυνατή η προσθήκη {failed}: {reason}|{n} αρχεία γραμματοσειρών βρίσκονται πλέον στον φάκελο {folder}· δεν ήταν δυνατή η προσθήκη {failed}: {reason} diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index c668971d37..8305edafc7 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -5281,6 +5281,7 @@ liquify-list-end {0}, {1} {0}, {1} @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} imagen vinculada cambió en el disco: Actualizar vínculos muestra la versión nueva|{n} imágenes vinculadas cambiaron en el disco: Actualizar vínculos muestra las versiones nuevas @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk Se actualizó {n} archivo vinculado que cambió en el disco|Se actualizaron {n} archivos vinculados que cambiaron en el disco @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings el documento define un sangrado que este archivo PDF/X omite: activa «Usar los ajustes de sangrado del documento» +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} objeto llega al borde de corte pero no alcanza el sangrado|{n} objetos llegan al borde de corte pero no alcanzan el sangrado @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} Se exportó {what} con {n} nota: {first}|Se exportó {what} con {n} notas: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} archivo de fuentes ahora está en {folder}|{n} archivos de fuentes ahora están en {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} archivo de fuentes ahora está en {folder}; no se pudieron agregar {failed}: {reason}|{n} archivos de fuentes ahora están en {folder}; no se pudieron agregar {failed}: {reason} diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 08a84268a7..7a66465ba7 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -5497,6 +5497,7 @@ liquify-list-end {0}, {1} {0} ja {1} @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} linkitetty kuva muuttui levyllä: Päivitä linkit näyttää uuden version|{n} linkitettyä kuvaa muuttui levyllä: Päivitä linkit näyttää uudet versiot @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk Päivitettiin {n} levyllä muuttunut linkitetty tiedosto|Päivitettiin {n} levyllä muuttunutta linkitettyä tiedostoa @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings asiakirjassa on leikkuuvara, jonka tämä PDF/X-tiedosto jättää pois: ota käyttöön ”Käytä asiakirjan leikkuuvara-asetuksia” +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} objekti ulottuu leikkuureunaan mutta ei leikkuuvaraan|{n} objektia ulottuu leikkuureunaan mutta ei leikkuuvaraan @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} Vietiin {what}, {n} huomautus: {first}|Vietiin {what}, {n} huomautusta: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} fonttitiedosto on nyt kansiossa {folder}|{n} fonttitiedostoa on nyt kansiossa {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} fonttitiedosto on nyt kansiossa {folder}; {failed} ei voitu lisätä: {reason}|{n} fonttitiedostoa on nyt kansiossa {folder}; {failed} ei voitu lisätä: {reason} diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 197e20565c..c970ec6bcb 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -5256,6 +5256,7 @@ liquify-list-end {0}, {1} {0} et {1} @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} image liée modifiée sur le disque : Mettre à jour les liens affiche la nouvelle version|{n} images liées modifiées sur le disque : Mettre à jour les liens affiche les nouvelles versions @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk {n} fichier lié modifié sur le disque mis à jour|{n} fichiers liés modifiés sur le disque mis à jour @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings le document définit un fond perdu que ce fichier PDF/X omet : activez « Utiliser les paramètres de fond perdu du document » +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} objet atteint le bord de coupe mais s’arrête avant le fond perdu|{n} objets atteignent le bord de coupe mais s’arrêtent avant le fond perdu @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} {what} exporté avec {n} remarque : {first}|{what} exporté avec {n} remarques : {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} fichier de polices se trouve maintenant dans {folder}|{n} fichiers de polices se trouvent maintenant dans {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} fichier de polices se trouve maintenant dans {folder} ; {failed} n’ont pas pu être ajoutés : {reason}|{n} fichiers de polices se trouvent maintenant dans {folder} ; {failed} n’ont pas pu être ajoutés : {reason} diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index 1051a2f25d..29a279c3e4 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -4348,6 +4348,7 @@ antiAlias Sharp શાર્પ Gurmukhi ગુરમુખી @plural Result: {n}|Results: {n} પરિણામ: {n}|પરિણામો: {n} @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings દસ્તાવેજ એવી બ્લીડ સેટ કરે છે જે આ PDF/X ફાઇલ છોડી દે છે: "દસ્તાવેજની બ્લીડ સેટિંગ્સ વાપરો" ચાલુ કરો +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} ઑબ્જેક્ટ ટ્રિમ કિનારી સુધી પહોંચે છે પણ બ્લીડ પહેલાં અટકી જાય છે|{n} ઑબ્જેક્ટ ટ્રિમ કિનારી સુધી પહોંચે છે પણ બ્લીડ પહેલાં અટકી જાય છે @msgplural Saved {path} with {n} note: {first}|Saved {path} with {n} notes: {first} {path} સાચવ્યું, {n} નોંધ સાથે: {first}|{path} સાચવ્યું, {n} નોંધો સાથે: {first} @msgplural Packaged {n} file ({note}) in {folder}|Packaged {n} files ({note}) in {folder} {folder} માં {n} ફાઇલ ({note}) પેકેજ થઈ|{folder} માં {n} ફાઇલો ({note}) પેકેજ થઈ @msgplural Packaged {n} file {note}|Packaged {n} files {note} {n} ફાઇલ પેકેજ થઈ {note}|{n} ફાઇલો પેકેજ થઈ {note} diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 2014f66fdc..7ba2e9e46e 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -8812,6 +8812,7 @@ liquify-list-end {0}, {1} {0} और {1} @msgplural Exported {n} document|Exported {n} documents {n} डॉक्यूमेंट एक्सपोर्ट हुआ|{n} डॉक्यूमेंट एक्सपोर्ट हुए @msgplural Exported {n} file to {folder}|Exported {n} files to {folder} {folder} में {n} फ़ाइल एक्सपोर्ट हुई|{folder} में {n} फ़ाइलें एक्सपोर्ट हुईं @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings डॉक्यूमेंट एक ब्लीड सेट करता है जिसे यह PDF/X फ़ाइल छोड़ देती है: "डॉक्यूमेंट की ब्लीड सेटिंग्स उपयोग करें" चालू करें +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} ऑब्जेक्ट ट्रिम किनारे तक पहुँचता है पर ब्लीड से पहले रुक जाता है|{n} ऑब्जेक्ट ट्रिम किनारे तक पहुँचते हैं पर ब्लीड से पहले रुक जाते हैं @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} {what} एक्सपोर्ट हुआ, {n} नोट के साथ: {first}|{what} एक्सपोर्ट हुआ, {n} नोट्स के साथ: {first} @msgplural Opened with {n} note: {first}|Opened with {n} notes: {first} {n} नोट के साथ खुला: {first}|{n} नोट्स के साथ खुला: {first} @msgplural {notice}. Opened with {n} note: {first}|{notice}. Opened with {n} notes: {first} {notice}। {n} नोट के साथ खुला: {first}|{notice}। {n} नोट्स के साथ खुला: {first} diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 9b536ed556..e2be99b695 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -5760,6 +5760,7 @@ liquify-list-end {0}, {1} {0} és {1} @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions A lemezen módosult csatolt képek: {n}; a Csatolások frissítése az új változatokat mutatja @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk Frissített, a lemezen módosult csatolt fájlok: {n} @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings a dokumentum kifutót állít be, amelyet ez a PDF/X-fájl kihagy: kapcsolja be „A dokumentum kifutóbeállításainak használata” beállítást +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} objektum eléri a vágási élt, de nem ér ki a kifutóig @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} Exportálva: {what}; megjegyzések: {n}, az első: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} Betűtípusfájlok száma: {n}, mappa: {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} Betűtípusfájlok száma: {n}, mappa: {folder}; nem sikerült hozzáadni: {failed} ({reason}) diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index 760f0b591a..fba2c958db 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -4990,6 +4990,7 @@ imageTrace Outline Kontur @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} gambar tertaut di disk telah berubah: Perbarui Tautan menampilkan versi barunya @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk Telah memperbarui {n} berkas tertaut yang berubah di disk @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings dokumen menetapkan bleed yang dihilangkan oleh file PDF/X ini: aktifkan "Gunakan pengaturan bleed dokumen" +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} objek mencapai tepi potong tetapi berhenti sebelum bleed @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} {what} diekspor dengan {n} catatan: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} berkas font kini berada di {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} berkas font kini berada di {folder}; {failed} tidak dapat ditambahkan: {reason} diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 2540830b01..64ff36d462 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -5320,6 +5320,7 @@ liquify-list-end {0}, {1} {0} e {1} @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} immagine collegata modificata su disco: Aggiorna collegamenti mostra la nuova versione|{n} immagini collegate modificate su disco: Aggiorna collegamenti mostra le nuove versioni @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk Aggiornato {n} file collegato modificato su disco|Aggiornati {n} file collegati modificati su disco @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings il documento imposta un'abbondanza che questo file PDF/X omette: attiva «Usa impostazioni abbondanza del documento» +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} oggetto raggiunge il bordo di rifilo ma si ferma prima dell'abbondanza|{n} oggetti raggiungono il bordo di rifilo ma si fermano prima dell'abbondanza @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} Esportato {what} con {n} nota: {first}|Esportato {what} con {n} note: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} file di font ora in {folder}|{n} file di font ora in {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} file di font ora in {folder}; impossibile aggiungerne {failed}: {reason}|{n} file di font ora in {folder}; impossibile aggiungerne {failed}: {reason} diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 084c59e9a0..55a4d806c0 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -5389,6 +5389,7 @@ liquify-list-end {0}, {1} {0}、{1} @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} 個のリンク画像がディスク上で変更されました: 「リンクを更新」で新しいバージョンを表示できます @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk ディスク上で変更された {n} 個のリンクファイルを更新しました @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings ドキュメントに設定された裁ち落としがこの PDF/X ファイルには含まれません: 「ドキュメントの裁ち落とし設定を使用」をオンにしてください +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} 個のオブジェクトが仕上がり線に達していますが、裁ち落としまで届いていません @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} {what} を書き出しましたが、注意事項が {n} 件あります: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} 個のフォントファイルが {folder} に入りました @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} 個のフォントファイルが {folder} に入りましたが、{failed} 個は追加できませんでした: {reason} diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index bd069f4b9b..859cd0a3c8 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -6979,6 +6979,7 @@ font-technology Variable ცვლადი @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions დაკავშირებული გამოსახულებები შეიცვალა დისკზე ({n}): ბმულების განახლება აჩვენებს ახალ ვერსიებს @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk განახლდა დისკზე შეცვლილი დაკავშირებული ფაილები: {n} @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings დოკუმენტი ადგენს ჭრისპირა არეს, რომელსაც ეს PDF/X ფაილი გამოტოვებს: ჩართეთ „დოკუმენტის ჭრისპირა არის პარამეტრების გამოყენება“ +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed ობიექტები, რომლებიც ჭრის კიდეს აღწევს, მაგრამ ჭრისპირა არემდე ვერა: {n} @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} ექსპორტირებულია {what}, შენიშვნები: {n}: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} შრიფტის ფაილები ({n}) ახლა აქ არის: {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} შრიფტის ფაილები ({n}) ახლა აქ არის: {folder}; ვერ დაემატა {failed}: {reason} diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 239a805465..0181ce2f20 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -5316,6 +5316,7 @@ liquify-list-end {0}, {1} {0} 및 {1} @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions 링크된 이미지 {n}개가 디스크에서 바뀌었습니다: 링크 업데이트를 하면 새 버전이 표시됩니다 @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk 디스크에서 바뀐 링크된 파일 {n}개를 업데이트했습니다 @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings 문서에 설정된 도련이 이 PDF/X 파일에서 빠집니다: "문서 도련 설정 사용"을 켜세요 +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed 객체 {n}개가 재단선에 닿지만 도련까지 이어지지 않습니다 @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} 참고 {n}건과 함께 {what}을(를) 내보냈습니다: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} 글꼴 파일 {n}개가 이제 {folder}에 있습니다 @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} 글꼴 파일 {n}개가 이제 {folder}에 있으며, {failed}개는 추가할 수 없었습니다: {reason} diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 2f98ee84fe..84a5218d4a 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -5584,6 +5584,7 @@ imageTrace Outline Contour @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} gekoppelde afbeelding is gewijzigd op de schijf: Koppelingen bijwerken toont de nieuwe versie|{n} gekoppelde afbeeldingen zijn gewijzigd op de schijf: Koppelingen bijwerken toont de nieuwe versies @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk Bijgewerkt: {n} gekoppeld bestand gewijzigd op de schijf|Bijgewerkt: {n} gekoppelde bestanden gewijzigd op de schijf @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings het document stelt een afloop in die dit PDF/X-bestand weglaat: schakel 'Afloopinstellingen van document gebruiken' in +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} object reikt tot de snijrand maar stopt voor de afloop|{n} objecten reiken tot de snijrand maar stoppen voor de afloop @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} {what} geëxporteerd met {n} opmerking: {first}|{what} geëxporteerd met {n} opmerkingen: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} er staat nu {n} lettertypebestand in {folder}|er staan nu {n} lettertypebestanden in {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} er staat nu {n} lettertypebestand in {folder}; {failed} konden niet worden toegevoegd: {reason}|er staan nu {n} lettertypebestanden in {folder}; {failed} konden niet worden toegevoegd: {reason} diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index bf8c7593a1..7083a62c90 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -5412,6 +5412,7 @@ liquify-list-end {0}, {1} {0} i {1} @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} połączony obraz zmienił się na dysku: Aktualizuj łącza pokaże nową wersję|{n} połączone obrazy zmieniły się na dysku: Aktualizuj łącza pokaże nowe wersje|{n} połączonych obrazów zmieniło się na dysku: Aktualizuj łącza pokaże nowe wersje @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk Zaktualizowano {n} połączony plik zmieniony na dysku|Zaktualizowano {n} połączone pliki zmienione na dysku|Zaktualizowano {n} połączonych plików zmienionych na dysku @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings dokument ustawia spad, który ten plik PDF/X pomija: włącz „Użyj ustawień spadu dokumentu” +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed Obiekty sięgające linii cięcia, ale niedochodzące do spadu: {n}|Obiekty sięgające linii cięcia, ale niedochodzące do spadu: {n}|Obiekty sięgające linii cięcia, ale niedochodzące do spadu: {n} @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} Wyeksportowano {what} z {n} uwagą: {first}|Wyeksportowano {what} z {n} uwagami: {first}|Wyeksportowano {what} z {n} uwagami: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} plik czcionki jest teraz w {folder}|{n} pliki czcionek są teraz w {folder}|{n} plików czcionek jest teraz w {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} plik czcionki jest teraz w {folder}; nie udało się dodać {failed}: {reason}|{n} pliki czcionek są teraz w {folder}; nie udało się dodać {failed}: {reason}|{n} plików czcionek jest teraz w {folder}; nie udało się dodać {failed}: {reason} diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 03b9998eb2..6ef3854d5f 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -4619,6 +4619,7 @@ axis Both Ambos @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} imagem vinculada mudou no disco: Atualizar links mostra a nova versão|{n} imagens vinculadas mudaram no disco: Atualizar links mostra as novas versões @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk {n} arquivo vinculado alterado no disco atualizado|{n} arquivos vinculados alterados no disco atualizados @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings o documento define uma sangria que este arquivo PDF/X omite: ative "Usar configurações de sangria do documento" +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} objeto chega à borda de corte, mas para antes da sangria|{n} objetos chegam à borda de corte, mas param antes da sangria @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} {what} exportado com {n} observação: {first}|{what} exportado com {n} observações: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} arquivo de fonte agora está em {folder}|{n} arquivos de fonte agora estão em {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} arquivo de fonte agora está em {folder}; não foi possível adicionar {failed}: {reason}|{n} arquivos de fonte agora estão em {folder}; não foi possível adicionar {failed}: {reason} diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index a729b05460..554905ebad 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -5318,6 +5318,7 @@ liquify-list-end {0}, {1} {0} и {1} @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} связанное изображение изменилось на диске: «Обновить связи» покажет новую версию|{n} связанных изображения изменились на диске: «Обновить связи» покажет новые версии|{n} связанных изображений изменились на диске: «Обновить связи» покажет новые версии @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk Обновлён {n} связанный файл, изменённый на диске|Обновлено {n} связанных файла, изменённых на диске|Обновлено {n} связанных файлов, изменённых на диске @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings в документе задан вылет, который этот файл PDF/X не включает: включите «Использовать параметры вылета документа» +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed Объектов, доходящих до обрезного края, но не до вылета: {n}|Объектов, доходящих до обрезного края, но не до вылета: {n}|Объектов, доходящих до обрезного края, но не до вылета: {n} @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} Экспортировано: {what} с {n} примечанием: {first}|Экспортировано: {what} с {n} примечаниями: {first}|Экспортировано: {what} с {n} примечаниями: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} файл шрифта теперь в {folder}|{n} файла шрифтов теперь в {folder}|{n} файлов шрифтов теперь в {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} файл шрифта теперь в {folder}; не удалось добавить {failed}: {reason}|{n} файла шрифтов теперь в {folder}; не удалось добавить {failed}: {reason}|{n} файлов шрифтов теперь в {folder}; не удалось добавить {failed}: {reason} diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index d4c923d87d..f4d619e842 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -5173,6 +5173,7 @@ liquify-list-end {0}, {1} {0} och {1} @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} länkad bild har ändrats på disken: Uppdatera länkar visar den nya versionen|{n} länkade bilder har ändrats på disken: Uppdatera länkar visar de nya versionerna @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk Uppdaterade {n} länkad fil som ändrats på disken|Uppdaterade {n} länkade filer som ändrats på disken @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings dokumentet anger ett utfall som den här PDF/X-filen utelämnar: slå på ”Använd dokumentets inställningar för utfall” +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} objekt når skärkanten men slutar före utfallet|{n} objekt når skärkanten men slutar före utfallet @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} Exporterade {what} med {n} anteckning: {first}|Exporterade {what} med {n} anteckningar: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} typsnittsfil finns nu i {folder}|{n} typsnittsfiler finns nu i {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} typsnittsfil finns nu i {folder}; {failed} kunde inte läggas till: {reason}|{n} typsnittsfiler finns nu i {folder}; {failed} kunde inte läggas till: {reason} diff --git a/crates/ui-egui/src/i18n/tests.rs b/crates/ui-egui/src/i18n/tests.rs index be51c93d96..45fe91f0b5 100644 --- a/crates/ui-egui/src/i18n/tests.rs +++ b/crates/ui-egui/src/i18n/tests.rs @@ -4359,6 +4359,21 @@ fn pdfx_bleed_warning_is_translated() { } } +/// The warning about art that reaches the trim edge but stops short of the bleed is translated in +/// every complete-message catalog, for one object and for more, alone and in the status bar's note. +#[test] +fn short_of_bleed_warning_is_translated() { + for n in [1, 3, 5, 21] { + let w = vectorcraft_engine::cmd::fileio::pdf::short_of_bleed_warning(n).expect("a warning"); + let status = format!("Saved /tmp/a.pdf with 1 note: {w}"); + for code in COMPLETE_MESSAGES { + for shown in [message(Lang::from_code(code).expect("registered"), &w), message(Lang::from_code(code).expect("registered"), &status)] { + assert!(!shown.contains("trim edge") && !shown.contains("short of") && shown.contains(&n.to_string()), "{code}: {shown}"); + } + } + } +} + /// The errors of saving, renaming and deleting a tracing preset are translated in every language /// that translates every message. #[test] diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 2017637952..74b75cc8e2 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -5014,6 +5014,7 @@ liquify-list-end {0}, {1} {0} ve {1} @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} bağlantılı görsel diskte değişti: Bağlantıları Güncelle yeni sürümleri gösterir @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk Diskte değişen {n} bağlantılı dosya güncellendi @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings belge, bu PDF/X dosyasının dışarıda bıraktığı bir taşma payı ayarlıyor: "Belge taşma payı ayarlarını kullan" seçeneğini açın +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} nesne kesim kenarına ulaşıyor ancak taşma payından önce bitiyor @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} {what} {n} notla dışa aktarıldı: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} yazı tipi dosyası artık {folder} içinde @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} yazı tipi dosyası artık {folder} içinde; {failed} eklenemedi: {reason} diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 53ca6b8a43..daac22878e 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -5304,6 +5304,7 @@ liquify-list-end {0}, {1} {0} і {1} @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} пов’язане зображення змінилося на диску: «Оновити зв’язки» покаже нову версію|{n} пов’язані зображення змінилися на диску: «Оновити зв’язки» покаже нові версії|{n} пов’язаних зображень змінилися на диску: «Оновити зв’язки» покаже нові версії @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk Оновлено {n} пов’язаний файл, змінений на диску|Оновлено {n} пов’язані файли, змінені на диску|Оновлено {n} пов’язаних файлів, змінених на диску @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings у документі задано виліт, який цей файл PDF/X не містить: увімкніть «Використовувати параметри вильоту документа» +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed об’єктів, що доходять до краю обрізу, але не до вильоту: {n}|об’єктів, що доходять до краю обрізу, але не до вильоту: {n}|об’єктів, що доходять до краю обрізу, але не до вильоту: {n} @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} Експортовано: {what} з {n} приміткою: {first}|Експортовано: {what} з {n} примітками: {first}|Експортовано: {what} з {n} примітками: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} файл шрифту тепер у {folder}|{n} файли шрифтів тепер у {folder}|{n} файлів шрифтів тепер у {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} файл шрифту тепер у {folder}; не вдалося додати {failed}: {reason}|{n} файли шрифтів тепер у {folder}; не вдалося додати {failed}: {reason}|{n} файлів шрифтів тепер у {folder}; не вдалося додати {failed}: {reason} diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 7dcf6219fd..eeff3f867b 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -5433,6 +5433,7 @@ liquify-list-end {0}, {1} {0} và {1} @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} ảnh liên kết đã thay đổi trên đĩa: Cập nhật liên kết hiển thị phiên bản mới @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk Đã cập nhật {n} tệp liên kết đã thay đổi trên đĩa @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings tài liệu đặt bleed mà tệp PDF/X này bỏ qua: hãy bật "Dùng cài đặt bleed của tài liệu" +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} đối tượng chạm mép xén nhưng dừng trước bleed @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} Đã xuất {what} với {n} ghi chú: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} tệp phông chữ hiện ở trong {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} tệp phông chữ hiện ở trong {folder}; {failed} không thể thêm: {reason} diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 5c8ea12be7..d43ae4fb38 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -5066,6 +5066,7 @@ liquify-list-end {0}, {1} {0}和{1} @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions 有 {n} 个链接图像已在磁盘上更改:“更新链接”可显示新版本 @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk 已更新 {n} 个在磁盘上更改的链接文件 @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings 文档设置了出血,但此 PDF/X 文件未包含:请打开“使用文档的出血设置” +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} 个对象到达裁切线,但未延伸到出血区域 @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} 已导出 {what},有 {n} 条注释:{first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} 个字体文件现已位于 {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} 个字体文件现已位于 {folder};有 {failed} 个无法添加:{reason} diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 2134e31d7f..0729104ff5 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -2703,6 +2703,7 @@ liquify-list-end {0}, {1} {0}和{1} @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions 有 {n} 個連結影像已在磁碟上變更:「更新連結」可顯示新版本 @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk 已更新 {n} 個在磁碟上變更的連結檔案 @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings 文件設定了出血,但此 PDF/X 檔案未包含:請開啟「使用文件的出血設定」 +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} 個物件到達裁切線,但未延伸到出血區域 @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} 已匯出 {what},附有 {n} 則註解:{first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} 個字體檔案現已位於 {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} 個字體檔案現已位於 {folder};有 {failed} 個無法加入:{reason} diff --git a/docs/mcp.md b/docs/mcp.md index 948bee5d94..d82c54b946 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -5984,6 +5984,20 @@ information (title, artboard, export date in UTC) are drawn in Registration (`/S the colour bars are process, spot and black-tint patches. Layers whose Print option is off (`layer.setProps {printable: false}`) are left out unless `includeNonPrinting` (or `createLayers`) is on. +VectorCraft also checks the art against the bleed. When a page has a bleed, the export warns with a count of the +objects that reach the trim edge (within 0.5 pt) on a side whose bleed is more than 0.5 pt but end before the bleed +edge, for example `3 objects reach the trim edge but stop short of the bleed`. The check measures each object on the +visible layers (a group counts as one) by its visual bounds, strokes included. It measures a clip group or a clipping +layer by the art inside the clipping path's geometric bounds and by the fill and stroke the clipping path paints +itself. It leaves out hidden objects, guides, objects at 0% opacity and paths with no fill or stroke. It does not +measure objects with brushed strokes or an opacity mask, area type, type on a path, or groups that hold one of them. +It leaves out template layers, layers with an opacity mask, and layers that don't print unless `includeNonPrinting` is +on. The export writes the art and the page boxes unchanged. A page of the +art's bounds (`useArtboards: false`) does not warn. Export for Screens does not warn for a PDF row when Include Bleed +grows the artboards, or for a page of assets, layers or a selection. `.ai` saves do not warn. When OK in File › +Document Setup raises the bleed on a side, the status bar counts the objects that stop short of the new bleed on the +sides OK raised, on every artboard. + ```json {"name":"run_command","arguments":{"command":"document.exportPdf","params":{"path":"/tmp/press.pdf","preset":"Press Quality","marks":{"trim":true,"registration":true,"colorBars":true,"pageInfo":true}}}} ``` diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index fdb66b722f..196a292718 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1886,6 +1886,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur A `.ai` export with Use Artboards off writes one page of the visible art's bounds without the native document or the editing copy for other apps, with a warning, so the file does not reopen with one artboard in place of the document's; without PDF content it is refused (`crates/engine/src/cmd/fileio/tests_pdfedit.rs`). That page, and an HP-GL plot of the art's bounds, are measured on the art the file draws: non-printing layers the PDF or `.ai` file leaves out do not make it larger, and nor do the non-printing layers, objects at 0% opacity, placed images, clear gradient meshes and unpainted paths a plot leaves out; Export As refuses an HP-GL plot of nothing it draws before the save dialog (`crates/engine/src/cmd/fileio/tests_pdf.rs`, `crates/engine/src/cmd/fileio/tests_hpgl.rs`, `crates/ui-egui/src/dialogs/tests_export.rs`). PDF export warns when a PDF/X file has no bleed on a side where the document's bleed has one, and writes the file as asked. + PDF export, and Document Setup when OK raises the bleed, count the objects that reach the trim edge on a side with a bleed but stop short of the bleed edge, and change no art or page box (`crates/engine/src/cmd/fileio/tests_pdfx.rs`). In a PDF without a standard, the warning for a page longer than 14,400 pt written with a `UserUnit` names "Write pages longer than 200 in at full size in points" (`crates/engine/src/cmd/fileio/tests_pdf.rs`). A PDF/A-2b export at PDF 1.4 with a page longer than 14,400 pt is written as PDF 1.6 with a `UserUnit` and a warning, whether or not `longPagesInPoints` is on, so its page boundaries stay within PDF/A-2's limit of 14,400 units (ISO 19005-2, 6.1.13) unless the page is too narrow for that (`crates/pdf/src/tests/marks.rs`). PDF/X-1a, PDF/X-3 and PDF 1.3 files keep the art under the hidden part of a picture, gradient, pattern, mesh or raster effect that a clipping mask or clipping layer crops: flattening rasterizes only the part of such art that its clipping path shows, on its own page and on the next one. Layers the file leaves out are left out of the flattening, and transparent art that a clipping path hides entirely is removed (`crates/engine/src/cmd/fileio/tests_pdfx.rs`). From 84308c53d75ebbafb3f3a115289b366253aa44f5 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 16:12:02 -0800 Subject: [PATCH 015/102] Path Precision Tools: Smooth Bridge joins many circles and keeps a constant gap Smooth Bridge now takes three or more circles. Every two whose outlines are within a reach of each other are bridged, the bridges that connect are united into one shape each, and a circle bridged to no other stays as it is. - `addon.pathtools.bridge` takes `gap` (0 to 1000 pt) in place of `radius`: the arcs' radius is the smaller circle's radius plus the gap, so each arc stays the gap away from a circle of the smaller circle's size about the arc's center. In a triangular grid of equal circles that gap apart, the channels around an empty place keep one width. Giving both is an error. - `reach` (0 to 10000 pt, 10 by default) sets how far apart two circles' outlines may be for a bridge between them. It applies to three or more circles; two are bridged at any distance, and the dialog's Reach field is unavailable then. Pairs are found through a grid of cells, so each circle is compared only with its near neighbors. Holes smaller than 1% of the smallest circle's area are filled. - A pair within reach but too far apart for the radius or gap gets no bridge. One circle inside another, no pair that can be bridged, no two circles within reach, more than 2000 circles and more than 8000 bridges are refused with a message. An id given twice counts once. - Each shape replaces its circles, painted as the topmost of them, or with `keepOriginals` goes directly above that circle. One undo step; the shapes and the circles left alone are selected, and the result is `{ids, alone}`, with `id` as well for two circles. - `smooth_bridge` refuses circles whose sizes overflow when squared; it returned a path whose points were not numbers. - The selection message becomes "select two or more circles to bridge". - The dialog adds Constant Gap (a Gap field in place of Radius) and Reach. Docs: docs/mcp.md, docs/ui-parity.md, docs/target-app-parity.md, ROADMAP. --- ROADMAP.md | 2 +- .../engine/src/cmd/addons/pathtools/bridge.rs | 152 ++++-- .../src/cmd/addons/pathtools/bridge/tests.rs | 167 ++++++- crates/engine/src/cmd/params.rs | 3 +- crates/engine/tests/command_sweep.rs | 2 + crates/pathops/src/addons/pathtools.rs | 7 +- crates/pathops/src/addons/pathtools/bridge.rs | 444 +++++++++++++++++- crates/ui-egui/src/addons/pathtools/bridge.rs | 81 +++- crates/ui-egui/src/i18n/bg.tsv | 10 +- crates/ui-egui/src/i18n/bs.tsv | 10 +- crates/ui-egui/src/i18n/ca.tsv | 10 +- crates/ui-egui/src/i18n/cs.tsv | 10 +- crates/ui-egui/src/i18n/da.tsv | 10 +- crates/ui-egui/src/i18n/de.tsv | 10 +- crates/ui-egui/src/i18n/el.tsv | 10 +- crates/ui-egui/src/i18n/es.tsv | 10 +- crates/ui-egui/src/i18n/fi.tsv | 10 +- crates/ui-egui/src/i18n/fr.tsv | 10 +- crates/ui-egui/src/i18n/gu.tsv | 2 + crates/ui-egui/src/i18n/hi.tsv | 10 +- crates/ui-egui/src/i18n/hu.tsv | 10 +- crates/ui-egui/src/i18n/id.tsv | 10 +- crates/ui-egui/src/i18n/it.tsv | 10 +- crates/ui-egui/src/i18n/ja.tsv | 10 +- crates/ui-egui/src/i18n/ka.tsv | 10 +- crates/ui-egui/src/i18n/ko.tsv | 10 +- crates/ui-egui/src/i18n/nl.tsv | 10 +- crates/ui-egui/src/i18n/pl.tsv | 10 +- crates/ui-egui/src/i18n/pt-br.tsv | 10 +- crates/ui-egui/src/i18n/ru.tsv | 10 +- crates/ui-egui/src/i18n/sv.tsv | 10 +- crates/ui-egui/src/i18n/tr.tsv | 10 +- crates/ui-egui/src/i18n/uk.tsv | 10 +- crates/ui-egui/src/i18n/vi.tsv | 10 +- crates/ui-egui/src/i18n/zh-hans.tsv | 10 +- crates/ui-egui/src/i18n/zh-hant.tsv | 10 +- docs/mcp.md | 39 +- docs/target-app-parity.md | 2 + docs/ui-parity.md | 2 +- 39 files changed, 1058 insertions(+), 115 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 317174e231..9fab724e07 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -144,7 +144,7 @@ Ranked; detail in [docs/roadmap.md](docs/roadmap.md) and [docs/gaps.md](docs/gap - 2026-11-01: New Symbols from Layers joins the Document Tools add-on (Object › Plug-ins › Document Tools): one symbol of each top-level layer's art (the layers highlighted in the Layers panel when two or more are, else every layer), named after the layer, made as New Symbol makes one; Convert Layers to Symbols also puts an instance of each in place of its layer's art. Empty layers are skipped and reported; one undo step. A VectorCraft addition: headline numbers unchanged. - 2026-11-01: Document Tools, a built-in add-on (Object › Plug-ins › Document Tools), starts with Save a Timestamped Copy: a copy of the document named `_YYYY-MM-DD_HH-MM` (UTC; `-2`, `-3`… when that name is taken) goes next to it, or into a folder picked for a document never saved, written as File › Save a Copy writes it, so the document keeps its path, title and modified state. Off on the web, which has no clock. A VectorCraft addition: headline numbers unchanged. - 2026-11-01: Divide into Dashes joins the Path Precision Tools add-on (Object › Plug-ins › Path Precision Tools): the selected paths, or only their direct-selected segments, are cut into separate open paths of a dash length measured along the curve, with an optional gap (left empty, or kept as pieces), each keeping the path's appearance; Fit to Corners and Ends stretches or squeezes the lengths so every run starts and ends on a dash. A dialog with Preview, one undo step, at most 100000 pieces. A VectorCraft addition: headline numbers unchanged. -- 2026-11-15: Smooth Bridge joins the Path Precision Tools add-on (Object › Plug-ins › Path Precision Tools): two selected circles become one closed outline joined by two concave arcs that touch both circles, so every anchor is smooth; the arcs' radius is a percentage of the smaller circle's radius (1 to 1000%, 100% by default), and Keep Originals adds the outline above the circles instead of replacing them. A dialog with Preview, one undo step (`addon.pathtools.bridge`). A VectorCraft addition: headline numbers unchanged. +- 2026-11-15: Smooth Bridge joins the Path Precision Tools add-on (Object › Plug-ins › Path Precision Tools): two selected circles become one closed outline joined by two concave arcs that touch both circles, so every anchor is smooth; the arcs' radius is a percentage of the smaller circle's radius (1 to 1000%, 100% by default), or with Constant Gap the smaller circle's radius plus a gap, and Keep Originals adds the outline above the circles instead of replacing them. With three or more circles, every two whose outlines are within Reach (10 pt by default) are joined, the bridges that connect become one shape each, and a circle bridged to no other stays as it is (at most 2000 circles). A dialog with Preview, one undo step (`addon.pathtools.bridge`). A VectorCraft addition: headline numbers unchanged. - 2026-11-03: Text Tweaker, the first tool of the Type Tools add-on (Object › Plug-ins › Type Tools): one character attribute (size, baseline shift, rotation, horizontal or vertical scale, tracking, leading or stroke weight) goes letter by letter from a start value to an end value along a straight ramp, an ease, a bow, a spike or at random with a seed, set as the Character panel sets it, while the text stays live; a dialog with Preview, one undo step (`addon.type.textTweaker`, #4924). A VectorCraft addition: headline numbers unchanged. - 2026-11-01: Group Overlapping Objects joins the Arrange Tools add-on (Object › Plug-ins › Arrange Tools): the selected objects whose visual bounds overlap or touch, chains included, go into one group each, within their own layer or group, at the stacking place of their frontmost member; objects that overlap nothing stay as they are. One undo step, a sweep along x so thousands of loose pieces group quickly (at most 20000 objects). A VectorCraft addition: headline numbers unchanged. - 2026-10-31: Export for Screens works as the reference app's dialog: Artboards and Assets tabs with a grid or list of thumbnails, Clear Selection and Prefix, Create Sub-folders by Scale or Format (on by default), Export PDFs As Single File (the chosen artboards as one PDF's pages, `pdfs: "single"`) or Multiple Files, iOS and Android rows, format presets in a ☰ menu, and a count of the files the export writes (#4895). About 55 community PRs and fixes landed the same day: Find Font, Replace Font, Outline Stroke and Expand leave hidden and locked art alone (with a warning); DXF export writes LINE and ELLIPSE entities and outlines only the strokes a CAD line can't draw; Blob Brush Angle and Roundness; Shift-constrained Perspective Selection; Grid Repeat Options Preview; a gradient mesh from a file budgeted at about a million quads; width-profile strokes keep their shape zoomed out; `.ai`/EPS import fidelity (area type, envelopes, transparency in dictionaries, character styles); PDF import finds hyphenated and CMap-suffixed font names; Windows renders follow the process's core affinity; Enter or Escape in a floating panel's field no longer reaches the canvas (#4803); Properties shows Blend Options for any selected blend (#4817); Artwork Cleanup finds doubled type (#4835) and joins stacked lines into one object (Join Point Text, #4826). Headline numbers unchanged. diff --git a/crates/engine/src/cmd/addons/pathtools/bridge.rs b/crates/engine/src/cmd/addons/pathtools/bridge.rs index 2120b040e7..1c7181f43e 100644 --- a/crates/engine/src/cmd/addons/pathtools/bridge.rs +++ b/crates/engine/src/cmd/addons/pathtools/bridge.rs @@ -1,5 +1,6 @@ //! Smooth Bridge: two selected circles joined into one outline by two concave arcs that touch both -//! circles, replacing the circles or added above them. +//! circles, or three or more each joined the same way to the others within reach and united where +//! the bridges connect, replacing the circles or added above them. use serde_json::{Value, json}; use vectorcraft_doc::{NodeId, NodeKind}; @@ -20,6 +21,12 @@ const LABEL: &str = "Smooth Bridge"; /// The arcs' radius as a percentage of the smaller circle's radius: by default, and the range. const RADIUS: f64 = 100.0; const RADII: (f64, f64) = (1.0, 1000.0); +/// The gap (pt) added to the smaller circle's radius to give the arcs' radius: the range. +const GAPS: (f64, f64) = (0.0, 1000.0); +/// How far apart (pt) the outlines of two of three or more circles may be for a bridge between +/// them: by default, and the range. +const REACH: f64 = 10.0; +const REACHES: (f64, f64) = (0.0, 10000.0); pub(super) fn specs() -> Vec { vec![cmd!( @@ -27,16 +34,33 @@ pub(super) fn specs() -> Vec { "Smooth Bridge", ["Object", "Plug-ins", "Path Precision Tools"], None, - "{radius?: % 1..1000 (100; the radius of the bridge's two arcs as a percentage of the smaller circle's radius: larger makes a wider, gentler bridge), keepOriginals?: bool (false: the outline replaces the two circles, painted as the upper one; true: it goes directly above the upper one and the circles stay), ids?: [id, id] (default: the selection)} join two circles (paths whose outline is a circle, not hidden or locked) into one closed outline: around each circle on its side away from the other, and along two concave arcs, one on each side, that touch both circles so the outline runs on smoothly into them. Overlapping and touching circles are joined too; one circle inside the other, or circles too far apart for the radius (the arcs would not reach both, or would cross), is an error, which suggests a larger radius when one up to 1000% would bridge them. One undo step; the outline is selected → {id}", + "{radius?: % 1..1000 (100; the radius of each bridge's two arcs as a percentage of the smaller circle's radius: larger makes a wider, gentler bridge), gap?: pt 0..1000 (instead of radius: the arcs' radius is the smaller circle's radius plus this gap, so each arc stays this gap away from a circle of the smaller circle's size about the arc's center; for equal circles this gap apart that is where a third circle this gap from both sits, as in a triangular grid, so the channels around an empty place in such a grid are one width; giving both is an error), reach?: pt 0..10000 (10; with three or more circles: how far apart two circles' outlines may be for a bridge between them, overlapping ones included; two circles are bridged at any distance), keepOriginals?: bool (false: each outline replaces its circles, painted as the topmost of them; true: it goes directly above that circle and the circles stay), ids?: [id] (default: the selection)} join circles (paths whose outline is a circle, not hidden or locked) into metaball (aka meatball) shapes. Two circles become one closed outline: around each circle on its side away from the other, and along two concave arcs, one on each side, that touch both circles so the outline runs on smoothly into them. With three or more, every two circles within reach are bridged the same way, and the bridges that connect are united into one shape each (holes smaller than 1% of the smallest circle's area are filled); a pair within reach but too far apart for the radius gets no bridge, and a circle bridged to no other is left as it is. Overlapping and touching circles are joined too. One circle inside another (among three or more, any such pair within reach) is an error; so are two circles too far apart for the radius (the arcs would not reach both, or would cross), or three or more with no pair the arcs can join, which suggests a larger radius or gap when the largest one would bridge them; so are no two circles within reach, more than 2000 circles and more than 8000 bridges. One undo step; the outlines (and the circles left as they are) are selected → {ids, alone}, with {id} too for two circles", has_selection, bridge )] } fn bridge(s: &mut Session, p: &Value) -> Result { - let percent = given(p, "radius", Some(RADII), C)?.unwrap_or(RADIUS); + let percent = given(p, "radius", Some(RADII), C)?; + let gap = given(p, "gap", Some(GAPS), C)?; + let reach = given(p, "reach", Some(REACHES), C)?.unwrap_or(REACH); + if percent.is_some() && gap.is_some() { + // As the parameter check words it (`EXCLUSIVE_KEYS`), for a caller that skips that check. + let (key, other) = ("radius", "gap"); + return Err(bad(C, format!("give `{key}` or `{other}`, not both"))); + } + let arc = match gap { + Some(gap) => pt::ArcRadius::Gap(gap), + None => pt::ArcRadius::Share(percent.unwrap_or(RADIUS) / 100.0), + }; let keep = switch_or(p, "keepOriginals", false, C)?; - let roots = checked_ids_or_selection(s, p, C)?; + let mut roots = checked_ids_or_selection(s, p, C)?; + // An id given twice is one circle. + roots.sort_unstable(); + roots.dedup(); + if roots.len() > pt::MAX_BRIDGED_CIRCLES { + return Err(bad(C, "select at most 2000 circles to bridge")); + } let circles: Vec<(NodeId, pt::Circle)> = { let d = &s.doc()?.doc; let editable = d.editable(); @@ -48,48 +72,94 @@ fn bridge(s: &mut Session, p: &Value) -> Result { }) .collect() }; - let ([(below, a), (above, b)], 2) = (circles.as_slice(), roots.len()) else { - return Err(bad(C, "select two circles to bridge")); - }; - let (below, above) = (*below, *above); - let at = |percent: f64| pt::smooth_bridge(*a, *b, a.radius.min(b.radius) * percent / 100.0); - let outline = match at(percent) { - Ok(sp) => PathData::single(sp), - Err(pt::BridgeError::Inside) => return Err(bad(C, "one circle is inside the other")), - // A larger radius bridges circles a smaller one cannot, so only suggest one that is allowed. - Err(pt::BridgeError::TooFar) if at(RADII.1).is_ok() => { - return Err(bad(C, "the circles are too far apart for this radius: raise the radius")); + if circles.len() != roots.len() || circles.len() < 2 { + return Err(bad(C, "select two or more circles to bridge")); + } + let only: Vec = circles.iter().map(|(_, c)| *c).collect(); + // Each shape: the circles it joins, in paint order, and its outline. + let (shapes, alone): (Vec<(Vec, PathData)>, Vec) = match only.as_slice() { + [a, b] => match pt::smooth_bridge(*a, *b, arc.between(*a, *b)) { + Ok(sp) => (vec![(roots_of(&circles, &[0, 1]), PathData::single(sp))], vec![]), + Err(e) => return Err(refusal(e, arc, *a, *b)), + }, + _ => { + let made = pt::bridge_many(&only, arc, reach).map_err(|e| match e { + pt::ManyError::TooManyCircles => bad(C, "select at most 2000 circles to bridge"), + pt::ManyError::TooManyBridges => bad(C, "that makes too many bridges (at most 8000): lower the reach"), + pt::ManyError::NoneInReach => bad(C, "no two circles are within reach: raise the reach"), + pt::ManyError::TooComplex => bad(C, "the bridged circles are too complex to unite"), + pt::ManyError::Pair(i, j, e) => match (only.get(i), only.get(j)) { + (Some(a), Some(b)) => refusal(e, arc, *a, *b), + _ => bad(C, "select two or more circles to bridge"), + }, + pt::ManyError::Bad => bad(C, "select two or more circles to bridge"), + })?; + let shapes = made.joined.into_iter().map(|j| (roots_of(&circles, &j.members), j.outline)).collect(); + (shapes, roots_of(&circles, &made.alone)) } - Err(pt::BridgeError::TooFar) => return Err(bad(C, "the circles are too far apart for this radius")), - Err(pt::BridgeError::Bad) => return Err(bad(C, "select two circles to bridge")), }; - let id = s.edit(LABEL, |d, sel| { - let id = if keep { - // A copy of the upper circle (its appearance) with the outline as its path, right above - // it; the circles stay as they are, live shapes included. - // Fresh ids throughout, its opacity mask's art included. - let upper = d.node(above).cloned().ok_or(EngineError::NoNode(above))?; - let mut n = d.reid(&upper); - if let NodeKind::Path { path, live, .. } = &mut n.kind { - *path = outline; - *live = None; + let made = s.edit(LABEL, |d, sel| { + let mut made = Vec::with_capacity(shapes.len()); + if keep { + // A copy of each shape's topmost circle (its appearance) with the outline as its path, + // right above it; the circles stay as they are, live shapes included. Fresh ids + // throughout, an opacity mask's art included. + let tops: Vec = shapes.iter().filter_map(|(members, _)| members.last().copied()).collect(); + let mut beside = Beside::above(d, &tops); + for ((_, outline), top) in shapes.into_iter().zip(tops) { + let upper = d.node(top).cloned().ok_or(EngineError::NoNode(top))?; + let mut n = d.reid(&upper); + if let NodeKind::Path { path, live, .. } = &mut n.kind { + *path = outline; + *live = None; + } + made.push(n.id); + beside.put(d, top, vec![n])?; } - let id = n.id; - let mut beside = Beside::above(d, &[above]); - beside.put(d, above, vec![n])?; beside.finish(d)?; - id } else { - // The upper circle becomes the outline (a plain path now) and the lower one goes. - if let Some(NodeKind::Path { path, live, .. }) = d.node_mut(above).map(|n| &mut n.kind) { - *path = outline; - *live = None; + // Each shape's topmost circle becomes its outline (a plain path now) and the others go. + let mut gone = vec![]; + for (members, outline) in shapes { + let Some((&top, rest)) = members.split_last() else { continue }; + if let Some(NodeKind::Path { path, live, .. }) = d.node_mut(top).map(|n| &mut n.kind) { + *path = outline; + *live = None; + } + made.push(top); + gone.extend_from_slice(rest); } - remove_each(d, &[below])?; - above - }; - sel.set([id]); - Ok(id) + remove_each(d, &gone)?; + } + sel.set(made.iter().chain(&alone).copied()); + Ok(made) })?; - Ok(json!({ "id": id.0 })) + let mut out = json!({ "ids": made.iter().map(|id| id.0).collect::>(), "alone": alone.iter().map(|id| id.0).collect::>() }); + if let ([id], 2) = (made.as_slice(), only.len()) { + out["id"] = json!(id.0); + } + Ok(out) +} + +/// The ids of `circles` at indices `at`, in paint order (the circles are listed in paint order). +fn roots_of(circles: &[(NodeId, pt::Circle)], at: &[usize]) -> Vec { + at.iter().filter_map(|&i| circles.get(i)).map(|(id, _)| *id).collect() +} + +/// The error for circles `a` and `b` that arcs of `arc` can't bridge. A larger radius or gap +/// bridges circles a smaller one cannot, so it suggests one only when the largest allowed would. +fn refusal(e: pt::BridgeError, arc: pt::ArcRadius, a: pt::Circle, b: pt::Circle) -> EngineError { + let largest = match arc { + pt::ArcRadius::Share(_) => pt::ArcRadius::Share(RADII.1 / 100.0), + pt::ArcRadius::Gap(_) => pt::ArcRadius::Gap(GAPS.1), + }; + let would = pt::smooth_bridge(a, b, largest.between(a, b)).is_ok(); + match (e, arc, would) { + (pt::BridgeError::Inside, ..) => bad(C, "one circle is inside the other"), + (pt::BridgeError::TooFar, pt::ArcRadius::Share(_), true) => bad(C, "the circles are too far apart for this radius: raise the radius"), + (pt::BridgeError::TooFar, pt::ArcRadius::Share(_), false) => bad(C, "the circles are too far apart for this radius"), + (pt::BridgeError::TooFar, pt::ArcRadius::Gap(_), true) => bad(C, "the circles are too far apart for this gap: raise the gap"), + (pt::BridgeError::TooFar, pt::ArcRadius::Gap(_), false) => bad(C, "the circles are too far apart for this gap"), + (pt::BridgeError::Bad, ..) => bad(C, "select two or more circles to bridge"), + } } diff --git a/crates/engine/src/cmd/addons/pathtools/bridge/tests.rs b/crates/engine/src/cmd/addons/pathtools/bridge/tests.rs index 01320c07c1..6c491904e6 100644 --- a/crates/engine/src/cmd/addons/pathtools/bridge/tests.rs +++ b/crates/engine/src/cmd/addons/pathtools/bridge/tests.rs @@ -1,5 +1,5 @@ -//! Smooth Bridge: the outline in place of the circles or above them, one undo step, the radius, -//! and what it refuses. +//! Smooth Bridge: the outline in place of the circles or above them, one undo step, the radius or +//! gap, many circles joined to their neighbors within reach, and what it refuses. use serde_json::{Value, json}; use vectorcraft_doc::{NodeId, NodeKind}; @@ -46,6 +46,8 @@ fn two_circles_become_one_outline_in_the_upper_ones_place() { let steps = s.doc().unwrap().history.undo.len(); let r = s.execute(BRIDGE, &json!({})).unwrap(); assert_eq!(r["id"], json!(b.0)); + assert_eq!(r["ids"], json!([b.0]), "the same result fields as for more circles"); + assert_eq!(r["alone"], json!([])); assert_eq!(top_level(&s), [b]); let d = &s.doc().unwrap().doc; let NodeKind::Path { path, live, .. } = &d.node(b).unwrap().kind else { panic!("a path") }; @@ -158,9 +160,11 @@ fn far_apart_nested_and_other_objects_are_refused() { assert!(e.ends_with("the circles are too far apart for this radius"), "{e}"); } assert!(err(&mut s, json!({"ids": [a.0, inner.0]})).contains("one circle is inside the other")); - for ids in [json!([a.0, square.0]), json!([a.0, oval.0]), json!([a.0]), json!([a.0, far.0, inner.0])] { - assert!(err(&mut s, json!({ "ids": ids })).contains("select two circles to bridge"), "{ids}"); + for ids in [json!([a.0, square.0]), json!([a.0, oval.0]), json!([a.0]), json!([a.0, far.0, square.0])] { + assert!(err(&mut s, json!({ "ids": ids })).contains("select two or more circles to bridge"), "{ids}"); } + // Three circles: each two within reach are bridged, and one inside another is refused there too. + assert!(err(&mut s, json!({"ids": [a.0, far.0, inner.0]})).contains("one circle is inside the other")); assert!(err(&mut s, json!({"ids": [a.0, far.0], "radius": 0.5})).contains("`radius` must be from 1 to 1000")); assert!(err(&mut s, json!({"ids": [a.0, far.0], "radius": 1001})).contains("`radius`")); assert!(err(&mut s, json!({"ids": [a.0, far.0], "radius": "big"})).contains("`radius` must be a number")); @@ -169,6 +173,157 @@ fn far_apart_nested_and_other_objects_are_refused() { assert_eq!(s.doc().unwrap().history.undo.len(), steps, "nothing changed, no undo step"); } +/// A 3 × 3 grid of circles of radius 10, 4 apart (centers 24 apart), in rows from (100, 100). +fn grid(s: &mut Session) -> Vec { + (0..9).map(|k| circle(s, 100.0 + 24.0 * (k % 3) as f64, 100.0 + 24.0 * (k / 3) as f64, 10.0)).collect() +} + +fn ids(v: &Value) -> Vec { + v.as_array().unwrap().iter().map(|i| NodeId(i.as_u64().unwrap())).collect() +} + +fn path(s: &Session, id: NodeId) -> vectorcraft_geom::PathData { + s.doc().unwrap().doc.node(id).unwrap().path_data().unwrap().clone() +} + +#[test] +fn a_grid_of_circles_joins_each_to_its_neighbors_in_one_shape() { + let mut s = session(); + let g = grid(&mut s); + select(&mut s, &g); + let steps = s.doc().unwrap().history.undo.len(); + // Reach 5: the side neighbors (4 apart) are bridged, the diagonal ones (about 13.9 apart) not. + let r = s.execute(BRIDGE, &json!({"gap": 4, "reach": 5})).unwrap(); + assert_eq!(ids(&r["ids"]), [g[8]], "one shape, in the topmost circle's place"); + assert_eq!(ids(&r["alone"]), []); + assert_eq!(top_level(&s), [g[8]]); + assert_eq!(s.doc().unwrap().selection.objects.to_vec(), [g[8]]); + assert_eq!(s.doc().unwrap().history.undo.len(), steps + 1, "one undo step"); + // Its outline and a hole in each square of four circles, which no diagonal bridge fills. + let outline = path(&s, g[8]); + assert_eq!(outline.subpaths.len(), 5, "{}", outline.subpaths.len()); + let inside = |p: &vectorcraft_geom::PathData, x: f64, y: f64| p.to_bezpath().winding(vectorcraft_geom::kurbo::Point::new(x, y)) != 0; + assert!(inside(&outline, 112.0, 100.0) && inside(&outline, 100.0, 112.0) && !inside(&outline, 112.0, 112.0)); + s.execute("edit.undo", &json!({})).unwrap(); + assert_eq!(top_level(&s), g); + // Reach 15 takes in the diagonal neighbors, whose bridges fill the middle of each square. + select(&mut s, &g); + s.execute(BRIDGE, &json!({"gap": 4, "reach": 15})).unwrap(); + let outline = path(&s, g[8]); + assert_eq!(outline.subpaths.len(), 1); + assert!(inside(&outline, 112.0, 112.0)); +} + +#[test] +fn a_circle_with_no_neighbor_in_reach_stays_as_it_is() { + let mut s = session(); + let g = grid(&mut s); + let far = circle(&mut s, 300.0, 250.0, 10.0); + let pair = [circle(&mut s, 300.0, 40.0, 8.0), circle(&mut s, 320.0, 40.0, 8.0)]; + let mut all = g.clone(); + all.extend([far, pair[0], pair[1]]); + let r = s.execute(BRIDGE, &json!({"ids": all.iter().map(|i| i.0).collect::>(), "reach": 5})).unwrap(); + assert_eq!(ids(&r["ids"]), [g[8], pair[1]]); + assert_eq!(ids(&r["alone"]), [far]); + assert_eq!(top_level(&s), [g[8], far, pair[1]]); + assert!(matches!(&s.doc().unwrap().doc.node(far).unwrap().kind, NodeKind::Path { live: Some(_), .. }), "untouched"); + let mut selected = s.doc().unwrap().selection.objects.to_vec(); + selected.sort(); + let mut want = vec![g[8], pair[1], far]; + want.sort(); + assert_eq!(selected, want, "the shapes and the circle left alone"); +} + +#[test] +fn keep_originals_adds_each_shape_above_its_topmost_circle() { + let mut s = session(); + let row: Vec = (0..3).map(|i| circle(&mut s, 100.0 + 25.0 * i as f64, 100.0, 10.0)).collect(); + let other = [circle(&mut s, 100.0, 200.0, 10.0), circle(&mut s, 122.0, 200.0, 10.0)]; + s.execute("paint.setFill", &json!({"ids": [row[2].0], "color": "#00ff00"})).unwrap(); + let all: Vec = row.iter().chain(&other).map(|i| i.0).collect(); + let r = s.execute(BRIDGE, &json!({"ids": all, "keepOriginals": true})).unwrap(); + let made = ids(&r["ids"]); + assert_eq!(made.len(), 2); + assert_eq!(top_level(&s), [row[0], row[1], row[2], made[0], other[0], other[1], made[1]]); + let d = &s.doc().unwrap().doc; + assert_eq!(d.node(made[0]).unwrap().appearance, d.node(row[2]).unwrap().appearance, "painted as the topmost circle"); + let b = d.node(made[0]).unwrap().path_data().unwrap().bounds().unwrap(); + assert!((b.x0 - 90.0).abs() < 1e-2 && (b.x1 - 160.0).abs() < 1e-2, "{b:?}"); +} + +#[test] +fn the_gap_form_gives_arcs_the_smaller_radius_plus_the_gap() { + let area_with = |p: Value| { + let mut s = session(); + let a = circle(&mut s, 100.0, 100.0, 10.0); + let b = circle(&mut s, 124.0, 100.0, 10.0); + let mut p = p; + p["ids"] = json!([a.0, b.0]); + let id = NodeId(s.execute(BRIDGE, &p).unwrap()["id"].as_u64().unwrap()); + area(&s, id) + }; + // Radius 10 plus a gap of 4 is 140% of 10. + let (gap, percent) = (area_with(json!({"gap": 4})), area_with(json!({"radius": 140}))); + assert!((gap - percent).abs() < 1e-9, "{gap} {percent}"); + assert!(area_with(json!({"gap": 0})) < gap && gap < area_with(json!({"gap": 20}))); +} + +#[test] +fn many_circle_and_gap_refusals() { + let mut s = session(); + let a = circle(&mut s, 50.0, 100.0, 10.0); + let b = circle(&mut s, 250.0, 100.0, 10.0); + let c = circle(&mut s, 330.0, 100.0, 10.0); + let far = circle(&mut s, 380.0, 100.0, 10.0); + let before = top_level(&s); + let steps = s.doc().unwrap().history.undo.len(); + assert!(err(&mut s, json!({"ids": [a.0, b.0], "radius": 100, "gap": 4})).contains("give `radius` or `gap`, not both")); + // Centers 200 apart: a gap of 0 does not bridge them, the largest (1000 pt) does. With centers + // 330 apart even that one closes the neck: it stays open only below 2 × √(10² + 2 × 10 × 1010) + // ≈ 285. + assert!(err(&mut s, json!({"ids": [a.0, b.0], "gap": 0})).ends_with("too far apart for this gap: raise the gap")); + assert!(err(&mut s, json!({"ids": [a.0, far.0], "gap": 0})).ends_with("the circles are too far apart for this gap")); + assert!(err(&mut s, json!({"ids": [a.0, b.0, c.0], "reach": 5})).contains("no two circles are within reach: raise the reach")); + // b and c are 60 apart: within a reach of 100, but too far for the default radius. + assert!(err(&mut s, json!({"ids": [a.0, b.0, c.0], "reach": 100})).ends_with("too far apart for this radius: raise the radius")); + assert!(err(&mut s, json!({"ids": [a.0, b.0, c.0], "reach": -1})).contains("`reach` must be from 0 to 10000")); + assert!(err(&mut s, json!({"ids": [a.0, b.0], "gap": 1001})).contains("`gap` must be from 0 to 1000")); + assert_eq!(top_level(&s), before); + assert_eq!(s.doc().unwrap().history.undo.len(), steps, "nothing changed, no undo step"); +} + +#[test] +fn too_many_circles_or_bridges_are_refused() { + let mut s = session(); + // 130 overlapping circles in a row: 8,385 pairs within reach. + let row: Vec = (0..130).map(|i| circle(&mut s, 20.0 + i as f64 * 0.2, 100.0, 10.0).0).collect(); + assert!(err(&mut s, json!({ "ids": row })).contains("that makes too many bridges (at most 8000): lower the reach")); + let many: Vec = (0..2001).map(|i| circle(&mut s, 20.0 + (i % 50) as f64 * 7.0, 150.0 + (i / 50) as f64 * 3.0, 1.0).0).collect(); + assert!(err(&mut s, json!({ "ids": many })).contains("select at most 2000 circles to bridge")); +} + +#[test] +fn an_id_given_twice_is_one_circle() { + let mut s = session(); + let a = circle(&mut s, 100.0, 100.0, 20.0); + let b = circle(&mut s, 150.0, 100.0, 20.0); + let r = s.execute(BRIDGE, &json!({"ids": [a.0, a.0, b.0]})).unwrap(); + assert_eq!(r["id"], json!(b.0), "two circles, bridged"); + assert_eq!(top_level(&s), [b]); +} + +#[test] +fn small_circles_at_the_default_reach_bridge_the_pairs_the_arcs_can_join() { + let mut s = session(); + // Radius 3: arcs of 3 pt (100%) join a and b (2 apart) but close before reaching c (6 from b, + // within the default reach of 10). + let (a, b, c) = (circle(&mut s, 100.0, 100.0, 3.0), circle(&mut s, 108.0, 100.0, 3.0), circle(&mut s, 120.0, 100.0, 3.0)); + let r = s.execute(BRIDGE, &json!({"ids": [a.0, b.0, c.0]})).unwrap(); + assert_eq!(ids(&r["ids"]), [b]); + assert_eq!(ids(&r["alone"]), [c]); + assert_eq!(top_level(&s), [b, c]); +} + #[test] fn locked_and_hidden_circles_are_not_bridged() { let mut s = session(); @@ -176,9 +331,9 @@ fn locked_and_hidden_circles_are_not_bridged() { let b = circle(&mut s, 150.0, 100.0, 20.0); select(&mut s, &[b]); s.execute("object.lock", &json!({})).unwrap(); - assert!(err(&mut s, json!({"ids": [a.0, b.0]})).contains("select two circles to bridge")); + assert!(err(&mut s, json!({"ids": [a.0, b.0]})).contains("select two or more circles to bridge")); s.execute("object.unlockAll", &json!({})).unwrap(); select(&mut s, &[a]); s.execute("object.hide", &json!({})).unwrap(); - assert!(err(&mut s, json!({"ids": [a.0, b.0]})).contains("select two circles to bridge")); + assert!(err(&mut s, json!({"ids": [a.0, b.0]})).contains("select two or more circles to bridge")); } diff --git a/crates/engine/src/cmd/params.rs b/crates/engine/src/cmd/params.rs index fdf7dd4b19..098bd473de 100644 --- a/crates/engine/src/cmd/params.rs +++ b/crates/engine/src/cmd/params.rs @@ -258,7 +258,8 @@ pub fn check_keys(id: &str, doc: &'static str, params: &Value) -> Result<()> { /// Parameters a command takes instead of one another: (command, key, other key). Giving both, /// neither null, is a parameter error ([`check_exclusive_keys`]). -const EXCLUSIVE_KEYS: &[(&str, &str, &str)] = &[("addon.pathtools.cornerSet", "items", "ids"), ("addon.pathtools.cornerRemove", "items", "ids")]; +const EXCLUSIVE_KEYS: &[(&str, &str, &str)] = + &[("addon.pathtools.cornerSet", "items", "ids"), ("addon.pathtools.cornerRemove", "items", "ids"), ("addon.pathtools.bridge", "radius", "gap")]; /// `params` of command `id` give at most one of each pair in [`EXCLUSIVE_KEYS`], or the parameter /// error naming the pair. diff --git a/crates/engine/tests/command_sweep.rs b/crates/engine/tests/command_sweep.rs index 42286f2efd..b3c11f1c0f 100644 --- a/crates/engine/tests/command_sweep.rs +++ b/crates/engine/tests/command_sweep.rs @@ -990,6 +990,8 @@ fn structured_junk() { ("addon.pathtools.bridge", json!({"radius": 1e-308, "keepOriginals": "x"})), ("addon.pathtools.bridge", json!({"radius": 1000, "keepOriginals": true, "ids": [0, 1, 2, 3, u64::MAX]})), ("addon.pathtools.bridge", json!({"radius": f64::MAX, "ids": [1, 1], "junk": [0]})), + ("addon.pathtools.bridge", json!({"gap": -1e308, "reach": f64::MAX, "ids": [0, 1, 2]})), + ("addon.pathtools.bridge", json!({"gap": 1000, "reach": 10000, "radius": null, "keepOriginals": true})), // Refused before anything is written: no format of that name, a time that is no time. ("addon.document.saveTimestampedCopy", json!({"format": "png", "folder": 7})), ("addon.document.saveTimestampedCopy", json!({"format": "svg", "time": [1e308], "folder": null})), diff --git a/crates/pathops/src/addons/pathtools.rs b/crates/pathops/src/addons/pathtools.rs index fb3cf15520..6e7ac43bb6 100644 --- a/crates/pathops/src/addons/pathtools.rs +++ b/crates/pathops/src/addons/pathtools.rs @@ -4,7 +4,8 @@ //! tool shows over a path, open paths lengthened or shortened at an end ([`extend`]), the places //! where paths cross ([`crossings`]), the stretches between them ([`spans`]), anchors slid along //! their path ([`slide`]), touching edges merged ([`shared_edge`]), paths divided into dashes -//! ([`divide_dashes`]), two circles joined by a smooth bridge ([`smooth_bridge`]) and the +//! ([`divide_dashes`]), two circles joined by a smooth bridge ([`smooth_bridge`]) or many circles +//! joined to their neighbors ([`bridge_many`]) and the //! Parametric Shape Tool's shapes ([`shapes`]). mod bridge; @@ -23,7 +24,9 @@ use std::collections::BTreeSet; use kurbo::{CubicBez, ParamCurve, ParamCurveArclen, ParamCurveNearest, Point, Vec2}; use vectorcraft_geom::{Anchor, AnchorKind, PathData, SubPath}; -pub use bridge::{BridgeError, Circle, circle_of, smooth_bridge}; +pub use bridge::{ + ArcRadius, BridgeError, Bridged, Circle, Joined, MAX_BRIDGED_CIRCLES, MAX_BRIDGES, ManyError, bridge_many, circle_of, smooth_bridge, +}; pub use crossings::{MAX_CROSSED_BY_SEGMENTS, MAX_CROSSING_SEGMENTS, Place, Work, crossings, crossings_on, crossings_on_within, insert_at}; pub use dashes::{DashSpec, Piece, divide_dashes}; pub use extend::{ExtendMode, extend_length_to, extend_open}; diff --git a/crates/pathops/src/addons/pathtools/bridge.rs b/crates/pathops/src/addons/pathtools/bridge.rs index d30c0ce87a..89cee8977b 100644 --- a/crates/pathops/src/addons/pathtools/bridge.rs +++ b/crates/pathops/src/addons/pathtools/bridge.rs @@ -1,10 +1,14 @@ //! Smooth Bridge: two circles joined into one outline by two concave arcs, each touching both -//! circles from outside, so the outline runs on smoothly from each circle into the bridge. +//! circles from outside, so the outline runs on smoothly from each circle into the bridge; and +//! many circles joined at once, each to the others within reach ([`bridge_many`]). +use std::collections::{BTreeMap, HashMap, HashSet}; use std::f64::consts::{FRAC_PI_2, PI, TAU}; use kurbo::{CubicBez, ParamCurve, Point, Shape, Vec2}; -use vectorcraft_geom::{Anchor, AnchorKind, PathData, SubPath}; +use vectorcraft_geom::{Anchor, AnchorKind, FillRule, PathData, SubPath, shapes}; + +use crate::boolean::{DEFAULT_PRECISION, try_unite_all_with}; /// How far (as a share of the radius) a path's outline may stray from a circle and still be read /// as that circle. @@ -63,6 +67,58 @@ pub fn circle_of(path: &PathData) -> Option { /// a tangent there. Overlapping and touching circles are joined too. A larger radius makes a wider, /// gentler bridge; farther apart circles make a narrower one, until the arcs would cross. pub fn smooth_bridge(a: Circle, b: Circle, radius: f64) -> Result { + let t = touches(a, b, radius)?; + let mut segs = vec![]; + arc(&mut segs, a.center, a.radius, t.a1, t.a2, Some(-t.u)); + arc(&mut segs, t.p2, radius, t.a2, t.b2, None); + arc(&mut segs, b.center, b.radius, t.b2, t.b1, Some(t.u)); + arc(&mut segs, t.p1, radius, t.b1, t.a1, None); + Ok(closed(&segs, AnchorKind::Smooth)) +} + +/// The part of [`smooth_bridge`]'s outline between the circles: the two arcs, joined across each +/// circle by a straight line between the arc ends on it. Each line lies inside its circle, so the +/// two circles and this shape unite into the outline, with each circle drawn once however many +/// bridges it has. +fn neck(a: Circle, b: Circle, radius: f64) -> Result { + let t = touches(a, b, radius)?; + let line = |p: Point, q: Point| CubicBez::new(p, p, q, q); + let mut segs = vec![]; + arc(&mut segs, t.p2, radius, t.a2, t.b2, None); + segs.push(line(t.b2, t.b1)); + arc(&mut segs, t.p1, radius, t.b1, t.a1, None); + segs.push(line(t.a1, t.a2)); + Ok(closed(&segs, AnchorKind::Corner)) +} + +/// A closed subpath through the cubics `segs`, each starting where the one before it ends, with +/// anchors of `kind`. +fn closed(segs: &[CubicBez], kind: AnchorKind) -> SubPath { + let count = segs.len(); + let anchors = (0..count) + .filter_map(|i| { + let (prev, seg) = (segs.get((i + count - 1) % count)?, segs.get(i)?); + Some(Anchor { p: seg.p0, h_in: prev.p2, h_out: seg.p1, kind }) + }) + .collect(); + SubPath::new(anchors, true) +} + +/// Where the arcs of radius `radius` that bridge circles `a` and `b` lie: the unit vector from +/// `a`'s center to `b`'s, and on each side the arc's center (`p1`, `p2`) and where it touches `a` +/// and `b`. +struct Touches { + u: Vec2, + p1: Point, + a1: Point, + b1: Point, + p2: Point, + a2: Point, + b2: Point, +} + +/// The arcs of [`smooth_bridge`], or why there are none. +fn touches(a: Circle, b: Circle, radius: f64) -> Result { let finite = |x: f64| x.is_finite() && x > 0.0; let points = [a.center, b.center].iter().all(|c| c.x.is_finite() && c.y.is_finite()); if !finite(radius) || !finite(a.radius) || !finite(b.radius) || !points { @@ -81,6 +137,10 @@ pub fn smooth_bridge(a: Circle, b: Circle, radius: f64) -> Result Result f64 { + let r = a.radius.min(b.radius); + match self { + ArcRadius::Share(share) => r * share, + ArcRadius::Gap(gap) => r + gap, + } + } +} + +/// Circles that bridges join into one shape: their indices, ascending, and the shape's outline. +#[derive(Clone, Debug, PartialEq)] +pub struct Joined { + pub members: Vec, + pub outline: PathData, +} + +/// What [`bridge_many`] makes: the joined shapes, in the order of their first member, and the +/// indices of the circles left alone, ascending. +#[derive(Clone, Debug, Default, PartialEq)] +pub struct Bridged { + pub joined: Vec, + pub alone: Vec, +} + +/// Why [`bridge_many`] makes nothing. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum ManyError { + /// More than [`MAX_BRIDGED_CIRCLES`] circles. + TooManyCircles, + /// More than [`MAX_BRIDGES`] pairs of circles within reach that the arcs can bridge. + TooManyBridges, + /// No two circles are within reach of each other. + NoneInReach, + /// The circles at these indices are within reach but [`smooth_bridge`] can't join them: one is + /// inside the other, or no pair within reach is near enough for the arcs (the first such pair). + Pair(usize, usize, BridgeError), + /// A reach that is not a finite size of 0 or more, or a circle that is not a finite size above 0. + Bad, + /// A joined shape too complex to unite. + TooComplex, +} + +/// Every pair of `circles` whose outlines are at most `reach` (pt) apart, overlapping ones +/// included, joined by a [`smooth_bridge`] with arcs of radius `arc`, and the bridges that connect +/// united into one shape each, without holes smaller than 1% of the smallest circle's area. A pair +/// too far apart for the arcs gets no bridge; a circle bridged to no other is left alone. One +/// circle inside another is an error, and so is no pair that the arcs can join. +pub fn bridge_many(circles: &[Circle], arc: ArcRadius, reach: f64) -> Result { + if circles.len() > MAX_BRIDGED_CIRCLES { + return Err(ManyError::TooManyCircles); + } + let fine = |c: &Circle| c.center.x.is_finite() && c.center.y.is_finite() && c.radius.is_finite() && c.radius > 0.0; + if !(reach.is_finite() && reach >= 0.0) || !circles.iter().all(fine) { + return Err(ManyError::Bad); + } + let (pairs, too_far) = pairs_within(circles, reach, arc)?; + match (pairs.is_empty(), too_far) { + (true, Some((i, j))) => return Err(ManyError::Pair(i, j, BridgeError::TooFar)), + (true, None) => return Err(ManyError::NoneInReach), + (false, _) => {} + } + // Each set of connected circles, under its lowest index. + let mut parent: Vec = (0..circles.len()).collect(); + let mut necks = Vec::with_capacity(pairs.len()); + for &(i, j) in &pairs { + let (a, b) = (circles[i], circles[j]); + let sp = neck(a, b, arc.between(a, b)).map_err(|e| ManyError::Pair(i, j, e))?; + necks.push(((i, j), PathData::single(sp))); + let (ri, rj) = (root(&mut parent, i), root(&mut parent, j)); + parent[ri.max(rj)] = ri.min(rj); + } + let mut sets: BTreeMap, Vec<&PathData>)> = BTreeMap::new(); + for &((i, j), ref neck) in &necks { + let (members, parts) = sets.entry(root(&mut parent, i)).or_default(); + members.extend([i, j]); + parts.push(neck); + } + let mut out = Bridged::default(); + for (_, (mut members, parts)) in sets { + members.sort_unstable(); + members.dedup(); + // Each circle once, and the necks between them. + let rounds: Vec = members + .iter() + .filter_map(|&i| circles.get(i)) + .map(|c| shapes::ellipse(kurbo::Rect::from_center_size(c.center, (2.0 * c.radius, 2.0 * c.radius)))) + .collect(); + let fills: Vec<(&PathData, FillRule)> = rounds.iter().chain(parts).map(|p| (p, FillRule::NonZero)).collect(); + let smallest = members.iter().filter_map(|&i| circles.get(i)).map(|c| c.radius).fold(f64::INFINITY, f64::min); + // Fine enough for the smallest circle, whose bridges are narrower than it. + let precision = DEFAULT_PRECISION.min(smallest * 1e-3); + let mut outline = try_unite_all_with(&fills, precision).map_err(|_| ManyError::TooComplex)?; + // Where three bridges' arcs nearly meet, the union leaves a speck of a hole; a contour that + // encloses a circle is far larger than this. + let speck = SPECK * PI * smallest * smallest; + outline.subpaths.retain(|sp| PathData::single(sp.clone()).to_bezpath().area().abs() >= speck); + out.joined.push(Joined { members, outline }); + } + let joined: HashSet = necks.iter().flat_map(|&((i, j), _)| [i, j]).collect(); + out.alone = (0..circles.len()).filter(|i| !joined.contains(i)).collect(); + Ok(out) +} + +/// Two circles' indices, the lower first. +type Pair = (usize, usize); + +/// The set `i` is in: the lowest index in it, with the path to it shortened on the way. +fn root(parent: &mut [usize], mut i: usize) -> usize { + while parent[i] != i { + parent[i] = parent[parent[i]]; + i = parent[i]; + } + i +} + +/// Every pair of indices `(i, j)`, `i < j`, ascending, of `circles` whose outlines are at most +/// `reach` apart and that arcs of `arc` can bridge, and the lowest pair within reach that they +/// can't because it is too far apart for them. Circles go into a grid of cells as wide as the +/// farthest two centers within reach can be, so each circle is compared only with those in its own +/// cell and the eight around it. +fn pairs_within(circles: &[Circle], reach: f64, arc: ArcRadius) -> Result<(Vec, Option), ManyError> { + let biggest = circles.iter().map(|c| c.radius).fold(0.0, f64::max); + let cell = 2.0 * biggest + reach; + if !(cell.is_finite() && cell > 0.0) { + return Err(ManyError::Bad); + } + // Saturating casts: a cell beyond i64 shares the last one, which only adds comparisons. + let key = |p: Point| ((p.x / cell).floor() as i64, (p.y / cell).floor() as i64); + let mut grid: HashMap<(i64, i64), Vec> = HashMap::new(); + for (i, c) in circles.iter().enumerate() { + grid.entry(key(c.center)).or_default().push(i); + } + let (mut pairs, mut too_far) = (vec![], None::); + for (i, &c) in circles.iter().enumerate() { + let (x, y) = key(c.center); + for (dx, dy) in (-1..=1).flat_map(|dx| (-1..=1).map(move |dy| (dx, dy))) { + let Some(near) = grid.get(&(x.saturating_add(dx), y.saturating_add(dy))) else { continue }; + for &j in near.iter().filter(|&&j| j > i) { + let o = circles[j]; + if c.center.distance(o.center) - c.radius - o.radius > reach { + continue; + } + // Only the arcs' ends are worked out here; the bridge itself is made later. + match touches(c, o, arc.between(c, o)) { + Ok(_) => pairs.push((i, j)), + Err(BridgeError::TooFar) => too_far = Some(too_far.map_or((i, j), |t| t.min((i, j)))), + Err(e) => return Err(ManyError::Pair(i, j, e)), + } + } + } + // Saturated cells can list a pair twice, so the count is checked again after `dedup`. + if pairs.len() > 9 * MAX_BRIDGES { + return Err(ManyError::TooManyBridges); + } + } + pairs.sort_unstable(); + pairs.dedup(); + if pairs.len() > MAX_BRIDGES { + return Err(ManyError::TooManyBridges); + } + Ok((pairs, too_far)) } /// Append to `out` the arc of the circle about `center` with radius `r` from `from` to `to` (both @@ -321,6 +553,188 @@ mod tests { assert_eq!(smooth_bridge(a, b, 0.0), Err(BridgeError::Bad)); assert_eq!(smooth_bridge(a, b, f64::NAN), Err(BridgeError::Bad)); assert_eq!(smooth_bridge(circle(f64::INFINITY, 0.0, 10.0), b, 10.0), Err(BridgeError::Bad)); + // Finite sizes whose squares overflow. + assert_eq!(smooth_bridge(circle(0.0, 0.0, 1e154), circle(1e154, 0.0, 1e154), 1e154), Err(BridgeError::Bad)); + } + + /// A 3 × 3 grid of circles of radius 10, 4 apart (centers 24 apart), top-left at the origin. + fn grid() -> Vec { + (0..9).map(|k| circle(24.0 * (k % 3) as f64, 24.0 * (k / 3) as f64, 10.0)).collect() + } + + fn area(path: &PathData) -> f64 { + crate::area(path, FillRule::NonZero) + } + + fn inside(path: &PathData, x: f64, y: f64) -> bool { + path.to_bezpath().winding(Point::new(x, y)) != 0 + } + + #[test] + fn a_grid_joins_each_circle_to_its_neighbors_within_reach() { + // Reach 5: the side neighbors (4 apart) are joined, the diagonal ones (about 13.9 apart) not. + let b = bridge_many(&grid(), ArcRadius::Gap(4.0), 5.0).unwrap(); + assert_eq!(b.alone, Vec::::new()); + let [one] = b.joined.as_slice() else { panic!("{} shapes", b.joined.len()) }; + assert_eq!(one.members, (0..9).collect::>()); + for (x, y) in [(12.0, 0.0), (0.0, 12.0), (36.0, 48.0), (48.0, 36.0), (24.0, 24.0)] { + assert!(inside(&one.outline, x, y), "bridged at ({x}, {y})"); + } + // Between four circles the side bridges' arcs leave a hole: no diagonal bridge fills it. + for (x, y) in [(12.0, 12.0), (36.0, 36.0)] { + assert!(!inside(&one.outline, x, y), "a hole at ({x}, {y})"); + } + let hull = PathData::single(SubPath::polyline( + &[Point::new(-10.0, -10.0), Point::new(58.0, -10.0), Point::new(58.0, 58.0), Point::new(-10.0, 58.0)], + true, + )); + assert!(area(&one.outline) < area(&hull)); + assert_eq!(one.outline.subpaths.len(), 5, "the outline and a hole in each square"); + // Reach 15 takes in the diagonal neighbors too, and their bridges fill the middle of each + // square. The specks of holes (about 0.1 pt²) where side and diagonal arcs nearly meet are + // filled. + let b = bridge_many(&grid(), ArcRadius::Gap(4.0), 15.0).unwrap(); + let [one] = b.joined.as_slice() else { panic!("{} shapes", b.joined.len()) }; + assert!(inside(&one.outline, 12.0, 12.0) && inside(&one.outline, 36.0, 36.0)); + assert_eq!(one.outline.subpaths.len(), 1); + } + + #[test] + fn a_circle_with_no_neighbor_in_reach_is_left_alone() { + let mut circles = grid(); + circles.truncate(2); + circles.push(circle(200.0, 0.0, 10.0)); + circles.push(circle(224.0, 0.0, 10.0)); + circles.push(circle(100.0, 100.0, 10.0)); + let b = bridge_many(&circles, ArcRadius::Share(1.0), 5.0).unwrap(); + assert_eq!(b.joined.iter().map(|j| j.members.clone()).collect::>(), [vec![0, 1], vec![2, 3]]); + assert_eq!(b.alone, [4]); + // Each pair alone is the two-circle bridge. + let two = smooth_bridge(circles[0], circles[1], 10.0).unwrap(); + let (got, want) = (area(&b.joined[0].outline), area(&PathData::single(two))); + assert!((got - want).abs() < 1e-3 * want, "{got} {want}"); + } + + #[test] + fn a_ring_around_an_empty_place_leaves_a_round_hole_the_gap_wider_than_a_circle() { + // Six circles of radius 10 around an empty place at the origin, each 4 from its two + // neighbors and from where a seventh circle would be (centers 24 from the origin). + let ring: Vec = (0..6).map(|k| f64::from(k) * PI / 3.0).map(|t| circle(24.0 * t.cos(), 24.0 * t.sin(), 10.0)).collect(); + let b = bridge_many(&ring, ArcRadius::Gap(4.0), 5.0).unwrap(); + let [one] = b.joined.as_slice() else { panic!("{} shapes", b.joined.len()) }; + assert_eq!(one.members, (0..6).collect::>()); + assert_eq!(one.outline.subpaths.len(), 2, "the outline and the hole"); + // The hole's edge is 14 from the origin all the way round: a circle of radius 10 there + // would be 4 from the shape everywhere, the same as from each of the six. + let hole = one.outline.subpaths.iter().min_by(|p, q| { + let size = |sp: &SubPath| PathData::single(sp.clone()).to_bezpath().area().abs(); + size(p).total_cmp(&size(q)) + }); + let edge = outline(hole.unwrap()); + let (near, far) = edge.iter().map(|p| p.distance(Point::ZERO)).fold((f64::INFINITY, 0.0f64), |(n, f), d| (n.min(d), f.max(d))); + assert!((near - 14.0).abs() < 1e-2 && (far - 14.0).abs() < 1e-2, "{near} to {far}"); + } + + #[test] + fn many_circles_make_the_two_circle_outline_for_each_pair() { + // Overlapping, touching, unequal and unequal overlapping pairs, each with a far circle. + for (a, b, share) in [ + (circle(0.0, 0.0, 20.0), circle(30.0, 0.0, 20.0), 0.5), + (circle(0.0, 0.0, 20.0), circle(40.0, 0.0, 20.0), 0.5), + (circle(0.0, 0.0, 30.0), circle(70.0, 0.0, 10.0), 4.0), + (circle(0.0, 0.0, 10.0), circle(25.0, 0.0, 30.0), 10.0), + // Circles far smaller than the union's usual precision (0.01 pt). + (circle(0.0, 0.0, 0.004), circle(0.01, 0.0, 0.004), 1.0), + ] { + let made = bridge_many(&[a, b, circle(1000.0, 0.0, 5.0)], ArcRadius::Share(share), 40.0).unwrap(); + assert_eq!(made.alone, [2]); + let two = smooth_bridge(a, b, share * a.radius.min(b.radius)).unwrap(); + let (got, want) = (area(&made.joined[0].outline), area(&PathData::single(two))); + assert!((got - want).abs() < 1e-3 * want, "{a:?}: {got} {want}"); + } + } + + #[test] + fn a_pair_too_far_apart_for_the_arcs_gets_no_bridge() { + // b and c are within reach (6 apart) but arcs of radius 3 close before they reach both. + let (a, b, c) = (circle(0.0, 0.0, 3.0), circle(8.0, 0.0, 3.0), circle(20.0, 0.0, 3.0)); + assert_eq!(smooth_bridge(b, c, 3.0), Err(BridgeError::TooFar)); + let made = bridge_many(&[a, b, c], ArcRadius::Share(1.0), 10.0).unwrap(); + assert_eq!(made.joined.iter().map(|j| j.members.clone()).collect::>(), [vec![0, 1]]); + assert_eq!(made.alone, [2]); + // 260 touching circles in a row with a wide reach: 33,670 pairs within reach, far more than + // the bridge limit, but only the 259 touching pairs are near enough for the arcs. + let row: Vec = (0..260).map(|i| circle(f64::from(i) * 20.0, 0.0, 10.0)).collect(); + let made = bridge_many(&row, ArcRadius::Share(1.0), 6000.0).unwrap(); + let [one] = made.joined.as_slice() else { panic!("{} shapes", made.joined.len()) }; + assert_eq!(one.members.len(), 260); + assert!(made.alone.is_empty()); + } + + #[test] + fn the_gap_form_keeps_the_gap_from_a_circle_at_each_arcs_center() { + // Two circles 4 apart; with a gap of 4 each arc's center is 24 from both centers, where a + // third circle of the same size is 4 from both (as in a triangular grid). + let (a, b) = (circle(0.0, 0.0, 10.0), circle(24.0, 0.0, 10.0)); + let r = ArcRadius::Gap(4.0).between(a, b); + assert_eq!(r, 14.0); + let sp = smooth_bridge(a, b, r).unwrap(); + for third in [circle(12.0, 432f64.sqrt(), 10.0), circle(12.0, -(432f64.sqrt()), 10.0)] { + let gaps: Vec = outline(&sp).iter().map(|p| p.distance(third.center) - third.radius).collect(); + // No part of the bridge comes nearer than the gap, and a stretch of it is that gap away. + assert!(gaps.iter().all(|&g| g > 4.0 - 1e-2), "{:?}", gaps.iter().copied().fold(f64::INFINITY, f64::min)); + let along = gaps.iter().filter(|&&g| (g - 4.0).abs() < 1e-2).count(); + assert!(along >= 32, "{along}"); + } + // The same for unequal circles: the gap is kept from a circle of the smaller one's size. + let (a, b) = (circle(0.0, 0.0, 15.0), circle(30.0, 5.0, 8.0)); + let r = ArcRadius::Gap(3.0).between(a, b); + let sp = smooth_bridge(a, b, r).unwrap(); + let d = (b.center - a.center).hypot(); + let (ra, rb) = (15.0 + r, 8.0 + r); + let along = (d * d + ra * ra - rb * rb) / (2.0 * d); + let u = (b.center - a.center) / d; + let center = a.center + u * along + Vec2::new(-u.y, u.x) * (ra * ra - along * along).sqrt(); + let gaps: Vec = outline(&sp).iter().map(|p| p.distance(center) - 8.0).collect(); + assert!(gaps.iter().all(|&g| g > 3.0 - 1e-2) && gaps.iter().filter(|&&g| (g - 3.0).abs() < 1e-2).count() >= 16); + } + + #[test] + fn the_gap_form_is_the_percentage_form_of_the_radius_plus_the_gap() { + for (a, b, gap) in [(circle(0.0, 0.0, 10.0), circle(24.0, 0.0, 10.0), 4.0), (circle(0.0, 0.0, 20.0), circle(40.0, 30.0, 10.0), 7.5)] { + let small = a.radius.min(b.radius); + let share = ArcRadius::Share((small + gap) / small); + assert!((ArcRadius::Gap(gap).between(a, b) - share.between(a, b)).abs() < 1e-12); + let (g, s) = (smooth_bridge(a, b, ArcRadius::Gap(gap).between(a, b)).unwrap(), smooth_bridge(a, b, share.between(a, b)).unwrap()); + for (p, q) in g.anchors.iter().zip(&s.anchors) { + assert!(p.p.distance(q.p) < 1e-9 && p.h_in.distance(q.h_in) < 1e-9 && p.h_out.distance(q.h_out) < 1e-9); + } + assert_eq!(g.anchors.len(), s.anchors.len()); + } + // Over a grid the two forms make the same shape too. + let by_gap = bridge_many(&grid(), ArcRadius::Gap(4.0), 5.0).unwrap(); + let by_share = bridge_many(&grid(), ArcRadius::Share(1.4), 5.0).unwrap(); + let (g, s) = (area(&by_gap.joined[0].outline), area(&by_share.joined[0].outline)); + assert!((g - s).abs() < 1e-6 * g, "{g} {s}"); + } + + #[test] + fn too_many_circles_or_bridges_and_bad_pairs_are_refused() { + let many = vec![circle(0.0, 0.0, 1.0); MAX_BRIDGED_CIRCLES + 1]; + assert_eq!(bridge_many(&many, ArcRadius::Share(1.0), 1.0), Err(ManyError::TooManyCircles)); + // 200 circles in a tight row: 19,900 pairs within reach. + let row: Vec = (0..200).map(|i| circle(i as f64 * 0.1, 0.0, 10.0)).collect(); + assert_eq!(bridge_many(&row, ArcRadius::Share(1.0), 1.0), Err(ManyError::TooManyBridges)); + let spread: Vec = (0..3).map(|i| circle(i as f64 * 100.0, 0.0, 10.0)).collect(); + assert_eq!(bridge_many(&spread, ArcRadius::Share(1.0), 5.0), Err(ManyError::NoneInReach)); + let nested = [circle(0.0, 0.0, 30.0), circle(5.0, 0.0, 10.0), circle(200.0, 0.0, 10.0)]; + assert_eq!(bridge_many(&nested, ArcRadius::Share(1.0), 5.0), Err(ManyError::Pair(0, 1, BridgeError::Inside))); + // Within reach (40 apart) but too far for arcs of radius 1. + let far = [circle(0.0, 0.0, 10.0), circle(60.0, 0.0, 10.0), circle(300.0, 0.0, 10.0)]; + assert_eq!(bridge_many(&far, ArcRadius::Share(0.1), 50.0), Err(ManyError::Pair(0, 1, BridgeError::TooFar))); + assert_eq!(bridge_many(&far, ArcRadius::Share(1.0), f64::NAN), Err(ManyError::Bad)); + assert_eq!(bridge_many(&far, ArcRadius::Share(1.0), -1.0), Err(ManyError::Bad)); + assert_eq!(bridge_many(&[circle(f64::INFINITY, 0.0, 1.0), far[0]], ArcRadius::Share(1.0), 1.0), Err(ManyError::Bad)); } #[test] diff --git a/crates/ui-egui/src/addons/pathtools/bridge.rs b/crates/ui-egui/src/addons/pathtools/bridge.rs index 4b9926d616..5d6a18d282 100644 --- a/crates/ui-egui/src/addons/pathtools/bridge.rs +++ b/crates/ui-egui/src/addons/pathtools/bridge.rs @@ -1,6 +1,7 @@ //! Smooth Bridge in the interface: its dialog (the arcs' radius as a percentage of the smaller -//! circle's radius, Keep Originals), which previews on the canvas and runs `addon.pathtools.bridge` -//! on OK. +//! circle's radius, or with Constant Gap that radius plus a gap; the reach, unavailable with two +//! circles selected; Keep Originals), which previews on the canvas and runs +//! `addon.pathtools.bridge` on OK. use egui::Ui; use serde_json::{Value, json}; @@ -16,27 +17,61 @@ pub const KIND: &str = "smoothBridge"; /// The radius the command takes (%), and its default. const RADII: std::ops::RangeInclusive = 1.0..=1000.0; const RADIUS: f64 = 100.0; +/// The gap the command takes (pt), and the dialog's first one. +const GAPS: std::ops::RangeInclusive = 0.0..=1000.0; +const GAP: f64 = 4.0; +/// The reach the command takes (pt), and its default. +const REACHES: std::ops::RangeInclusive = 0.0..=10000.0; +const REACH: f64 = 10.0; const LABEL_W: f32 = 60.0; const FIELD_W: f32 = 90.0; /// The dialog's fields to start with: the command's defaults. pub(crate) fn fields() -> Value { - json!({ "radius": RADIUS, "keepOriginals": false }) + json!({ "radius": RADIUS, "constantGap": false, "gap": GAP, "reach": REACH, "keepOriginals": false }) } pub(crate) const SPEC: DialogSpec = DialogSpec { heading: |_| tl!("Smooth Bridge").to_string(), body, confirm, preview: true, min_width: 280.0, ..DialogSpec::FORM }; -/// The command's parameters from the dialog's fields. +/// The command's parameters from the dialog's fields: the radius, or with Constant Gap the gap. fn params(d: &Dialog) -> Value { - json!({ "radius": d.f64("radius", RADIUS), "keepOriginals": d.bool("keepOriginals") }) + let (reach, keep) = (d.f64("reach", REACH), d.bool("keepOriginals")); + if d.bool("constantGap") { + json!({ "gap": d.f64("gap", GAP), "reach": reach, "keepOriginals": keep }) + } else { + json!({ "radius": d.f64("radius", RADIUS), "reach": reach, "keepOriginals": keep }) + } } fn body(app: &mut VectorcraftApp, ui: &mut Ui, d: &mut Dialog) -> bool { - widgets::label_row(ui, tl!("Radius:"), LABEL_W, |ui| { - if let Some(v) = widgets::range_field(ui, ("dlg-num", "radius"), d.f64("radius", RADIUS), RADII, "%", 0, FIELD_W) { - d.fields.insert("radius".into(), json!(v)); + let unit = app.session.general_unit(); + form::check(ui, d, "constantGap", tl!("Constant Gap")); + if d.bool("constantGap") { + widgets::label_row(ui, tl!("Gap:"), LABEL_W, |ui| { + form::length_within(ui, d, "gap", unit, FIELD_W, Some(GAPS)); + }); + } else { + widgets::label_row(ui, tl!("Radius:"), LABEL_W, |ui| { + if let Some(v) = widgets::range_field(ui, ("dlg-num", "radius"), d.f64("radius", RADIUS), RADII, "%", 0, FIELD_W) { + d.fields.insert("radius".into(), json!(v)); + } + }); + } + // The reach applies to three or more circles; two are bridged at any distance. Counted once, + // before a preview replaces the selection with its result. + let many = match d.fields.get("many").and_then(Value::as_bool) { + Some(many) => many, + None => { + let many = app.session.doc().map(|doc| doc.selection.objects.len() > 2).unwrap_or(true); + d.fields.insert("many".into(), json!(many)); + many } + }; + ui.add_enabled_ui(many, |ui| { + widgets::label_row(ui, tl!("Reach:"), LABEL_W, |ui| { + form::length_within(ui, d, "reach", unit, FIELD_W, Some(REACHES)); + }); }); form::check(ui, d, "keepOriginals", tl!("Keep Originals")); form::preview(app, ui, d, "Smooth Bridge", COMMAND, params(d)); @@ -72,9 +107,11 @@ mod tests { menus::invoke(&mut app, &cmd, p); assert_eq!(app.ui.dialog.as_ref().map(|d| d.kind.as_str()), Some(super::KIND)); let shown = painted_text(&mut app, |app, ui| crate::dialogs::show(app, ui.ctx())); - for s in ["Smooth Bridge", "Radius:", "Keep Originals", "Preview"] { + for s in ["Smooth Bridge", "Constant Gap", "Radius:", "Reach:", "Keep Originals", "Preview"] { assert!(shown.contains(s), "{s} in {shown}"); } + assert!(!shown.contains("Gap:"), "{shown}"); + assert!(!app.ui.dialog.as_ref().unwrap().bool("many"), "Reach unavailable for two circles"); let count = |app: &VectorcraftApp| app.session.doc().unwrap().doc.layers[0].children().unwrap().len(); app.ui.dialog.as_mut().unwrap().fields.insert("preview".into(), json!(true)); painted_text(&mut app, |app, ui| crate::dialogs::show(app, ui.ctx())); @@ -89,4 +126,30 @@ mod tests { assert_eq!(app.session.doc().unwrap().history.undo.len(), n + 1); assert_eq!(count(&app), 3, "the circles and the outline above them"); } + + #[test] + fn constant_gap_shows_the_gap_and_bridges_many_circles_within_reach() { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.run("file.new", json!({"width": 400, "height": 300})).unwrap(); + // Three circles 4 apart in a row and one far off. + let ids: Vec = [100.0, 124.0, 148.0, 300.0].iter().map(|&x| circle(&mut app, x, 10.0)).collect(); + app.run("select.set", json!({ "ids": ids })).unwrap(); + menus::invoke(&mut app, super::COMMAND, serde_json::Value::Null); + let d = app.ui.dialog.as_mut().unwrap(); + d.fields.insert("constantGap".into(), json!(true)); + let shown = painted_text(&mut app, |app, ui| crate::dialogs::show(app, ui.ctx())); + assert!(shown.contains("Gap:") && !shown.contains("Radius:"), "{shown}"); + // A preview leaves two objects selected (one shape and the far circle); Reach stays + // available for the four circles the command still bridges. + app.ui.dialog.as_mut().unwrap().fields.insert("preview".into(), json!(true)); + painted_text(&mut app, |app, ui| crate::dialogs::show(app, ui.ctx())); + painted_text(&mut app, |app, ui| crate::dialogs::show(app, ui.ctx())); + assert_eq!(app.session.doc().unwrap().selection.objects.len(), 2, "previewed"); + assert!(app.ui.dialog.as_ref().unwrap().bool("many"), "Reach available for four circles"); + let p = super::params(app.ui.dialog.as_ref().unwrap()); + assert_eq!(p, json!({"gap": 4.0, "reach": 10.0, "keepOriginals": false}), "the gap, not the radius"); + crate::dialogs::confirm(&mut app).unwrap(); + let top: Vec = app.session.doc().unwrap().doc.layers[0].children().unwrap().iter().map(|n| n.id.0).collect(); + assert_eq!(top, [ids[2], ids[3]], "one shape in the topmost joined circle's place, and the far circle"); + } } diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index c02d223cc5..47dcc1b925 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -6730,10 +6730,18 @@ breakText Glyphs Глифи Smooth Bridge… Плавен мост… Smooth Bridge Плавен мост Keep Originals Запазване на оригиналите -@msg select two circles to bridge изберете два кръга за свързване +@msg select two or more circles to bridge изберете два или повече кръга за свързване @msg one circle is inside the other единият кръг е вътре в другия @msg the circles are too far apart for this radius: raise the radius кръговете са твърде далеч един от друг за този радиус: увеличете радиуса @msg the circles are too far apart for this radius кръговете са твърде далеч един от друг за този радиус + Constant Gap Постоянно разстояние + Reach: Обхват: +@msg the circles are too far apart for this gap: raise the gap кръговете са твърде далеч един от друг за това разстояние: увеличете разстоянието +@msg the circles are too far apart for this gap кръговете са твърде далеч един от друг за това разстояние +@msg no two circles are within reach: raise the reach няма два кръга в обхват: увеличете обхвата +@msg select at most 2000 circles to bridge изберете най-много 2000 кръга за свързване +@msg that makes too many bridges (at most 8000): lower the reach това дава твърде много мостове (най-много 8000): намалете обхвата +@msg the bridged circles are too complex to unite свързаните кръгове са твърде сложни за обединяване # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Разширяване на тиретата в пътища @msg select paths with dashed strokes to expand изберете пътища с прекъснат щрих за разширяване diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index a12ad12217..ae6efda00e 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -6782,10 +6782,18 @@ shape Open Otvoren Smooth Bridge… Glatki most… Smooth Bridge Glatki most Keep Originals Zadrži originale -@msg select two circles to bridge odaberite dva kruga za premošćavanje +@msg select two or more circles to bridge odaberite dva ili više krugova za premošćavanje @msg one circle is inside the other jedan krug je unutar drugog @msg the circles are too far apart for this radius: raise the radius krugovi su predaleko jedan od drugog za ovaj radijus: povećajte radijus @msg the circles are too far apart for this radius krugovi su predaleko jedan od drugog za ovaj radijus + Constant Gap Stalni razmak + Reach: Domet: +@msg the circles are too far apart for this gap: raise the gap krugovi su predaleko jedan od drugog za ovaj razmak: povećajte razmak +@msg the circles are too far apart for this gap krugovi su predaleko jedan od drugog za ovaj razmak +@msg no two circles are within reach: raise the reach nijedna dva kruga nisu u dometu: povećajte domet +@msg select at most 2000 circles to bridge odaberite najviše 2000 krugova za premošćavanje +@msg that makes too many bridges (at most 8000): lower the reach to daje previše mostova (najviše 8000): smanjite domet +@msg the bridged circles are too complex to unite premošteni krugovi su previše složeni za spajanje # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Proširi crtice u putanje @msg select paths with dashed strokes to expand odaberite putanje s isprekidanim potezom za proširivanje diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 3331879355..f203d1c391 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -7362,10 +7362,18 @@ breakText Glyphs Glifs Smooth Bridge… Pont suau… Smooth Bridge Pont suau Keep Originals Conserva els originals -@msg select two circles to bridge seleccioneu dos cercles per unir-los +@msg select two or more circles to bridge seleccioneu dos o més cercles per unir-los @msg one circle is inside the other un cercle és dins de l’altre @msg the circles are too far apart for this radius: raise the radius els cercles estan massa separats per a aquest radi: augmenteu el radi @msg the circles are too far apart for this radius els cercles estan massa separats per a aquest radi + Constant Gap Separació constant + Reach: Abast: +@msg the circles are too far apart for this gap: raise the gap els cercles estan massa separats per a aquesta separació: augmenteu la separació +@msg the circles are too far apart for this gap els cercles estan massa separats per a aquesta separació +@msg no two circles are within reach: raise the reach no hi ha dos cercles dins de l’abast: augmenteu l’abast +@msg select at most 2000 circles to bridge seleccioneu com a màxim 2000 cercles per unir-los +@msg that makes too many bridges (at most 8000): lower the reach això fa massa ponts (com a màxim 8000): reduïu l’abast +@msg the bridged circles are too complex to unite els cercles units són massa complexos per combinar-los # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Expandeix els guions en camins @msg select paths with dashed strokes to expand seleccioneu camins amb traç discontinu per expandir diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 2414401f14..93298b77d3 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -7366,10 +7366,18 @@ breakText Glyphs Glyfy Smooth Bridge… Hladký most… Smooth Bridge Hladký most Keep Originals Zachovat originály -@msg select two circles to bridge vyberte dva kruhy k propojení +@msg select two or more circles to bridge vyberte dva nebo více kruhů k propojení @msg one circle is inside the other jeden kruh je uvnitř druhého @msg the circles are too far apart for this radius: raise the radius kruhy jsou pro tento poloměr příliš daleko od sebe: zvětšete poloměr @msg the circles are too far apart for this radius kruhy jsou pro tento poloměr příliš daleko od sebe + Constant Gap Stálá mezera + Reach: Dosah: +@msg the circles are too far apart for this gap: raise the gap kruhy jsou pro tuto mezeru příliš daleko od sebe: zvětšete mezeru +@msg the circles are too far apart for this gap kruhy jsou pro tuto mezeru příliš daleko od sebe +@msg no two circles are within reach: raise the reach žádné dva kruhy nejsou v dosahu: zvětšete dosah +@msg select at most 2000 circles to bridge vyberte nejvýše 2000 kruhů k propojení +@msg that makes too many bridges (at most 8000): lower the reach to dává příliš mnoho mostů (nejvýše 8000): zmenšete dosah +@msg the bridged circles are too complex to unite propojené kruhy jsou příliš složité na sloučení # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Rozložit čárky na cesty @msg select paths with dashed strokes to expand vyberte cesty s čárkovaným tahem k rozložení diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 15937fb835..60b4e7ba73 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -7415,10 +7415,18 @@ breakText Glyphs Glyffer Smooth Bridge… Blød bro… Smooth Bridge Blød bro Keep Originals Behold originaler -@msg select two circles to bridge vælg to cirkler, der skal forbindes +@msg select two or more circles to bridge vælg to eller flere cirkler, der skal forbindes @msg one circle is inside the other den ene cirkel er inden i den anden @msg the circles are too far apart for this radius: raise the radius cirklerne er for langt fra hinanden til denne radius: gør radius større @msg the circles are too far apart for this radius cirklerne er for langt fra hinanden til denne radius + Constant Gap Konstant afstand + Reach: Rækkevidde: +@msg the circles are too far apart for this gap: raise the gap cirklerne er for langt fra hinanden til denne afstand: gør afstanden større +@msg the circles are too far apart for this gap cirklerne er for langt fra hinanden til denne afstand +@msg no two circles are within reach: raise the reach ingen to cirkler er inden for rækkevidde: gør rækkevidden større +@msg select at most 2000 circles to bridge vælg højst 2000 cirkler, der skal forbindes +@msg that makes too many bridges (at most 8000): lower the reach det giver for mange broer (højst 8000): gør rækkevidden mindre +@msg the bridged circles are too complex to unite de forbundne cirkler er for komplekse til at blive samlet # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Udvid streger til stier @msg select paths with dashed strokes to expand vælg stier med stiplet streg, der skal udvides diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 03edf98a47..c96832b28d 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -6957,10 +6957,18 @@ breakText Glyphs Glyphen Smooth Bridge… Weiche Brücke… Smooth Bridge Weiche Brücke Keep Originals Originale beibehalten -@msg select two circles to bridge wählen Sie zwei Kreise zum Verbinden aus +@msg select two or more circles to bridge wählen Sie zwei oder mehr Kreise zum Verbinden aus @msg one circle is inside the other ein Kreis liegt im anderen @msg the circles are too far apart for this radius: raise the radius die Kreise liegen für diesen Radius zu weit auseinander: vergrößern Sie den Radius @msg the circles are too far apart for this radius die Kreise liegen für diesen Radius zu weit auseinander + Constant Gap Konstanter Abstand + Reach: Reichweite: +@msg the circles are too far apart for this gap: raise the gap die Kreise liegen für diesen Abstand zu weit auseinander: vergrößern Sie den Abstand +@msg the circles are too far apart for this gap die Kreise liegen für diesen Abstand zu weit auseinander +@msg no two circles are within reach: raise the reach keine zwei Kreise liegen in Reichweite: vergrößern Sie die Reichweite +@msg select at most 2000 circles to bridge wählen Sie höchstens 2000 Kreise zum Verbinden aus +@msg that makes too many bridges (at most 8000): lower the reach das ergibt zu viele Brücken (höchstens 8000): verringern Sie die Reichweite +@msg the bridged circles are too complex to unite die verbundenen Kreise sind zu komplex zum Vereinen # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Striche in Pfade umwandeln @msg select paths with dashed strokes to expand wählen Sie Pfade mit gestrichelter Kontur zum Umwandeln aus diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 95c95ebb07..37d7874dc4 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -7335,10 +7335,18 @@ breakText Glyphs Γλύφοι Smooth Bridge… Ομαλή γέφυρα… Smooth Bridge Ομαλή γέφυρα Keep Originals Διατήρηση πρωτοτύπων -@msg select two circles to bridge επιλέξτε δύο κύκλους για γεφύρωση +@msg select two or more circles to bridge επιλέξτε δύο ή περισσότερους κύκλους για γεφύρωση @msg one circle is inside the other ο ένας κύκλος βρίσκεται μέσα στον άλλο @msg the circles are too far apart for this radius: raise the radius οι κύκλοι απέχουν πολύ μεταξύ τους για αυτή την ακτίνα: αυξήστε την ακτίνα @msg the circles are too far apart for this radius οι κύκλοι απέχουν πολύ μεταξύ τους για αυτή την ακτίνα + Constant Gap Σταθερή απόσταση + Reach: Εμβέλεια: +@msg the circles are too far apart for this gap: raise the gap οι κύκλοι απέχουν πολύ μεταξύ τους για αυτή την απόσταση: αυξήστε την απόσταση +@msg the circles are too far apart for this gap οι κύκλοι απέχουν πολύ μεταξύ τους για αυτή την απόσταση +@msg no two circles are within reach: raise the reach δεν υπάρχουν δύο κύκλοι εντός εμβέλειας: αυξήστε την εμβέλεια +@msg select at most 2000 circles to bridge επιλέξτε έως 2000 κύκλους για γεφύρωση +@msg that makes too many bridges (at most 8000): lower the reach αυτό δημιουργεί πάρα πολλές γέφυρες (έως 8000): μειώστε την εμβέλεια +@msg the bridged circles are too complex to unite οι γεφυρωμένοι κύκλοι είναι πολύ σύνθετοι για ένωση # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Επέκταση παυλών σε διαδρομές @msg select paths with dashed strokes to expand επιλέξτε διαδρομές με διακεκομμένο περίγραμμα για επέκταση diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index c8efe22c3f..19129e08c6 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -7323,10 +7323,18 @@ breakText Glyphs Glifos Smooth Bridge… Puente suave… Smooth Bridge Puente suave Keep Originals Conservar originales -@msg select two circles to bridge seleccione dos círculos para unir +@msg select two or more circles to bridge seleccione dos o más círculos para unir @msg one circle is inside the other un círculo está dentro del otro @msg the circles are too far apart for this radius: raise the radius los círculos están demasiado separados para este radio: aumente el radio @msg the circles are too far apart for this radius los círculos están demasiado separados para este radio + Constant Gap Separación constante + Reach: Alcance: +@msg the circles are too far apart for this gap: raise the gap los círculos están demasiado separados para esta separación: aumente la separación +@msg the circles are too far apart for this gap los círculos están demasiado separados para esta separación +@msg no two circles are within reach: raise the reach no hay dos círculos dentro del alcance: aumente el alcance +@msg select at most 2000 circles to bridge seleccione como máximo 2000 círculos para unir +@msg that makes too many bridges (at most 8000): lower the reach eso crea demasiados puentes (como máximo 8000): reduzca el alcance +@msg the bridged circles are too complex to unite los círculos unidos son demasiado complejos para combinarlos # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Expandir guiones en trazados @msg select paths with dashed strokes to expand seleccione trazados con trazo discontinuo para expandir diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 2360844d2d..80bd584ac2 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -7411,10 +7411,18 @@ breakText Glyphs Merkit Smooth Bridge… Pehmeä silta… Smooth Bridge Pehmeä silta Keep Originals Säilytä alkuperäiset -@msg select two circles to bridge valitse kaksi yhdistettävää ympyrää +@msg select two or more circles to bridge valitse vähintään kaksi yhdistettävää ympyrää @msg one circle is inside the other toinen ympyrä on toisen sisällä @msg the circles are too far apart for this radius: raise the radius ympyrät ovat liian kaukana toisistaan tälle säteelle: suurenna sädettä @msg the circles are too far apart for this radius ympyrät ovat liian kaukana toisistaan tälle säteelle + Constant Gap Vakioväli + Reach: Ulottuvuus: +@msg the circles are too far apart for this gap: raise the gap ympyrät ovat liian kaukana toisistaan tälle välille: suurenna väliä +@msg the circles are too far apart for this gap ympyrät ovat liian kaukana toisistaan tälle välille +@msg no two circles are within reach: raise the reach mitkään kaksi ympyrää eivät ole ulottuvilla: suurenna ulottuvuutta +@msg select at most 2000 circles to bridge valitse enintään 2000 yhdistettävää ympyrää +@msg that makes too many bridges (at most 8000): lower the reach siitä tulee liikaa siltoja (enintään 8000): pienennä ulottuvuutta +@msg the bridged circles are too complex to unite yhdistetyt ympyrät ovat liian monimutkaisia koottaviksi yhdeksi muodoksi # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Laajenna viivat poluiksi @msg select paths with dashed strokes to expand valitse laajennettavat polut, joissa on katkoviiva diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index fc5bdc4a41..e22e233840 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -7361,10 +7361,18 @@ breakText Glyphs Glyphes Smooth Bridge… Pont lissé… Smooth Bridge Pont lissé Keep Originals Conserver les originaux -@msg select two circles to bridge sélectionnez deux cercles à relier +@msg select two or more circles to bridge sélectionnez au moins deux cercles à relier @msg one circle is inside the other un cercle est à l’intérieur de l’autre @msg the circles are too far apart for this radius: raise the radius les cercles sont trop éloignés pour ce rayon : augmentez le rayon @msg the circles are too far apart for this radius les cercles sont trop éloignés pour ce rayon + Constant Gap Écart constant + Reach: Portée : +@msg the circles are too far apart for this gap: raise the gap les cercles sont trop éloignés pour cet écart : augmentez l’écart +@msg the circles are too far apart for this gap les cercles sont trop éloignés pour cet écart +@msg no two circles are within reach: raise the reach aucun couple de cercles n’est à portée : augmentez la portée +@msg select at most 2000 circles to bridge sélectionnez au plus 2000 cercles à relier +@msg that makes too many bridges (at most 8000): lower the reach cela crée trop de ponts (au plus 8000) : réduisez la portée +@msg the bridged circles are too complex to unite les cercles reliés sont trop complexes pour être réunis # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Décomposer les tirets en tracés @msg select paths with dashed strokes to expand sélectionnez des tracés à contour pointillé à décomposer diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index 972d2a2c50..efd5f80a48 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -702,6 +702,7 @@ Constrain મર્યાદિત કરો Constrain Angle ખૂણો મર્યાદિત કરો Constrain Width and Height Proportions પહોળાઈ અને ઊંચાઈનો પ્રમાણ મર્યાદિત કરો + Constant Gap સ્થિર ગેપ Construction Guides બાંધકામ ગાઇડ્સ Contextual Alternates સંદર્ભિત વૈકલ્પિક અક્ષરો Contextual Task Bar સંદર્ભિત ટાસ્ક બાર @@ -2857,6 +2858,7 @@ Rating: રેટિંગ: Ratio ગુણોત્તર Rays કિરણો + Reach: પહોંચ: Read Action Set File ક્રિયા સેટ ફાઇલ વાંચો Read Shortcut Set File શોર્ટકટ સેટ ફાઇલ વાંચો Read files you open in its format and make documents from them તમે ખોલો તે ફાઇલોને તેના ફોર્મેટમાં વાંચો અને તેમાંથી દસ્તાવેજ બનાવો diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 544d82a416..7467d75acf 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -1014,6 +1014,7 @@ antiAlias Sharp शार्प Connect Selected End Points सिलेक्टेड एंड पॉइंट्स कनेक्ट करें Consider Open Filled Paths as Closed बंद के रूप में ओपन भरा पाथ पर विचार करें Consolidate All Windows सभी विंडो एक साथ लाएँ + Constant Gap स्थिर गैप Constrain सीमित करें Constrain Angle कंस्ट्रेन एंगल Constrain Width and Height Proportions चौड़ाई और ऊंचाई का अनुपात बनाए रखें @@ -3838,6 +3839,7 @@ antiAlias Sharp शार्प Rating: रेटिंग: Ratio अनुपात Rays रे + Reach: पहुँच: Read Action Set File एक्शन सेट फ़ाइल पढ़ें Read Shortcut Set File शॉर्टकट सेट फ़ाइल पढ़ें Reads or sets environment variables एनवायरनमेंट वेरिएबल्स पढ़ता है या सेट करता है @@ -7757,6 +7759,7 @@ antiAlias Sharp शार्प @msg Offset Path: select paths ऑफसेट पाथ: सिलेक्शन पाथ @msg Offset Path: the offset leaves nothing of the selected paths (an inset larger than the shapes) ऑफसेट पाथ: ऑफ़सेट सिलेक्टेड पाथ की कुछ भी नहीं छोड़ता है (आकार की तुलना में एक निर्धारित बड़ा) @msg Offset Path: the path is too complex to offset ऑफसेट पाथ: पाथ ऑफसेट करने के लिए बहुत जटिल है +@msg no two circles are within reach: raise the reach कोई भी दो वृत्त पहुँच के भीतर नहीं हैं: पहुँच बढ़ाएँ @msg on must be true or false on को true या false होना चाहिए @msg one circle is inside the other एक वृत्त दूसरे के अंदर है @msg only a dock group above or below others collapses, not one beside another केवल दूसरों के ऊपर या नीचे एक डॉक समूह गिर जाता है, एक दूसरे के बगल में नहीं @@ -8019,6 +8022,7 @@ antiAlias Sharp शार्प @msg select artwork to make a group of its colours अपने रंगों का एक समूह बनाने के लिए आर्टवर्क सिलेक्ट करें @msg select artwork to recolour, or give a colour `group` रंग बदलने के लिए आर्टवर्क चुनें या रंग `group` दें @msg select at least two objects कम से कम दो ऑब्जेक्ट चुनें +@msg select at most 2000 circles to bridge जोड़ने के लिए अधिकतम 2000 वृत्त चुनें @msg Select dimensions to update अद्यतन करने के लिए आयाम सिलेक्ट करें @msg select exactly two objects वास्तव में दो ऑब्जेक्ट चुनें @msg select exactly two path ends to join जोड़ने के लिए ठीक दो पाथ एंड पॉइंट्स सिलेक्ट करें @@ -8067,7 +8071,7 @@ antiAlias Sharp शार्प @msg select the objects to attach to the path ऑब्जेक्ट्स का सिलेक्ट करने के लिए संलग्न करने के लिए पाथ @msg select the objects to bind ऑब्जेक्ट्स को बांधने के लिए चुनें @msg select the objects to transform in perspective ऑब्जेक्ट्स को पर्सपेक्टिव में बदलने के लिए चुनें -@msg select two circles to bridge जोड़ने के लिए दो वृत्त चुनें +@msg select two or more circles to bridge जोड़ने के लिए दो या अधिक वृत्त चुनें @msg select two open path ends, or two open paths, to average and join औसत निकालकर जोड़ने के लिए दो खुले पाथ एंड पॉइंट्स या दो खुले पाथ सिलेक्ट करें @msg select two or more graphic styles to merge दो या अधिक ग्राफिक स्टाइल्स का सिलेक्ट करने के लिए विलय @msg select two or more objects to distribute वितरित करने के लिए दो या दो से अधिक ऑब्जेक्ट चुनें @@ -8144,6 +8148,7 @@ antiAlias Sharp शार्प @msg the active document changed while the question was open; nothing was deleted प्रश्न खुला रहते हुए सक्रिय डॉक्यूमेंट बदल गया; कुछ भी नहीं हटाया गया @msg that document is no longer open यह डॉक्यूमेंट अब खुला नहीं है @msg that makes more than {MAX_PIECES} slices जो {MAX_PIECES} स्लाइस से अधिक बनाता है +@msg that makes too many bridges (at most 8000): lower the reach इससे बहुत अधिक ब्रिज बनते हैं (अधिकतम 8000): पहुँच घटाएँ @msg that makes too many pieces (at most 100000): make the dashes longer जो बहुत सारे टुकड़े बनाता है (अधिकांश 100000 में): डैश को लंबे समय तक बनाते हैं @msg that object is not in the overlap उस ऑब्जेक्ट को ओवरलैप में नहीं है @msg the {tool} tool has no options {tool} टूल में कोई ऑप्शन्स नहीं है @@ -8232,7 +8237,10 @@ antiAlias Sharp शार्प @msg the artboards don't fit on the canvas: fewer artboards, less spacing or a smaller size आर्टबोर्ड कैनवास पर फिट नहीं हैं: कम आर्टबोर्ड, कम रिक्ति या छोटे आकार @msg the background worker stopped पृष्ठभूमि कार्यकर्ता बंद कर दिया @msg the blend has no spine मिश्रण में कोई रीढ़ नहीं है +@msg the bridged circles are too complex to unite जोड़े गए वृत्त मिलाने के लिए बहुत जटिल हैं @msg the character's size can't be measured कैरेक्टर का आकार मापा नहीं जा सकता है +@msg the circles are too far apart for this gap इस गैप के लिए वृत्त एक-दूसरे से बहुत दूर हैं +@msg the circles are too far apart for this gap: raise the gap इस गैप के लिए वृत्त एक-दूसरे से बहुत दूर हैं: गैप बढ़ाएँ @msg the circles are too far apart for this radius इस त्रिज्या के लिए वृत्त एक-दूसरे से बहुत दूर हैं @msg the circles are too far apart for this radius: raise the radius इस त्रिज्या के लिए वृत्त एक-दूसरे से बहुत दूर हैं: त्रिज्या बढ़ाएँ @msg the CMYK image couldn't be written CMYK इमेज को नहीं लिखा जा सकता diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 2e844865bc..d386463076 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -7351,10 +7351,18 @@ breakText Glyphs Glifák Smooth Bridge… Sima híd… Smooth Bridge Sima híd Keep Originals Eredetik megtartása -@msg select two circles to bridge jelöljön ki két kört az összekötéshez +@msg select two or more circles to bridge jelöljön ki legalább két kört az összekötéshez @msg one circle is inside the other az egyik kör a másikon belül van @msg the circles are too far apart for this radius: raise the radius a körök túl messze vannak egymástól ehhez a sugárhoz: növelje a sugarat @msg the circles are too far apart for this radius a körök túl messze vannak egymástól ehhez a sugárhoz + Constant Gap Állandó hézag + Reach: Hatótávolság: +@msg the circles are too far apart for this gap: raise the gap a körök túl messze vannak egymástól ehhez a hézaghoz: növelje a hézagot +@msg the circles are too far apart for this gap a körök túl messze vannak egymástól ehhez a hézaghoz +@msg no two circles are within reach: raise the reach nincs két kör hatótávolságon belül: növelje a hatótávolságot +@msg select at most 2000 circles to bridge legfeljebb 2000 kört jelöljön ki az összekötéshez +@msg that makes too many bridges (at most 8000): lower the reach ez túl sok hidat eredményez (legfeljebb 8000): csökkentse a hatótávolságot +@msg the bridged circles are too complex to unite az összekötött körök túl összetettek az egyesítéshez # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Szaggatások kibontása útvonalakká @msg select paths with dashed strokes to expand jelöljön ki szaggatott körvonalú útvonalakat a kibontáshoz diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index 1c1778af25..e1d304f9e8 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -6745,10 +6745,18 @@ breakText Glyphs Glif Smooth Bridge… Jembatan Halus… Smooth Bridge Jembatan Halus Keep Originals Pertahankan Asli -@msg select two circles to bridge pilih dua lingkaran untuk dijembatani +@msg select two or more circles to bridge pilih dua lingkaran atau lebih untuk dijembatani @msg one circle is inside the other satu lingkaran berada di dalam lingkaran lainnya @msg the circles are too far apart for this radius: raise the radius lingkaran terlalu berjauhan untuk radius ini: perbesar radius @msg the circles are too far apart for this radius lingkaran terlalu berjauhan untuk radius ini + Constant Gap Celah Tetap + Reach: Jangkauan: +@msg the circles are too far apart for this gap: raise the gap lingkaran terlalu berjauhan untuk celah ini: perbesar celah +@msg the circles are too far apart for this gap lingkaran terlalu berjauhan untuk celah ini +@msg no two circles are within reach: raise the reach tidak ada dua lingkaran dalam jangkauan: perbesar jangkauan +@msg select at most 2000 circles to bridge pilih paling banyak 2000 lingkaran untuk dijembatani +@msg that makes too many bridges (at most 8000): lower the reach itu membuat terlalu banyak jembatan (paling banyak 8000): perkecil jangkauan +@msg the bridged circles are too complex to unite lingkaran yang dijembatani terlalu rumit untuk disatukan # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Perluas garis putus menjadi jalur @msg select paths with dashed strokes to expand pilih jalur dengan stroke putus-putus yang akan diperluas diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 08149bf5b9..d662cc1bac 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -6993,10 +6993,18 @@ breakText Glyphs Glifi Smooth Bridge… Ponte morbido… Smooth Bridge Ponte morbido Keep Originals Mantieni originali -@msg select two circles to bridge seleziona due cerchi da unire +@msg select two or more circles to bridge seleziona due o più cerchi da unire @msg one circle is inside the other un cerchio è dentro l’altro @msg the circles are too far apart for this radius: raise the radius i cerchi sono troppo distanti per questo raggio: aumenta il raggio @msg the circles are too far apart for this radius i cerchi sono troppo distanti per questo raggio + Constant Gap Distanza costante + Reach: Portata: +@msg the circles are too far apart for this gap: raise the gap i cerchi sono troppo lontani per questa distanza: aumenta la distanza +@msg the circles are too far apart for this gap i cerchi sono troppo lontani per questa distanza +@msg no two circles are within reach: raise the reach nessuna coppia di cerchi è entro la portata: aumenta la portata +@msg select at most 2000 circles to bridge seleziona al massimo 2000 cerchi da unire +@msg that makes too many bridges (at most 8000): lower the reach così si creano troppi ponti (al massimo 8000): riduci la portata +@msg the bridged circles are too complex to unite i cerchi uniti sono troppo complessi da fondere # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Espandi trattini in tracciati @msg select paths with dashed strokes to expand seleziona tracciati con traccia tratteggiata da espandere diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 63d4f273e2..f69bcf3bc9 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -8870,10 +8870,18 @@ breakText Glyphs 字形 Smooth Bridge… スムーズブリッジ… Smooth Bridge スムーズブリッジ Keep Originals オリジナルを保持 -@msg select two circles to bridge ブリッジでつなぐ円を 2 つ選択してください +@msg select two or more circles to bridge ブリッジでつなぐ円を 2 つ以上選択してください @msg one circle is inside the other 一方の円がもう一方の円の内側にあります @msg the circles are too far apart for this radius: raise the radius この半径では円が離れすぎています:半径を大きくしてください @msg the circles are too far apart for this radius この半径では円が離れすぎています + Constant Gap 一定の間隔 + Reach: 到達距離: +@msg the circles are too far apart for this gap: raise the gap この間隔では円が離れすぎています:間隔を大きくしてください +@msg the circles are too far apart for this gap この間隔では円が離れすぎています +@msg no two circles are within reach: raise the reach 到達距離内にある円の組がありません:到達距離を大きくしてください +@msg select at most 2000 circles to bridge ブリッジでつなぐ円は 2000 個以下で選択してください +@msg that makes too many bridges (at most 8000): lower the reach ブリッジが多すぎます(最大 8000):到達距離を小さくしてください +@msg the bridged circles are too complex to unite ブリッジでつないだ円が複雑すぎて合体できません # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths 破線をパスに拡張 @msg select paths with dashed strokes to expand 拡張する破線のパスを選択してください diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 754a5e5400..7f035abf30 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -9482,10 +9482,18 @@ breakText Glyphs გლიფები Smooth Bridge… გლუვი ხიდი… Smooth Bridge გლუვი ხიდი Keep Originals ორიგინალების შენარჩუნება -@msg select two circles to bridge აირჩიეთ ორი წრე დასაკავშირებლად +@msg select two or more circles to bridge აირჩიეთ ორი ან მეტი წრე დასაკავშირებლად @msg one circle is inside the other ერთი წრე მეორის შიგნითაა @msg the circles are too far apart for this radius: raise the radius ამ რადიუსისთვის წრეები ერთმანეთისგან ძალიან შორსაა: გაზარდეთ რადიუსი @msg the circles are too far apart for this radius ამ რადიუსისთვის წრეები ერთმანეთისგან ძალიან შორსაა + Constant Gap მუდმივი ღრეჩო + Reach: მიწვდომა: +@msg the circles are too far apart for this gap: raise the gap ამ ღრეჩოსთვის წრეები ერთმანეთისგან ძალიან შორსაა: გაზარდეთ ღრეჩო +@msg the circles are too far apart for this gap ამ ღრეჩოსთვის წრეები ერთმანეთისგან ძალიან შორსაა +@msg no two circles are within reach: raise the reach არცერთი ორი წრე არ არის მიწვდომის ფარგლებში: გაზარდეთ მიწვდომა +@msg select at most 2000 circles to bridge აირჩიეთ არაუმეტეს 2000 წრე დასაკავშირებლად +@msg that makes too many bridges (at most 8000): lower the reach ეს ძალიან ბევრ ხიდს ქმნის (არაუმეტეს 8000): შეამცირეთ მიწვდომა +@msg the bridged circles are too complex to unite დაკავშირებული წრეები ძალიან რთულია გასაერთიანებლად # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths ტირეების ტრაექტორიებად გაშლა @msg select paths with dashed strokes to expand აირჩიეთ გასაშლელი ტირეებიანი ხაზის კონტურები diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 6a87fcbba7..38db9b6000 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -6957,10 +6957,18 @@ breakText Glyphs 글리프 Smooth Bridge… 부드러운 브리지… Smooth Bridge 부드러운 브리지 Keep Originals 원본 유지 -@msg select two circles to bridge 연결할 원 두 개를 선택하십시오 +@msg select two or more circles to bridge 연결할 원을 두 개 이상 선택하십시오 @msg one circle is inside the other 한 원이 다른 원 안에 있습니다 @msg the circles are too far apart for this radius: raise the radius 이 반경에서는 원이 너무 멀리 떨어져 있습니다. 반경을 늘리십시오 @msg the circles are too far apart for this radius 이 반경에서는 원이 너무 멀리 떨어져 있습니다 + Constant Gap 일정한 간격 + Reach: 도달 거리: +@msg the circles are too far apart for this gap: raise the gap 이 간격에서는 원이 너무 멀리 떨어져 있습니다. 간격을 늘리십시오 +@msg the circles are too far apart for this gap 이 간격에서는 원이 너무 멀리 떨어져 있습니다 +@msg no two circles are within reach: raise the reach 도달 거리 안에 있는 두 원이 없습니다. 도달 거리를 늘리십시오 +@msg select at most 2000 circles to bridge 연결할 원을 2000개 이하로 선택하십시오 +@msg that makes too many bridges (at most 8000): lower the reach 브리지가 너무 많아집니다(최대 8000개). 도달 거리를 줄이십시오 +@msg the bridged circles are too complex to unite 연결된 원이 너무 복잡하여 합칠 수 없습니다 # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths 대시를 패스로 확장 @msg select paths with dashed strokes to expand 확장할 점선 획의 패스를 선택하십시오 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 45a370bd76..f8526a466e 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -9240,10 +9240,18 @@ breakText Glyphs Glyphs Smooth Bridge… Vloeiende brug… Smooth Bridge Vloeiende brug Keep Originals Originelen behouden -@msg select two circles to bridge selecteer twee cirkels om te verbinden +@msg select two or more circles to bridge selecteer twee of meer cirkels om te verbinden @msg one circle is inside the other de ene cirkel ligt binnen de andere @msg the circles are too far apart for this radius: raise the radius de cirkels liggen te ver uit elkaar voor deze straal: vergroot de straal @msg the circles are too far apart for this radius de cirkels liggen te ver uit elkaar voor deze straal + Constant Gap Constante tussenruimte + Reach: Bereik: +@msg the circles are too far apart for this gap: raise the gap de cirkels liggen te ver uit elkaar voor deze tussenruimte: vergroot de tussenruimte +@msg the circles are too far apart for this gap de cirkels liggen te ver uit elkaar voor deze tussenruimte +@msg no two circles are within reach: raise the reach geen twee cirkels liggen binnen bereik: vergroot het bereik +@msg select at most 2000 circles to bridge selecteer hoogstens 2000 cirkels om te verbinden +@msg that makes too many bridges (at most 8000): lower the reach dat geeft te veel bruggen (hoogstens 8000): verklein het bereik +@msg the bridged circles are too complex to unite de verbonden cirkels zijn te complex om samen te voegen # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Streepjes uitbreiden tot paden @msg select paths with dashed strokes to expand selecteer paden met een streepjeslijn om uit te breiden diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 6dd5772422..23c245e8b1 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -7222,10 +7222,18 @@ breakText Glyphs Glify Smooth Bridge… Gładki most… Smooth Bridge Gładki most Keep Originals Zachowaj oryginały -@msg select two circles to bridge zaznacz dwa okręgi do połączenia +@msg select two or more circles to bridge zaznacz co najmniej dwa okręgi do połączenia @msg one circle is inside the other jeden okrąg jest wewnątrz drugiego @msg the circles are too far apart for this radius: raise the radius okręgi są zbyt daleko od siebie dla tego promienia: zwiększ promień @msg the circles are too far apart for this radius okręgi są zbyt daleko od siebie dla tego promienia + Constant Gap Stały odstęp + Reach: Zasięg: +@msg the circles are too far apart for this gap: raise the gap okręgi są zbyt daleko od siebie dla tego odstępu: zwiększ odstęp +@msg the circles are too far apart for this gap okręgi są zbyt daleko od siebie dla tego odstępu +@msg no two circles are within reach: raise the reach żadne dwa okręgi nie są w zasięgu: zwiększ zasięg +@msg select at most 2000 circles to bridge zaznacz najwyżej 2000 okręgów do połączenia +@msg that makes too many bridges (at most 8000): lower the reach to daje zbyt wiele mostów (najwyżej 8000): zmniejsz zasięg +@msg the bridged circles are too complex to unite połączone okręgi są zbyt złożone, aby je scalić # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Rozszerz kreski na ścieżki @msg select paths with dashed strokes to expand zaznacz ścieżki z przerywanym konturem do rozszerzenia diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 952535aed2..325ff1570f 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -7397,10 +7397,18 @@ breakText Glyphs Glifos Smooth Bridge… Ponte suave… Smooth Bridge Ponte suave Keep Originals Manter originais -@msg select two circles to bridge selecione dois círculos para unir +@msg select two or more circles to bridge selecione dois ou mais círculos para unir @msg one circle is inside the other um círculo está dentro do outro @msg the circles are too far apart for this radius: raise the radius os círculos estão muito afastados para este raio: aumente o raio @msg the circles are too far apart for this radius os círculos estão muito afastados para este raio + Constant Gap Distância constante + Reach: Alcance: +@msg the circles are too far apart for this gap: raise the gap os círculos estão muito afastados para esta distância: aumente a distância +@msg the circles are too far apart for this gap os círculos estão muito afastados para esta distância +@msg no two circles are within reach: raise the reach nenhum par de círculos está dentro do alcance: aumente o alcance +@msg select at most 2000 circles to bridge selecione no máximo 2000 círculos para unir +@msg that makes too many bridges (at most 8000): lower the reach isso cria pontes demais (no máximo 8000): diminua o alcance +@msg the bridged circles are too complex to unite os círculos unidos são complexos demais para combinar # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Expandir traços em demarcadores @msg select paths with dashed strokes to expand selecione demarcadores com traçado tracejado para expandir diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 2a53122c4d..9469c1db83 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -7356,10 +7356,18 @@ breakText Glyphs Глифы Smooth Bridge… Плавный мост… Smooth Bridge Плавный мост Keep Originals Сохранить оригиналы -@msg select two circles to bridge выделите две окружности для соединения +@msg select two or more circles to bridge выделите две или более окружностей для соединения @msg one circle is inside the other одна окружность находится внутри другой @msg the circles are too far apart for this radius: raise the radius окружности слишком далеко друг от друга для этого радиуса: увеличьте радиус @msg the circles are too far apart for this radius окружности слишком далеко друг от друга для этого радиуса + Constant Gap Постоянный зазор + Reach: Охват: +@msg the circles are too far apart for this gap: raise the gap окружности слишком далеко друг от друга для этого зазора: увеличьте зазор +@msg the circles are too far apart for this gap окружности слишком далеко друг от друга для этого зазора +@msg no two circles are within reach: raise the reach нет двух окружностей в пределах охвата: увеличьте охват +@msg select at most 2000 circles to bridge выделите не более 2000 окружностей для соединения +@msg that makes too many bridges (at most 8000): lower the reach получается слишком много мостов (не более 8000): уменьшите охват +@msg the bridged circles are too complex to unite соединяемые окружности слишком сложны для объединения # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Разобрать штрихи на контуры @msg select paths with dashed strokes to expand выделите контуры со штриховой обводкой для разбора diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index a9f7159b01..9b5de2988f 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -7382,10 +7382,18 @@ breakText Glyphs Glyfer Smooth Bridge… Mjuk brygga… Smooth Bridge Mjuk brygga Keep Originals Behåll original -@msg select two circles to bridge markera två cirklar att förbinda +@msg select two or more circles to bridge markera två eller fler cirklar att förbinda @msg one circle is inside the other den ena cirkeln ligger inuti den andra @msg the circles are too far apart for this radius: raise the radius cirklarna ligger för långt ifrån varandra för den här radien: öka radien @msg the circles are too far apart for this radius cirklarna ligger för långt ifrån varandra för den här radien + Constant Gap Konstant mellanrum + Reach: Räckvidd: +@msg the circles are too far apart for this gap: raise the gap cirklarna ligger för långt ifrån varandra för det här mellanrummet: öka mellanrummet +@msg the circles are too far apart for this gap cirklarna ligger för långt ifrån varandra för det här mellanrummet +@msg no two circles are within reach: raise the reach inga två cirklar ligger inom räckvidd: öka räckvidden +@msg select at most 2000 circles to bridge markera högst 2000 cirklar att förbinda +@msg that makes too many bridges (at most 8000): lower the reach det ger för många bryggor (högst 8000): minska räckvidden +@msg the bridged circles are too complex to unite de förbundna cirklarna är för komplexa för att slås ihop # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Expandera streck till banor @msg select paths with dashed strokes to expand markera banor med streckad kontur att expandera diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 3527e14166..0abeed0e99 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -9244,10 +9244,18 @@ breakText Glyphs Glifler Smooth Bridge… Yumuşak Köprü… Smooth Bridge Yumuşak Köprü Keep Originals Orijinalleri Koru -@msg select two circles to bridge köprüyle birleştirilecek iki daire seçin +@msg select two or more circles to bridge köprüyle birleştirilecek iki veya daha fazla daire seçin @msg one circle is inside the other bir daire diğerinin içinde @msg the circles are too far apart for this radius: raise the radius daireler bu yarıçap için birbirinden çok uzak: yarıçapı artırın @msg the circles are too far apart for this radius daireler bu yarıçap için birbirinden çok uzak + Constant Gap Sabit Boşluk + Reach: Erişim: +@msg the circles are too far apart for this gap: raise the gap daireler bu boşluk için birbirinden çok uzak: boşluğu artırın +@msg the circles are too far apart for this gap daireler bu boşluk için birbirinden çok uzak +@msg no two circles are within reach: raise the reach erişim içinde hiçbir iki daire yok: erişimi artırın +@msg select at most 2000 circles to bridge köprüyle birleştirmek için en fazla 2000 daire seçin +@msg that makes too many bridges (at most 8000): lower the reach bu çok fazla köprü oluşturur (en fazla 8000): erişimi azaltın +@msg the bridged circles are too complex to unite köprülenen daireler birleştirilemeyecek kadar karmaşık # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Tireleri Yollara Genişlet @msg select paths with dashed strokes to expand genişletilecek kesikli konturlu yolları seçin diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 6d828ad424..9debbdf5f8 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -6975,10 +6975,18 @@ breakText Glyphs Гліфи Smooth Bridge… Плавний міст… Smooth Bridge Плавний міст Keep Originals Зберегти оригінали -@msg select two circles to bridge виділіть два кола для з’єднання +@msg select two or more circles to bridge виділіть два або більше кіл для з’єднання @msg one circle is inside the other одне коло всередині іншого @msg the circles are too far apart for this radius: raise the radius кола надто далеко одне від одного для цього радіуса: збільште радіус @msg the circles are too far apart for this radius кола надто далеко одне від одного для цього радіуса + Constant Gap Сталий проміжок + Reach: Охоплення: +@msg the circles are too far apart for this gap: raise the gap кола надто далеко одне від одного для цього проміжку: збільште проміжок +@msg the circles are too far apart for this gap кола надто далеко одне від одного для цього проміжку +@msg no two circles are within reach: raise the reach жодні два кола не перебувають у межах охоплення: збільште охоплення +@msg select at most 2000 circles to bridge виділіть не більше 2000 кіл для з’єднання +@msg that makes too many bridges (at most 8000): lower the reach це дає забагато мостів (не більше 8000): зменште охоплення +@msg the bridged circles are too complex to unite з’єднані кола надто складні для об’єднання # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Розібрати штрихи на контури @msg select paths with dashed strokes to expand виділіть контури зі штриховим обведенням для розбору diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index d9999727b7..78b6fc364d 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -6992,10 +6992,18 @@ breakText Glyphs Glyph Smooth Bridge… Cầu nối mượt… Smooth Bridge Cầu nối mượt Keep Originals Giữ bản gốc -@msg select two circles to bridge chọn hai hình tròn để nối +@msg select two or more circles to bridge chọn hai hình tròn trở lên để nối @msg one circle is inside the other một hình tròn nằm bên trong hình tròn kia @msg the circles are too far apart for this radius: raise the radius các hình tròn cách nhau quá xa so với bán kính này: hãy tăng bán kính @msg the circles are too far apart for this radius các hình tròn cách nhau quá xa so với bán kính này + Constant Gap Khoảng hở cố định + Reach: Tầm với: +@msg the circles are too far apart for this gap: raise the gap các hình tròn cách nhau quá xa so với khoảng hở này: hãy tăng khoảng hở +@msg the circles are too far apart for this gap các hình tròn cách nhau quá xa so với khoảng hở này +@msg no two circles are within reach: raise the reach không có hai hình tròn nào trong tầm với: hãy tăng tầm với +@msg select at most 2000 circles to bridge chọn tối đa 2000 hình tròn để nối +@msg that makes too many bridges (at most 8000): lower the reach thao tác này tạo quá nhiều cầu nối (tối đa 8000): hãy giảm tầm với +@msg the bridged circles are too complex to unite các hình tròn được nối quá phức tạp để hợp nhất # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Mở rộng nét đứt thành đường dẫn @msg select paths with dashed strokes to expand chọn các đường dẫn có nét đứt để mở rộng diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 665b125122..da05670943 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -7207,10 +7207,18 @@ breakText Glyphs 字形 Smooth Bridge… 平滑桥接… Smooth Bridge 平滑桥接 Keep Originals 保留原稿 -@msg select two circles to bridge 请选择两个要桥接的圆 +@msg select two or more circles to bridge 请选择两个或更多要桥接的圆 @msg one circle is inside the other 一个圆位于另一个圆内部 @msg the circles are too far apart for this radius: raise the radius 对于此半径,两个圆相距太远:请增大半径 @msg the circles are too far apart for this radius 对于此半径,两个圆相距太远 + Constant Gap 固定间隙 + Reach: 范围: +@msg the circles are too far apart for this gap: raise the gap 对于此间隙,两个圆相距太远:请增大间隙 +@msg the circles are too far apart for this gap 对于此间隙,两个圆相距太远 +@msg no two circles are within reach: raise the reach 范围内没有任何两个圆:请增大范围 +@msg select at most 2000 circles to bridge 最多选择 2000 个圆进行桥接 +@msg that makes too many bridges (at most 8000): lower the reach 这会产生过多桥接(最多 8000 个):请减小范围 +@msg the bridged circles are too complex to unite 桥接的圆过于复杂,无法合并 # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths 将短划线扩展为路径 @msg select paths with dashed strokes to expand 请选择要扩展的虚线描边路径 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 1616c01b65..f20e64b7d8 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -7016,10 +7016,18 @@ breakText Glyphs 字符 Smooth Bridge… 平滑橋接… Smooth Bridge 平滑橋接 Keep Originals 保留原始物件 -@msg select two circles to bridge 請選取兩個要橋接的圓形 +@msg select two or more circles to bridge 請選取兩個或更多要橋接的圓形 @msg one circle is inside the other 一個圓形位於另一個圓形內 @msg the circles are too far apart for this radius: raise the radius 就此半徑而言,兩個圓形相距太遠:請增加半徑 @msg the circles are too far apart for this radius 就此半徑而言,兩個圓形相距太遠 + Constant Gap 固定間隙 + Reach: 範圍: +@msg the circles are too far apart for this gap: raise the gap 就此間隙而言,兩個圓形相距太遠:請增加間隙 +@msg the circles are too far apart for this gap 就此間隙而言,兩個圓形相距太遠 +@msg no two circles are within reach: raise the reach 範圍內沒有任何兩個圓形:請增加範圍 +@msg select at most 2000 circles to bridge 最多選取 2000 個圓形進行橋接 +@msg that makes too many bridges (at most 8000): lower the reach 這會產生過多橋接(最多 8000 個):請減少範圍 +@msg the bridged circles are too complex to unite 橋接的圓形過於複雜,無法合併 # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths 將短破折號展開為路徑 @msg select paths with dashed strokes to expand 請選取要展開的虛線筆畫路徑 diff --git a/docs/mcp.md b/docs/mcp.md index 7fdd7a1375..a1eb90ae8b 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -11845,18 +11845,33 @@ Commands: drawn, and the path's fills stay on it, below its dashes (a path without fills goes). A compound path's dashes are plain paths with its appearance. Paths without a dashed stroke stay as they are, and it is an error if none has one. The dashes are selected; more than 100,000 (or a pattern too fine to draw) is refused. → `{ids, dashes}`. -- `addon.pathtools.bridge {radius?, keepOriginals?, ids?}` joins two circles (`ids`, default: the selection; paths - whose outline is a circle, not hidden or locked) into one closed outline, as one undo step (Object › Plug-ins › Path - Precision Tools › Smooth Bridge…). The outline goes around each circle on its side away from the other and along two - concave arcs, one on each side of the line through the centers, each touching both circles from outside, so every - anchor is smooth. `radius` is the arcs' radius as a percentage of the smaller circle's radius (1 to 1,000, 100 by - default): a larger radius makes a wider, gentler bridge. Overlapping and touching circles are joined at every radius. - One circle inside the other is an error, and so are circles too far apart for the radius: the arcs would not reach - both circles, or would cross before they do. The error suggests a larger radius only when one up to 1,000 would - bridge the circles. The outline replaces the two circles, painted as the upper one (a plain - path), unless `keepOriginals` is true: then it goes directly above the upper circle, painted as it, and the circles - stay. The outline is selected. → `{id}`. Smooth Bridge… opens a dialog (`ui.menuDialog {command}`, kind - `smoothBridge`) with a Radius field in percent, Keep Originals and Preview. +- `addon.pathtools.bridge {radius?, gap?, reach?, keepOriginals?, ids?}` joins circles (`ids`, default: the selection; + paths whose outline is a circle, not hidden or locked) into metaball (aka meatball) shapes, as one undo step (Object › + Plug-ins › Path Precision Tools › Smooth Bridge…). Two circles become one closed outline that goes around each circle + on its side away from the other and along two concave arcs, one on each side of the line through the centers, each + touching both circles from outside, so every anchor is smooth. `radius` is the arcs' radius as a percentage of the + smaller circle's radius (1 to 1,000, 100 by default): a larger radius makes a wider, gentler bridge. `gap` (0 to 1,000 + pt) sets the arcs' radius instead to the smaller circle's radius plus the gap, so each arc stays that gap away from a + circle of the smaller circle's size about the arc's center. For equal circles that gap apart, that center is where a + third circle the gap from both would sit, as in a triangular grid, so the channels around an empty place in such a + grid are one width; in a square grid they are not. Giving both `radius` and `gap` is an error. Overlapping and + touching circles are joined at every radius. One circle inside the other is an error, and so are circles too far apart + for the radius or gap: the arcs would not reach both circles, or would cross before they do. The error suggests a + larger radius or gap only when the largest (1,000% or 1,000 pt) would bridge the circles. The outline replaces the two + circles, painted as the upper one (a plain path), unless `keepOriginals` is true: then it goes directly above the + upper circle, painted as it, and the circles stay. The outline is selected. Two circles are bridged however far apart + their outlines are; `reach` does not apply to them. + With three or more circles, every two whose outlines are at most `reach` apart (0 to 10,000 pt, 10 by default; + overlapping ones included) are bridged the same way, and the bridges that connect are united into one shape each, + which can have holes where bridges enclose space; holes smaller than 1% of the smallest circle's area are filled. A + pair within reach but too far apart for the radius or gap gets no bridge. Each shape replaces its circles, painted as + the topmost of them and in its place, or with `keepOriginals` goes directly above that circle. A circle bridged to no + other stays as it is. The shapes and the circles left as they are are selected. It is an error when any pair within + reach has one circle inside the other, when no pair within reach can be bridged (with the same suggestion of a larger + radius or gap), when no two circles are within reach, and above 2,000 circles or 8,000 bridges. → `{ids, alone}`: + the shapes and the circles left as they are, with `id` as well for two circles. Smooth Bridge… opens a dialog + (`ui.menuDialog {command}`, kind `smoothBridge`) with Constant Gap (a Gap field in place of the Radius field in + percent), Reach (unavailable with two circles selected), Keep Originals and Preview. - `addon.pathtools.cornerSet {ids?, anchors?, items?, radius, kind?, every?, minAngle?, maxAngle?}` cuts live corners, the ones Direct Selection's corner widgets and the Corners dialog edit, as one undo step. `ids` (default: the selection) are the paths and `anchors` the anchor indices of each path's outline with no corners cut; without `anchors`, a path's direct-selected diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 9b7a3bf20b..4a824d38bd 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -2458,6 +2458,8 @@ A VectorCraft addition, not a feature of the reference app, so no area score mov A VectorCraft addition, so no area score moves. Object › Plug-ins › Path Precision Tools › Smooth Bridge… (`addon.pathtools.bridge`) joins two selected circles into one closed outline, like two drops of liquid pulling apart: the outline goes around each circle on its side away from the other and along two concave arcs, one on each side, each touching both circles from outside, so the outline runs on smoothly from each circle into the bridge and every anchor is smooth. The arcs' radius is a percentage of the smaller circle's radius (1 to 1000%, 100% by default); a larger radius makes a wider, gentler bridge, and circles farther apart make a narrower one. Overlapping and touching circles are joined at every radius; one circle inside the other, or circles too far apart for the radius (the arcs would not reach both circles, or would cross), is refused with a message, which suggests a larger radius only when one up to 1000% would bridge them. The outline replaces the two circles, painted as the upper one, or with Keep Originals goes directly above the upper circle and the circles stay. One undo step; the dialog previews on the canvas. Tests: `bridge::tests` in `vectorcraft-pathops` (equal and unequal circles, overlapping and touching ones, unequal ones at large radii, the neck's width, the arcs tangent to both circles at every anchor, far apart and nested circles refused, circles told from other paths), `bridge::tests` in `cmd::addons::pathtools` in `vectorcraft-engine` (the outline in place of the circles or above them, one undo step, the radius, unequal overlapping circles up to the largest radius, refused selections and parameters with and without a larger radius suggested, locked and hidden circles), `smooth_bridge_opens_its_dialog_previews_and_runs_on_ok` in `vectorcraft-ui-egui` and `command_sweep`. Commands: `docs/mcp.md` › Path Precision Tools add-on. +Constant Gap sets the arcs' radius to the smaller circle's radius plus a gap in points (`gap`), so each arc stays that gap from a circle of the smaller circle's size about the arc's center: in a triangular grid of equal circles that gap apart, the channels around an empty place are one width. With three or more circles selected, every two whose outlines are within Reach (`reach`, 10 pt by default) are bridged, the bridges that connect are united into one shape each (holes included, except those smaller than 1% of the smallest circle's area), a pair too far apart for the radius gets no bridge, and a circle bridged to no other stays as it is; at most 2000 circles and 8000 bridges, found through a grid of cells so each circle is compared only with its near neighbors. Reach is unavailable in the dialog with two circles selected, which are bridged at any distance. Tests: `bridge::tests` in `vectorcraft-pathops` (a 3 × 3 grid joined by side neighbors only or with the diagonal ones, a ring of six around an empty place leaving a round hole the gap wider than a circle, each pair's shape the two-circle outline for overlapping, touching and unequal circles, a circle out of reach left alone, a pair too far apart for the arcs left unbridged, the gap form against the percentage form, too many circles or bridges and pairs that can't be bridged refused), `bridge::tests` in `cmd::addons::pathtools` in `vectorcraft-engine` (the grid as one shape in the topmost circle's place with its holes, one undo step, a circle left alone, small circles at the default reach, an id given twice, Keep Originals for several shapes, the gap form, refusals and their messages) and `constant_gap_shows_the_gap_and_bridges_many_circles_within_reach` in `vectorcraft-ui-egui`. + ## Document Tools add-on: Save a Timestamped Copy (2026-11-01) A VectorCraft addition, not a feature of the reference app, so no area score moves. Object › Plug-ins › Document Tools › Save a Timestamped Copy writes a copy of the document named `_YYYY-MM-DD_HH-MM.` (the date and time in UTC, through chrono; `-2`, `-3`… added when that name is taken) next to the document, or into a folder picked (the folder picker) when it was never saved, in the document's own format or another save format. It writes through File › Save a Copy's save, so the document keeps its path, title and modified state, no undo step is made, and the write stays inside the automation roots in force. It is off on the web, which has no clock. Tests: `cmd::addons::document::tests` in `vectorcraft-engine` (the name and place, numbered names, the document unchanged and its content in the copy, an unsaved document needing a folder, other formats, bad params refused, automation roots), `addons::document::tests` in `vectorcraft-ui-egui` (the submenu, beside the document, the folder picked or cancelled) and `command_sweep`. Commands: `docs/mcp.md` › Document Tools add-on. diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 86a4a10e8b..35e56b1b3a 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -481,7 +481,7 @@ next unit in the order a right-click on a ruler lists them, from Feet back to Po | Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools › Set Corners… (also a button in the Anchor Inspector's Corners section: Radius in any unit, Corner kind, Anchors: All, Odd-Numbered or Even-Numbered, counted from each path's first anchor; Angle: from … to …°, only the corners whose sides meet at an angle in that range; Preview) cuts corners on the chosen anchors of every selected path, one undo step | done | #5546, #5545; `addon.pathtools.cornerSet` (`every`, `minAngle`, `maxAngle`), `crates/ui-egui/src/addons/pathtools/set_corners.rs` and their tests; not a feature of the reference app, so it is not scored | | Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools › Trim at Crossings Tool (in the All Tools drawer under the add-on's heading, in neither toolbar as shipped, no shortcut) removes stretches of paths between the places where they are crossed, on any editable path, selected or not: a click removes the stretch under the pointer, a drag every stretch its rectangle touches, an Alt-drag every stretch its freehand line crosses; one undo step each; Escape during a drag removes nothing | done | `addon.pathtools.trim` (in `crates/engine/src/cmd/addons/pathtools/trim.rs`), `crates/tools/src/addons/trim.rs` and their tests; not a feature of the reference app, so it is not scored | | Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools › Expand Dashes into Paths turns each selected path's dashed stroke into separate open paths, one per dash, laid out as the stroke draws them (pattern, offset, Align Dashes to Corners and Path Ends), each keeping the stroke with the dashes off; one undo step | done | #4922; `addon.pathtools.expandDashes` (in `crates/engine/src/cmd/addons/pathtools.rs`, using the renderer's dash layout) and its tests; not a feature of the reference app, so it is not scored | -| Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools › Smooth Bridge… (Radius as a percentage of the smaller circle's radius, Keep Originals; Preview) joins two selected circles into one outline with two concave arcs that touch both circles, in place of the circles or above them; one undo step | done | `addon.pathtools.bridge`, `crates/pathops/src/addons/pathtools/bridge.rs`, `crates/ui-egui/src/addons/pathtools/bridge.rs` and their tests; a VectorCraft addition, so it is not scored | +| Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools › Smooth Bridge… (Radius as a percentage of the smaller circle's radius, or with Constant Gap that radius plus a gap; Reach; Keep Originals; Preview) joins two selected circles into one outline with two concave arcs that touch both circles, or three or more each to the others within reach, united where the bridges connect, in place of the circles or above them; one undo step | done | `addon.pathtools.bridge`, `crates/pathops/src/addons/pathtools/bridge.rs`, `crates/ui-egui/src/addons/pathtools/bridge.rs` and their tests; a VectorCraft addition, so it is not scored | | Path Precision Tools add-on (VectorCraft addition): Effect › Path Effects lists its live effects (Dashes to Geometry, Add Anchors, Extend Path, Close Path, Smooth Anchors, Retract Handles, Reverse Direction, Simplify Anchors, Split at Anchors), each with the effect dialog's live Preview except Reverse Direction, which has no options, and listed in the Appearance panel like any effect | done | `addon.path.*`, `crates/effects/src/addons/path.rs`, `crates/ui-egui/src/addons/pathtools.rs` and their tests; not a feature of the reference app, so it is not scored | | Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools selects its four tools (Anchor Eraser Brush, Extend Path, Measure & Inspect, Parametric Shape), which the All Tools drawer lists under their own heading but neither toolbar shows as shipped, opens the Anchor Inspector panel (the selected anchor's X/Y and handle lengths and angles as fields; Make Smooth, Make Corner, Equalize Handles, Remove Points Keep Shape, Add Points, the three ways to close) and the Parametric Shape panel (kind, count, W/H, rotation, the kind's own values and corner radius of the selected parametric shape, or of the tool's next one), and runs Add Points at / Split at Crossings and Convert to Parametric Shape; the Parametric Shape Tool draws ten re-editable kinds from the centre (↑/↓ and ←/→ change their numbers while dragging) and edits a selected one with handles; a double-click on the brush or Extend Path tool opens its options | done | `addon.pathtools.*`, `crates/tools/src/addons/`, `crates/ui-egui/src/addons/pathtools.rs`, `crates/ui-egui/src/addons/pathtools/shape.rs` and their tests; not a feature of the reference app, so it is not scored | | Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools selects its six tools (Anchor Eraser Brush, Extend Path, Measure & Inspect, Parametric Shape, Corner Tool, Slide Anchor Along Path), which the All Tools drawer lists under their own heading but neither toolbar shows as shipped, opens the Anchor Inspector panel (the selected anchor's X/Y and handle lengths and angles as fields; Make Smooth, Make Corner, Equalize Handles, Remove Points Keep Shape, Add Points, the three ways to close) and the Parametric Shape panel (kind, count, W/H, rotation, the kind's own values and corner radius of the selected parametric shape, or of the tool's next one), and runs Add Points at / Split at Crossings and Convert to Parametric Shape; the Parametric Shape Tool draws ten re-editable kinds from the centre (↑/↓ and ←/→ change their numbers while dragging) and edits a selected one with handles; the Corner Tool cuts editable corners on any path (hover shows the anchor, a click uses its radius and kind, a drag sizes the corner, Shift whole values; a corner's marker selects it and loads its values, drags to resize, to 0 or double-clicked removes it; never past what fits; Alt-marquee cuts every anchor inside) with a Corners section in the Anchor Inspector (radius, kind, selected count, Apply to Selected Anchors); Slide Anchor Along Path drags an anchor along its curve with the segments beside it refitted, Shift snapping where the tangent is a multiple of 45°; a double-click on the brush or Extend Path tool opens its options | done | `addon.pathtools.*`, `crates/tools/src/addons/`, `crates/ui-egui/src/addons/pathtools.rs`, `crates/ui-egui/src/addons/pathtools/` and their tests; not a feature of the reference app, so it is not scored | From dd8a50dbe350d1b860caa35345ab380e64fbd86c Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 19:49:25 -0800 Subject: [PATCH 016/102] Path Precision Tools: Smooth Bridge leaves necks too thin to unite unbridged With three or more circles, a pair just inside the arcs' limit can have a neck far thinner than the precision the shapes are united at, and the union could drop it while the pair still counted as joined. Each set of connected circles is now united at a precision fine enough for its smallest circle, and a pair whose neck is narrower than twice that gets no bridge, the same as a pair too far apart for the arcs. --- crates/pathops/src/addons/pathtools/bridge.rs | 78 ++++++++++++++----- 1 file changed, 57 insertions(+), 21 deletions(-) diff --git a/crates/pathops/src/addons/pathtools/bridge.rs b/crates/pathops/src/addons/pathtools/bridge.rs index 89cee8977b..dd9bdba027 100644 --- a/crates/pathops/src/addons/pathtools/bridge.rs +++ b/crates/pathops/src/addons/pathtools/bridge.rs @@ -106,8 +106,10 @@ fn closed(segs: &[CubicBez], kind: AnchorKind) -> SubPath { /// Where the arcs of radius `radius` that bridge circles `a` and `b` lie: the unit vector from /// `a`'s center to `b`'s, and on each side the arc's center (`p1`, `p2`) and where it touches `a` -/// and `b`. +/// and `b`; and the neck's width where the arcs come nearest each other between the circles +/// (infinite when that is at the circles). struct Touches { + waist: f64, u: Vec2, p1: Point, a1: Point, @@ -157,7 +159,8 @@ fn touches(a: Circle, b: Circle, radius: f64) -> Result { (p, a.center + (p - a.center) * (a.radius / ra), b.center + (p - b.center) * (b.radius / rb)) }; let ((p1, a1, b1), (p2, a2, b2)) = (side(1.0), side(-1.0)); - Ok(Touches { u, p1, a1, b1, p2, a2, b2 }) + let waist = if along > 0.0 && along < d { 2.0 * (across - radius) } else { f64::INFINITY }; + Ok(Touches { waist, u, p1, a1, b1, p2, a2, b2 }) } /// The most circles [`bridge_many`] takes. @@ -236,30 +239,50 @@ pub fn bridge_many(circles: &[Circle], arc: ArcRadius, reach: f64) -> Result= 0.0) || !circles.iter().all(fine) { return Err(ManyError::Bad); } - let (pairs, too_far) = pairs_within(circles, reach, arc)?; + let (mut pairs, mut too_far) = pairs_within(circles, reach, arc)?; + // Each set of connected circles, under its lowest index, is united at a precision fine enough + // for its smallest circle. A neck narrower than twice that would not survive the union, so its + // pair gets no bridge; that can split a set and make its precision coarser, so the sets are + // found again until no neck is dropped. + let (roots, precision) = loop { + let mut parent: Vec = (0..circles.len()).collect(); + for &((i, j), _) in &pairs { + let (ri, rj) = (root(&mut parent, i), root(&mut parent, j)); + parent[ri.max(rj)] = ri.min(rj); + } + let roots: Vec = (0..circles.len()).map(|i| root(&mut parent, i)).collect(); + let mut precision = vec![DEFAULT_PRECISION; circles.len()]; + for (&r, c) in roots.iter().zip(circles) { + precision[r] = precision[r].min(c.radius * 1e-3); + } + let thin = |&((i, _), waist): &(Pair, f64)| waist < 2.0 * precision[roots[i]]; + if !pairs.iter().any(thin) { + break (roots, precision); + } + for &(pair, _) in pairs.iter().filter(|&p| thin(p)) { + too_far = Some(too_far.map_or(pair, |t| t.min(pair))); + } + pairs.retain(|p| !thin(p)); + }; match (pairs.is_empty(), too_far) { (true, Some((i, j))) => return Err(ManyError::Pair(i, j, BridgeError::TooFar)), (true, None) => return Err(ManyError::NoneInReach), (false, _) => {} } - // Each set of connected circles, under its lowest index. - let mut parent: Vec = (0..circles.len()).collect(); let mut necks = Vec::with_capacity(pairs.len()); - for &(i, j) in &pairs { + for &((i, j), _) in &pairs { let (a, b) = (circles[i], circles[j]); let sp = neck(a, b, arc.between(a, b)).map_err(|e| ManyError::Pair(i, j, e))?; necks.push(((i, j), PathData::single(sp))); - let (ri, rj) = (root(&mut parent, i), root(&mut parent, j)); - parent[ri.max(rj)] = ri.min(rj); } let mut sets: BTreeMap, Vec<&PathData>)> = BTreeMap::new(); for &((i, j), ref neck) in &necks { - let (members, parts) = sets.entry(root(&mut parent, i)).or_default(); + let (members, parts) = sets.entry(roots[i]).or_default(); members.extend([i, j]); parts.push(neck); } let mut out = Bridged::default(); - for (_, (mut members, parts)) in sets { + for (set, (mut members, parts)) in sets { members.sort_unstable(); members.dedup(); // Each circle once, and the necks between them. @@ -270,9 +293,7 @@ pub fn bridge_many(circles: &[Circle], arc: ArcRadius, reach: f64) -> Result = rounds.iter().chain(parts).map(|p| (p, FillRule::NonZero)).collect(); let smallest = members.iter().filter_map(|&i| circles.get(i)).map(|c| c.radius).fold(f64::INFINITY, f64::min); - // Fine enough for the smallest circle, whose bridges are narrower than it. - let precision = DEFAULT_PRECISION.min(smallest * 1e-3); - let mut outline = try_unite_all_with(&fills, precision).map_err(|_| ManyError::TooComplex)?; + let mut outline = try_unite_all_with(&fills, precision[set]).map_err(|_| ManyError::TooComplex)?; // Where three bridges' arcs nearly meet, the union leaves a speck of a hole; a contour that // encloses a circle is far larger than this. let speck = SPECK * PI * smallest * smallest; @@ -286,6 +307,9 @@ pub fn bridge_many(circles: &[Circle], arc: ArcRadius, reach: f64) -> Result, Option); /// The set `i` is in: the lowest index in it, with the path to it shortened on the way. fn root(parent: &mut [usize], mut i: usize) -> usize { @@ -297,11 +321,11 @@ fn root(parent: &mut [usize], mut i: usize) -> usize { } /// Every pair of indices `(i, j)`, `i < j`, ascending, of `circles` whose outlines are at most -/// `reach` apart and that arcs of `arc` can bridge, and the lowest pair within reach that they -/// can't because it is too far apart for them. Circles go into a grid of cells as wide as the -/// farthest two centers within reach can be, so each circle is compared only with those in its own -/// cell and the eight around it. -fn pairs_within(circles: &[Circle], reach: f64, arc: ArcRadius) -> Result<(Vec, Option), ManyError> { +/// `reach` apart and that arcs of `arc` can bridge, with the width of the neck between them, and +/// the lowest pair within reach that they can't because it is too far apart for them. Circles go +/// into a grid of cells as wide as the farthest two centers within reach can be, so each circle is +/// compared only with those in its own cell and the eight around it. +fn pairs_within(circles: &[Circle], reach: f64, arc: ArcRadius) -> Result { let biggest = circles.iter().map(|c| c.radius).fold(0.0, f64::max); let cell = 2.0 * biggest + reach; if !(cell.is_finite() && cell > 0.0) { @@ -325,7 +349,7 @@ fn pairs_within(circles: &[Circle], reach: f64, arc: ArcRadius) -> Result<(Vec

pairs.push((i, j)), + Ok(t) => pairs.push(((i, j), t.waist)), Err(BridgeError::TooFar) => too_far = Some(too_far.map_or((i, j), |t| t.min((i, j)))), Err(e) => return Err(ManyError::Pair(i, j, e)), } @@ -336,8 +360,8 @@ fn pairs_within(circles: &[Circle], reach: f64, arc: ArcRadius) -> Result<(Vec

MAX_BRIDGES { return Err(ManyError::TooManyBridges); } @@ -662,6 +686,18 @@ mod tests { let made = bridge_many(&[a, b, c], ArcRadius::Share(1.0), 10.0).unwrap(); assert_eq!(made.joined.iter().map(|j| j.members.clone()).collect::>(), [vec![0, 1]]); assert_eq!(made.alone, [2]); + // Arcs of radius 10 between circles of radius 10 just under 20√3 apart leave a neck about + // 0.00003 pt wide, too thin for the union: that pair is left unbridged too. + let (a, b, c) = (circle(0.0, 0.0, 10.0), circle(34.6409, 0.0, 10.0), circle(58.6409, 0.0, 10.0)); + assert!(smooth_bridge(a, b, 10.0).is_ok(), "two circles alone are bridged"); + let made = bridge_many(&[a, b, c], ArcRadius::Share(1.0), 20.0).unwrap(); + assert_eq!(made.joined.iter().map(|j| j.members.clone()).collect::>(), [vec![1, 2]]); + assert_eq!(made.alone, [0]); + // Two tiny circles far off are united at a finer precision, which does not change that. + let tiny = [circle(500.0, 0.0, 0.01), circle(500.025, 0.0, 0.01)]; + let made = bridge_many(&[a, b, c, tiny[0], tiny[1]], ArcRadius::Share(1.0), 20.0).unwrap(); + assert_eq!(made.joined.iter().map(|j| j.members.clone()).collect::>(), [vec![1, 2], vec![3, 4]]); + assert_eq!(made.alone, [0]); // 260 touching circles in a row with a wide reach: 33,670 pairs within reach, far more than // the bridge limit, but only the 259 touching pairs are near enough for the arcs. let row: Vec = (0..260).map(|i| circle(f64::from(i) * 20.0, 0.0, 10.0)).collect(); From 4781fac16ec73801d53658747af9abe3e126241d Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 21:50:20 -0800 Subject: [PATCH 017/102] Path Precision Tools: Smooth Bridge suggests a larger radius only when it bridges among the other circles With three or more circles and no pair that can be bridged, the error suggested a larger radius or gap when the largest one bridged a single pair on its own, even when that pair's neck was still too thin to unite among the other circles. The suggestion now uses the same rules as the many-circle bridge (`bridges_any` in `vectorcraft-pathops`). The command's params text, `docs/mcp.md` and `docs/ui-parity.md` now say that a pair within reach also gets no bridge when its neck would be thinner than the precision its shape is united at. --- .../engine/src/cmd/addons/pathtools/bridge.rs | 19 ++--- .../src/cmd/addons/pathtools/bridge/tests.rs | 17 ++++ crates/pathops/src/addons/pathtools.rs | 2 +- crates/pathops/src/addons/pathtools/bridge.rs | 82 +++++++++++-------- docs/mcp.md | 7 +- docs/ui-parity.md | 2 +- 6 files changed, 82 insertions(+), 47 deletions(-) diff --git a/crates/engine/src/cmd/addons/pathtools/bridge.rs b/crates/engine/src/cmd/addons/pathtools/bridge.rs index 1c7181f43e..4d4eb9cdf8 100644 --- a/crates/engine/src/cmd/addons/pathtools/bridge.rs +++ b/crates/engine/src/cmd/addons/pathtools/bridge.rs @@ -34,7 +34,7 @@ pub(super) fn specs() -> Vec { "Smooth Bridge", ["Object", "Plug-ins", "Path Precision Tools"], None, - "{radius?: % 1..1000 (100; the radius of each bridge's two arcs as a percentage of the smaller circle's radius: larger makes a wider, gentler bridge), gap?: pt 0..1000 (instead of radius: the arcs' radius is the smaller circle's radius plus this gap, so each arc stays this gap away from a circle of the smaller circle's size about the arc's center; for equal circles this gap apart that is where a third circle this gap from both sits, as in a triangular grid, so the channels around an empty place in such a grid are one width; giving both is an error), reach?: pt 0..10000 (10; with three or more circles: how far apart two circles' outlines may be for a bridge between them, overlapping ones included; two circles are bridged at any distance), keepOriginals?: bool (false: each outline replaces its circles, painted as the topmost of them; true: it goes directly above that circle and the circles stay), ids?: [id] (default: the selection)} join circles (paths whose outline is a circle, not hidden or locked) into metaball (aka meatball) shapes. Two circles become one closed outline: around each circle on its side away from the other, and along two concave arcs, one on each side, that touch both circles so the outline runs on smoothly into them. With three or more, every two circles within reach are bridged the same way, and the bridges that connect are united into one shape each (holes smaller than 1% of the smallest circle's area are filled); a pair within reach but too far apart for the radius gets no bridge, and a circle bridged to no other is left as it is. Overlapping and touching circles are joined too. One circle inside another (among three or more, any such pair within reach) is an error; so are two circles too far apart for the radius (the arcs would not reach both, or would cross), or three or more with no pair the arcs can join, which suggests a larger radius or gap when the largest one would bridge them; so are no two circles within reach, more than 2000 circles and more than 8000 bridges. One undo step; the outlines (and the circles left as they are) are selected → {ids, alone}, with {id} too for two circles", + "{radius?: % 1..1000 (100; the radius of each bridge's two arcs as a percentage of the smaller circle's radius: larger makes a wider, gentler bridge), gap?: pt 0..1000 (instead of radius: the arcs' radius is the smaller circle's radius plus this gap, so each arc stays this gap away from a circle of the smaller circle's size about the arc's center; for equal circles this gap apart that is where a third circle this gap from both sits, as in a triangular grid, so the channels around an empty place in such a grid are one width; giving both is an error), reach?: pt 0..10000 (10; with three or more circles: how far apart two circles' outlines may be for a bridge between them, overlapping ones included; two circles are bridged at any distance), keepOriginals?: bool (false: each outline replaces its circles, painted as the topmost of them; true: it goes directly above that circle and the circles stay), ids?: [id] (default: the selection)} join circles (paths whose outline is a circle, not hidden or locked) into metaball (aka meatball) shapes. Two circles become one closed outline: around each circle on its side away from the other, and along two concave arcs, one on each side, that touch both circles so the outline runs on smoothly into them. With three or more, every two circles within reach are bridged the same way, and the bridges that connect are united into one shape each (holes smaller than 1% of the smallest circle's area are filled); a pair within reach but too far apart for the radius gets no bridge, and so does one whose neck would be thinner than the precision its shape is united at, and a circle bridged to no other is left as it is. Overlapping and touching circles are joined too. One circle inside another (among three or more, any such pair within reach) is an error; so are two circles too far apart for the radius (the arcs would not reach both, or would cross), or three or more with no pair the arcs can join, which suggests a larger radius or gap when the largest one would bridge them; so are no two circles within reach, more than 2000 circles and more than 8000 bridges. One undo step; the outlines (and the circles left as they are) are selected → {ids, alone}, with {id} too for two circles", has_selection, bridge )] @@ -80,7 +80,7 @@ fn bridge(s: &mut Session, p: &Value) -> Result { let (shapes, alone): (Vec<(Vec, PathData)>, Vec) = match only.as_slice() { [a, b] => match pt::smooth_bridge(*a, *b, arc.between(*a, *b)) { Ok(sp) => (vec![(roots_of(&circles, &[0, 1]), PathData::single(sp))], vec![]), - Err(e) => return Err(refusal(e, arc, *a, *b)), + Err(e) => return Err(refusal(e, arc, |largest| pt::smooth_bridge(*a, *b, largest.between(*a, *b)).is_ok())), }, _ => { let made = pt::bridge_many(&only, arc, reach).map_err(|e| match e { @@ -88,10 +88,9 @@ fn bridge(s: &mut Session, p: &Value) -> Result { pt::ManyError::TooManyBridges => bad(C, "that makes too many bridges (at most 8000): lower the reach"), pt::ManyError::NoneInReach => bad(C, "no two circles are within reach: raise the reach"), pt::ManyError::TooComplex => bad(C, "the bridged circles are too complex to unite"), - pt::ManyError::Pair(i, j, e) => match (only.get(i), only.get(j)) { - (Some(a), Some(b)) => refusal(e, arc, *a, *b), - _ => bad(C, "select two or more circles to bridge"), - }, + // Under the many-circle rules: a pair the largest radius or gap bridges on its own + // can still have a neck too thin to unite among the others. + pt::ManyError::Pair(_, _, e) => refusal(e, arc, |largest| pt::bridges_any(&only, largest, reach)), pt::ManyError::Bad => bad(C, "select two or more circles to bridge"), })?; let shapes = made.joined.into_iter().map(|j| (roots_of(&circles, &j.members), j.outline)).collect(); @@ -146,14 +145,14 @@ fn roots_of(circles: &[(NodeId, pt::Circle)], at: &[usize]) -> Vec { at.iter().filter_map(|&i| circles.get(i)).map(|(id, _)| *id).collect() } -/// The error for circles `a` and `b` that arcs of `arc` can't bridge. A larger radius or gap -/// bridges circles a smaller one cannot, so it suggests one only when the largest allowed would. -fn refusal(e: pt::BridgeError, arc: pt::ArcRadius, a: pt::Circle, b: pt::Circle) -> EngineError { +/// The error for circles that arcs of `arc` can't bridge. A larger radius or gap bridges circles a +/// smaller one cannot, so it suggests one only when `bridges` says the largest allowed would. +fn refusal(e: pt::BridgeError, arc: pt::ArcRadius, bridges: impl FnOnce(pt::ArcRadius) -> bool) -> EngineError { let largest = match arc { pt::ArcRadius::Share(_) => pt::ArcRadius::Share(RADII.1 / 100.0), pt::ArcRadius::Gap(_) => pt::ArcRadius::Gap(GAPS.1), }; - let would = pt::smooth_bridge(a, b, largest.between(a, b)).is_ok(); + let would = e == pt::BridgeError::TooFar && bridges(largest); match (e, arc, would) { (pt::BridgeError::Inside, ..) => bad(C, "one circle is inside the other"), (pt::BridgeError::TooFar, pt::ArcRadius::Share(_), true) => bad(C, "the circles are too far apart for this radius: raise the radius"), diff --git a/crates/engine/src/cmd/addons/pathtools/bridge/tests.rs b/crates/engine/src/cmd/addons/pathtools/bridge/tests.rs index 6c491904e6..745f216b68 100644 --- a/crates/engine/src/cmd/addons/pathtools/bridge/tests.rs +++ b/crates/engine/src/cmd/addons/pathtools/bridge/tests.rs @@ -292,6 +292,23 @@ fn many_circle_and_gap_refusals() { assert_eq!(s.doc().unwrap().history.undo.len(), steps, "nothing changed, no undo step"); } +#[test] +fn a_larger_radius_is_suggested_only_when_it_bridges_among_the_other_circles() { + let mut s = session(); + // Centers 91.65 apart: the largest radius (1000%, 100 pt) bridges these two on their own, but + // with a neck about 0.0007 pt wide, too thin to unite among three or more circles. + let a = circle(&mut s, 20.0, 100.0, 10.0); + let b = circle(&mut s, 111.65, 100.0, 10.0); + let far = circle(&mut s, 380.0, 100.0, 10.0); + assert!(s.execute(BRIDGE, &json!({"ids": [a.0, b.0], "radius": 1000})).is_ok()); + s.execute("edit.undo", &json!({})).unwrap(); + assert!(err(&mut s, json!({"ids": [a.0, b.0]})).ends_with("too far apart for this radius: raise the radius")); + for radius in [100, 1000] { + let e = err(&mut s, json!({"ids": [a.0, b.0, far.0], "radius": radius, "reach": 100})); + assert!(e.ends_with("the circles are too far apart for this radius"), "{e}"); + } +} + #[test] fn too_many_circles_or_bridges_are_refused() { let mut s = session(); diff --git a/crates/pathops/src/addons/pathtools.rs b/crates/pathops/src/addons/pathtools.rs index f937e61545..081924fac5 100644 --- a/crates/pathops/src/addons/pathtools.rs +++ b/crates/pathops/src/addons/pathtools.rs @@ -28,7 +28,7 @@ use kurbo::{CubicBez, ParamCurve, ParamCurveArclen, ParamCurveNearest, Point, Ve use vectorcraft_geom::{Anchor, AnchorKind, PathData, SubPath}; pub use bridge::{ - ArcRadius, BridgeError, Bridged, Circle, Joined, MAX_BRIDGED_CIRCLES, MAX_BRIDGES, ManyError, bridge_many, circle_of, smooth_bridge, + ArcRadius, BridgeError, Bridged, Circle, Joined, MAX_BRIDGED_CIRCLES, MAX_BRIDGES, ManyError, bridge_many, bridges_any, circle_of, smooth_bridge, }; pub use crossings::{MAX_CROSSED_BY_SEGMENTS, MAX_CROSSING_SEGMENTS, Place, Work, crossings, crossings_on, crossings_on_within, insert_at}; pub use dashes::{DashSpec, Piece, divide_dashes}; diff --git a/crates/pathops/src/addons/pathtools/bridge.rs b/crates/pathops/src/addons/pathtools/bridge.rs index dd9bdba027..42a86dfb5d 100644 --- a/crates/pathops/src/addons/pathtools/bridge.rs +++ b/crates/pathops/src/addons/pathtools/bridge.rs @@ -232,38 +232,7 @@ pub enum ManyError { /// too far apart for the arcs gets no bridge; a circle bridged to no other is left alone. One /// circle inside another is an error, and so is no pair that the arcs can join. pub fn bridge_many(circles: &[Circle], arc: ArcRadius, reach: f64) -> Result { - if circles.len() > MAX_BRIDGED_CIRCLES { - return Err(ManyError::TooManyCircles); - } - let fine = |c: &Circle| c.center.x.is_finite() && c.center.y.is_finite() && c.radius.is_finite() && c.radius > 0.0; - if !(reach.is_finite() && reach >= 0.0) || !circles.iter().all(fine) { - return Err(ManyError::Bad); - } - let (mut pairs, mut too_far) = pairs_within(circles, reach, arc)?; - // Each set of connected circles, under its lowest index, is united at a precision fine enough - // for its smallest circle. A neck narrower than twice that would not survive the union, so its - // pair gets no bridge; that can split a set and make its precision coarser, so the sets are - // found again until no neck is dropped. - let (roots, precision) = loop { - let mut parent: Vec = (0..circles.len()).collect(); - for &((i, j), _) in &pairs { - let (ri, rj) = (root(&mut parent, i), root(&mut parent, j)); - parent[ri.max(rj)] = ri.min(rj); - } - let roots: Vec = (0..circles.len()).map(|i| root(&mut parent, i)).collect(); - let mut precision = vec![DEFAULT_PRECISION; circles.len()]; - for (&r, c) in roots.iter().zip(circles) { - precision[r] = precision[r].min(c.radius * 1e-3); - } - let thin = |&((i, _), waist): &(Pair, f64)| waist < 2.0 * precision[roots[i]]; - if !pairs.iter().any(thin) { - break (roots, precision); - } - for &(pair, _) in pairs.iter().filter(|&p| thin(p)) { - too_far = Some(too_far.map_or(pair, |t| t.min(pair))); - } - pairs.retain(|p| !thin(p)); - }; + let (pairs, too_far, roots, precision) = bridgeable(circles, arc, reach)?; match (pairs.is_empty(), too_far) { (true, Some((i, j))) => return Err(ManyError::Pair(i, j, BridgeError::TooFar)), (true, None) => return Err(ManyError::NoneInReach), @@ -305,6 +274,55 @@ pub fn bridge_many(circles: &[Circle], arc: ArcRadius, reach: f64) -> Result bool { + bridgeable(circles, arc, reach).is_ok_and(|(pairs, ..)| !pairs.is_empty()) +} + +/// What [`bridgeable`] finds: the pairs [`bridge_many`] bridges with their necks' widths, the +/// lowest pair within reach that it can't bridge, each circle's set (its lowest index) and each +/// set's precision, under its lowest index. +type Bridgeable = (Vec<(Pair, f64)>, Option, Vec, Vec); + +/// The pairs of `circles` that [`bridge_many`] bridges, and how it sorts them into sets. +fn bridgeable(circles: &[Circle], arc: ArcRadius, reach: f64) -> Result { + if circles.len() > MAX_BRIDGED_CIRCLES { + return Err(ManyError::TooManyCircles); + } + let fine = |c: &Circle| c.center.x.is_finite() && c.center.y.is_finite() && c.radius.is_finite() && c.radius > 0.0; + if !(reach.is_finite() && reach >= 0.0) || !circles.iter().all(fine) { + return Err(ManyError::Bad); + } + let (mut pairs, mut too_far) = pairs_within(circles, reach, arc)?; + // Each set of connected circles, under its lowest index, is united at a precision fine enough + // for its smallest circle. A neck narrower than twice that would not survive the union, so its + // pair gets no bridge; that can split a set and make its precision coarser, so the sets are + // found again until no neck is dropped. + let (roots, precision) = loop { + let mut parent: Vec = (0..circles.len()).collect(); + for &((i, j), _) in &pairs { + let (ri, rj) = (root(&mut parent, i), root(&mut parent, j)); + parent[ri.max(rj)] = ri.min(rj); + } + let roots: Vec = (0..circles.len()).map(|i| root(&mut parent, i)).collect(); + let mut precision = vec![DEFAULT_PRECISION; circles.len()]; + for (&r, c) in roots.iter().zip(circles) { + precision[r] = precision[r].min(c.radius * 1e-3); + } + let thin = |&((i, _), waist): &(Pair, f64)| waist < 2.0 * precision[roots[i]]; + if !pairs.iter().any(thin) { + break (roots, precision); + } + for &(pair, _) in pairs.iter().filter(|&p| thin(p)) { + too_far = Some(too_far.map_or(pair, |t| t.min(pair))); + } + pairs.retain(|p| !thin(p)); + }; + Ok((pairs, too_far, roots, precision)) +} + /// Two circles' indices, the lower first. type Pair = (usize, usize); /// What [`pairs_within`] finds: the pairs the arcs can bridge, each with its neck's width, and the diff --git a/docs/mcp.md b/docs/mcp.md index 1005949aaa..4a74677326 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -12324,11 +12324,12 @@ Commands: With three or more circles, every two whose outlines are at most `reach` apart (0 to 10,000 pt, 10 by default; overlapping ones included) are bridged the same way, and the bridges that connect are united into one shape each, which can have holes where bridges enclose space; holes smaller than 1% of the smallest circle's area are filled. A - pair within reach but too far apart for the radius or gap gets no bridge. Each shape replaces its circles, painted as + pair within reach but too far apart for the radius or gap gets no bridge, and so does a pair whose neck would be + thinner than the precision its shape is united at. Each shape replaces its circles, painted as the topmost of them and in its place, or with `keepOriginals` goes directly above that circle. A circle bridged to no other stays as it is. The shapes and the circles left as they are are selected. It is an error when any pair within - reach has one circle inside the other, when no pair within reach can be bridged (with the same suggestion of a larger - radius or gap), when no two circles are within reach, and above 2,000 circles or 8,000 bridges. → `{ids, alone}`: + reach has one circle inside the other, when no pair within reach can be bridged (suggesting a larger radius or gap + only when the largest would bridge a pair of them under these rules), when no two circles are within reach, and above 2,000 circles or 8,000 bridges. → `{ids, alone}`: the shapes and the circles left as they are, with `id` as well for two circles. Smooth Bridge… opens a dialog (`ui.menuDialog {command}`, kind `smoothBridge`) with Constant Gap (a Gap field in place of the Radius field in percent), Reach (unavailable with two circles selected), Keep Originals and Preview. diff --git a/docs/ui-parity.md b/docs/ui-parity.md index e7b74d89f5..9a39dd94e2 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -487,7 +487,7 @@ next unit in the order a right-click on a ruler lists them, from Feet back to Po | Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools › Set Corners… (also a button in the Anchor Inspector's Corners section: Radius in any unit, Corner kind, Anchors: All, Odd-Numbered or Even-Numbered, counted from each path's first anchor; Angle: from … to …°, only the corners whose sides meet at an angle in that range; Preview) cuts corners on the chosen anchors of every selected path, one undo step | done | #5546, #5545; `addon.pathtools.cornerSet` (`every`, `minAngle`, `maxAngle`), `crates/ui-egui/src/addons/pathtools/set_corners.rs` and their tests; not a feature of the reference app, so it is not scored | | Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools › Trim at Crossings Tool (in the All Tools drawer under the add-on's heading, in neither toolbar as shipped, no shortcut) removes stretches of paths between the places where they are crossed, on any editable path, selected or not: a click removes the stretch under the pointer, a drag every stretch its rectangle touches, an Alt-drag every stretch its freehand line crosses; one undo step each; Escape during a drag removes nothing; hovering shows in red the stretch a click would remove, and a drag that reaches few paths shows what its release would remove | done | `addon.pathtools.trim` (in `crates/engine/src/cmd/addons/pathtools/trim.rs`), `crates/tools/src/addons/trim.rs` and their tests; not a feature of the reference app, so it is not scored | | Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools › Expand Dashes into Paths turns each selected path's dashed stroke into separate open paths, one per dash, laid out as the stroke draws them (pattern, offset, Align Dashes to Corners and Path Ends), each keeping the stroke with the dashes off; one undo step | done | #4922; `addon.pathtools.expandDashes` (in `crates/engine/src/cmd/addons/pathtools.rs`, using the renderer's dash layout) and its tests; not a feature of the reference app, so it is not scored | -| Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools › Smooth Bridge… (Radius as a percentage of the smaller circle's radius, or with Constant Gap that radius plus a gap; Reach; Keep Originals; Preview) joins two selected circles into one outline with two concave arcs that touch both circles, or three or more each to the others within reach, united where the bridges connect, in place of the circles or above them; one undo step | done | `addon.pathtools.bridge`, `crates/pathops/src/addons/pathtools/bridge.rs`, `crates/ui-egui/src/addons/pathtools/bridge.rs` and their tests; a VectorCraft addition, so it is not scored | +| Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools › Smooth Bridge… (Radius as a percentage of the smaller circle's radius, or with Constant Gap that radius plus a gap; Reach; Keep Originals; Preview) joins two selected circles into one outline with two concave arcs that touch both circles, or three or more each to the others within reach, united where the bridges connect, in place of the circles or above them (a pair within reach gets no bridge when its arcs would not reach both circles or would cross, or when its neck would be thinner than the precision its shape is united at; a circle bridged to no other stays as it is); one undo step | done | `addon.pathtools.bridge`, `crates/pathops/src/addons/pathtools/bridge.rs`, `crates/ui-egui/src/addons/pathtools/bridge.rs` and their tests; a VectorCraft addition, so it is not scored | | Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools › Tangent Circle… draws the circles that touch two selected paths or compound paths at a radius, or three of them, each touching the outlines without crossing them; Radius (two shapes), a Circle menu (All or one by number) and Preview; one undo step | done | `addon.pathtools.tangentCircle` (in `crates/engine/src/cmd/addons/pathtools/tangent_circle.rs`, geometry in `crates/pathops/src/addons/pathtools/tangent_circle.rs`) and its tests; a VectorCraft addition, so it is not scored | | Path Precision Tools add-on (VectorCraft addition): Effect › Path Effects lists its live effects (Dashes to Geometry, Add Anchors, Extend Path, Close Path, Smooth Anchors, Retract Handles, Reverse Direction, Simplify Anchors, Split at Anchors), each with the effect dialog's live Preview except Reverse Direction, which has no options, and listed in the Appearance panel like any effect | done | `addon.path.*`, `crates/effects/src/addons/path.rs`, `crates/ui-egui/src/addons/pathtools.rs` and their tests; not a feature of the reference app, so it is not scored | | Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools selects its four tools (Anchor Eraser Brush, Extend Path, Measure & Inspect, Parametric Shape), which the All Tools drawer lists under their own heading but neither toolbar shows as shipped, opens the Anchor Inspector panel (the selected anchor's X/Y and handle lengths and angles as fields; Make Smooth, Make Corner, Equalize Handles, Remove Points Keep Shape, Add Points, the three ways to close) and the Parametric Shape panel (kind, count, W/H, rotation, the kind's own values and corner radius of the selected parametric shape, or of the tool's next one), and runs Add Points at / Split at Crossings and Convert to Parametric Shape; the Parametric Shape Tool draws ten re-editable kinds from the centre (↑/↓ and ←/→ change their numbers while dragging) and edits a selected one with handles; a double-click on the brush or Extend Path tool opens its options | done | `addon.pathtools.*`, `crates/tools/src/addons/`, `crates/ui-egui/src/addons/pathtools.rs`, `crates/ui-egui/src/addons/pathtools/shape.rs` and their tests; not a feature of the reference app, so it is not scored | From c6c6f7c90d576c8241040cbba3cc1fbad5263e7b Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 22:59:31 -0800 Subject: [PATCH 018/102] Save: a background save shows in the progress window with Cancel and Continue in Background A save running in the background (Background Save) now shows in the progress window after 0.4 s, with the file name, a moving bar and how many more saves wait. Cancel (also Esc, file.cancelSave) stops the save before it replaces its file: the file stays as it was, and the document keeps its file and format and stays modified. Continue in Background (file.saveInBackground) leaves the save to the status bar. - The streamed native save stops writing into its temporary file once canceled, and the atomic writer checks once more after the temporary file is flushed, so a canceled write never replaces the file or enters the copy fallback. - A save of several files whose first file is in place writes the rest and is reported as saved. - Save and export jobs are told apart, so each window's Cancel acts only on its own jobs. --- crates/engine/src/cmd/fileio/access.rs | 20 ++++- crates/engine/src/cmd/fileio/save.rs | 50 ++++++++++-- crates/engine/src/cmd/fileio/tests.rs | 103 ++++++++++++++++++++++++ crates/format/src/atomic.rs | 50 +++++++++++- crates/mcp/src/ui_catalog.rs | 12 +++ crates/ui-egui/src/background.rs | 80 ++++++++++++++++-- crates/ui-egui/src/export_progress.rs | 74 +++++++++++++++-- crates/ui-egui/src/i18n/bg.tsv | 3 + crates/ui-egui/src/i18n/bs.tsv | 3 + crates/ui-egui/src/i18n/ca.tsv | 3 + crates/ui-egui/src/i18n/cs.tsv | 3 + crates/ui-egui/src/i18n/da.tsv | 3 + crates/ui-egui/src/i18n/de.tsv | 3 + crates/ui-egui/src/i18n/el.tsv | 3 + crates/ui-egui/src/i18n/es.tsv | 3 + crates/ui-egui/src/i18n/fi.tsv | 3 + crates/ui-egui/src/i18n/fr.tsv | 3 + crates/ui-egui/src/i18n/gu.tsv | 1 + crates/ui-egui/src/i18n/hi.tsv | 3 + crates/ui-egui/src/i18n/hu.tsv | 3 + crates/ui-egui/src/i18n/id.tsv | 3 + crates/ui-egui/src/i18n/it.tsv | 3 + crates/ui-egui/src/i18n/ja.tsv | 3 + crates/ui-egui/src/i18n/ka.tsv | 3 + crates/ui-egui/src/i18n/ko.tsv | 3 + crates/ui-egui/src/i18n/nl.tsv | 3 + crates/ui-egui/src/i18n/pl.tsv | 3 + crates/ui-egui/src/i18n/pt-br.tsv | 3 + crates/ui-egui/src/i18n/ru.tsv | 3 + crates/ui-egui/src/i18n/sv.tsv | 3 + crates/ui-egui/src/i18n/tr.tsv | 3 + crates/ui-egui/src/i18n/uk.tsv | 3 + crates/ui-egui/src/i18n/vi.tsv | 3 + crates/ui-egui/src/i18n/zh-hans.tsv | 3 + crates/ui-egui/src/i18n/zh-hant.tsv | 3 + crates/ui-egui/src/io.rs | 4 +- crates/ui-egui/src/io/save.rs | 63 +++++++++++---- crates/ui-egui/src/menus/run.rs | 2 + crates/ui-egui/src/menus/state.rs | 3 +- crates/ui-egui/src/menus/ui_commands.rs | 12 +++ crates/ui-egui/src/shortcut_editor.rs | 3 +- crates/ui-egui/src/tests/background.rs | 53 ++++++++++++ docs/gaps.md | 2 +- docs/mcp.md | 7 +- docs/target-app-parity.md | 1 + docs/ui-parity.md | 2 +- 46 files changed, 574 insertions(+), 49 deletions(-) diff --git a/crates/engine/src/cmd/fileio/access.rs b/crates/engine/src/cmd/fileio/access.rs index 9d2d9a4a33..f4cef9bec8 100644 --- a/crates/engine/src/cmd/fileio/access.rs +++ b/crates/engine/src/cmd/fileio/access.rs @@ -258,7 +258,17 @@ pub(crate) fn write_file(path: &str, bytes: &[u8]) -> Result<()> { vectorcraft_doc::cancel::check()?; may_write(path)?; // Never a half-written file: see [`write_atomic`]. - write_atomic(std::path::Path::new(path), bytes).map_err(|e| EngineError::Other(format!("{path}: {e}"))) + write_atomic(std::path::Path::new(path), bytes).map_err(|e| write_error(path, e)) +} + +/// The error writing `path` failed with: [`EngineError::Cancelled`] for work canceled before the +/// file was put in place ([`vectorcraft_format::write_atomic_with`]), otherwise the path and the reason. +#[cfg(not(target_arch = "wasm32"))] +fn write_error(path: &str, error: std::io::Error) -> EngineError { + if error.get_ref().is_some_and(|e| e.is::()) { + return EngineError::Cancelled; + } + EngineError::Other(format!("{path}: {error}")) } /// [`write_file`] with what `fill` writes into the file (a save streamed into it). @@ -266,7 +276,7 @@ pub(crate) fn write_file(path: &str, bytes: &[u8]) -> Result<()> { pub fn write_file_with(path: &str, fill: &mut dyn FnMut(&mut dyn std::io::Write) -> std::io::Result<()>) -> Result<()> { vectorcraft_doc::cancel::check()?; may_write(path)?; - vectorcraft_format::write_atomic_with(std::path::Path::new(path), |f| fill(f)).map_err(|e| EngineError::Other(format!("{path}: {e}"))) + vectorcraft_format::write_atomic_with(std::path::Path::new(path), |f| fill(f)).map_err(|e| write_error(path, e)) } /// The save commands' writer: preserves a filesystem location refusal as a typed error. Other @@ -285,8 +295,10 @@ pub fn write_save_file_with(path: &str, fill: &mut dyn FnMut(&mut dyn std::io::W #[cfg(not(target_arch = "wasm32"))] pub(super) fn save_write_error(path: &str, error: std::io::Error) -> EngineError { - let reason = format!("{path}: {error}"); - if vectorcraft_format::read_only_location(&error) { EngineError::ReadOnlyLocation(reason) } else { EngineError::Other(reason) } + if !vectorcraft_format::read_only_location(&error) { + return write_error(path, error); + } + EngineError::ReadOnlyLocation(format!("{path}: {error}")) } #[cfg(target_arch = "wasm32")] diff --git a/crates/engine/src/cmd/fileio/save.rs b/crates/engine/src/cmd/fileio/save.rs index 09b7924442..b603859ef1 100644 --- a/crates/engine/src/cmd/fileio/save.rs +++ b/crates/engine/src/cmd/fileio/save.rs @@ -629,6 +629,24 @@ impl std::io::Write for Counted { } } +/// A writer that fails once the work running on this thread is canceled +/// ([`crate::cancel::is_cancelled`]), so a streamed save stops writing into its temporary file. +/// It sits under the stream's buffer: it is checked once per buffer written, not per write. +struct StopsWhenCancelled(W); + +impl std::io::Write for StopsWhenCancelled { + fn write(&mut self, buf: &[u8]) -> std::io::Result { + if crate::cancel::is_cancelled() { + return Err(std::io::Error::other(crate::cancel::Cancelled)); + } + self.0.write(buf) + } + + fn flush(&mut self) -> std::io::Result<()> { + self.0.flush() + } +} + /// The artboards a native or `.ai` save also writes to files of their own: with /// `separateArtboards`, those `range` names (default all). fn separate_boards(cmd: &str, f: &Format, doc: &Document, p: &Value) -> Result> { @@ -1022,10 +1040,15 @@ impl SaveJob { } /// [`SaveJob::write`], once `stop` has seen the paths of every file it writes to a path, in - /// order: when `stop` returns a value, nothing is written and that value is returned. + /// order: when `stop` returns a value, nothing is written and that value is returned. Work + /// canceled ([`crate::cancel`]) before the first file is written returns + /// [`crate::EngineError::Cancelled`] and writes nothing; once the first file is written, the + /// others are written too. pub fn write_unless(&self, stop: impl FnOnce(&[&str]) -> Option, mut write: impl FnMut(&str, &[u8]) -> Result<()>) -> Result { let (plan, doc) = (&self.plan, &*self.doc); + crate::cancel::check()?; let enc = self.encode()?; + crate::cancel::check()?; let extra = json!({ "format": plan.format.id, "warnings": enc.notes() }); let Some(path) = &plan.path else { let mut out = write_encoded(None, &plan.name, doc, &enc, extra)?; @@ -1042,8 +1065,13 @@ impl SaveJob { if let Some(stopped) = stop(&files.iter().map(|(p, _)| p.as_str()).collect::>()) { return Ok(stopped); } - for (p, bytes) in &files { - write(p, bytes)?; + for (i, (p, bytes)) in files.iter().enumerate() { + if i == 0 { + write(p, bytes)?; + } else { + // Once a file is in place, a Cancel no longer stops the save: the set is written whole. + crate::cancel::scope(&crate::cancel::CancelToken::new(), None, || write(p, bytes))?; + } } let bytes = files.first().map_or(0, |f| f.1.len()); let mut out = super::merge(json!({ "path": path, "bytes": bytes }), extra); @@ -1066,11 +1094,15 @@ impl SaveJob { /// [`SaveJob::write`] through `stream`, which writes the file at a path with what the filler /// it is given writes (atomically, as [`vectorcraft_format::write_atomic_with`]). A native /// file goes into it as it is encoded ([`SaveJob::streams`]), never held whole in memory; - /// other files are encoded first, then written into it. + /// other files are encoded first, then written into it. Work canceled ([`crate::cancel`]) + /// while the native file is encoded, or before its filler returns, returns + /// [`crate::EngineError::Cancelled`]: the filler fails, so `stream` keeps the file as it was + /// (the atomic writer checks once more before it puts the file in place). pub fn write_streamed(&self, stream: StreamWrite) -> Result { let (Some(path), true) = (&self.plan.path, self.streams()) else { return self.write(|p, b| stream(p, &mut |w| w.write_all(b))); }; + crate::cancel::check()?; let (cmd, f) = (self.plan.mode.command(), self.plan.format); let doc = self.doc.without_edit_modes(); let doc = match f.id { @@ -1087,16 +1119,22 @@ impl SaveJob { let mut failed = None; let mut written = 0u64; let mut fill = |w: &mut dyn std::io::Write| { - let mut out = Counted { inner: std::io::BufWriter::with_capacity(STREAM_BUFFER, w), n: 0 }; + let mut out = Counted { inner: std::io::BufWriter::with_capacity(STREAM_BUFFER, StopsWhenCancelled(w)), n: 0 }; let r = super::native::encode_to(cmd, f, &doc, &self.params, &mut out); written = out.n; - match r { + let r = match r { Ok(()) => out.inner.flush(), Err(e) => { failed = Some(e); Err(std::io::Error::other("the file couldn't be encoded")) } + }; + // The last check before the file is replaced: a canceled save leaves it as it was. + if crate::cancel::is_cancelled() { + failed = Some(crate::EngineError::Cancelled); + return Err(std::io::Error::other(crate::cancel::Cancelled)); } + r }; let r = stream(path, &mut fill); r.map_err(|e| failed.take().unwrap_or(e))?; diff --git a/crates/engine/src/cmd/fileio/tests.rs b/crates/engine/src/cmd/fileio/tests.rs index bbf6883834..40a0159303 100644 --- a/crates/engine/src/cmd/fileio/tests.rs +++ b/crates/engine/src/cmd/fileio/tests.rs @@ -922,6 +922,109 @@ fn a_save_that_fails_while_streaming_leaves_the_file_as_it_was() { let _ = std::fs::remove_dir_all(&d); } +/// A save canceled (Background Save's Cancel) before it starts, while a native file streams into +/// its temporary file, or after the last byte went into it, fails with `Cancelled` and leaves the +/// file as it was, with no temporary file behind. A file encoded first is never written. +#[test] +fn a_canceled_save_leaves_the_file_as_it_was() { + /// Passes every write on, and cancels the save after the first one. + struct CancelAfterFirst<'a> { + inner: &'a mut dyn std::io::Write, + token: crate::cancel::CancelToken, + } + impl std::io::Write for CancelAfterFirst<'_> { + fn write(&mut self, b: &[u8]) -> std::io::Result { + let n = self.inner.write(b)?; + self.token.cancel(); + Ok(n) + } + fn flush(&mut self) -> std::io::Result<()> { + self.inner.flush() + } + } + let d = tmp_dir("stream-cancel"); + // A small document's file goes in one piece; a large one's in several. + for count in [1, 1500] { + let mut s = session(2000.0, 2000.0, 1); + for i in 0..count { + s.execute("shape.rectangle", &json!({"x": i % 100 * 20, "y": i / 100 * 20, "width": 10, "height": 10})).unwrap(); + } + let path = d.join("a.vectorcraft").to_string_lossy().to_string(); + s.execute("file.saveCopy", &json!({"path": path})).unwrap(); + let before = std::fs::read(&path).unwrap(); + s.execute("shape.ellipse", &json!({"x": 0, "y": 0, "width": 50, "height": 50})).unwrap(); + let plan = save_plan(&s, SaveMode::Copy, &json!({"path": path})).unwrap(); + let job = save_job(&mut s, plan).unwrap(); + assert!(job.streams()); + let token = crate::cancel::CancelToken::new(); + let r = crate::cancel::scope(&token, None, || { + job.write_streamed(&mut |p, fill| super::write_file_with(p, &mut |w| fill(&mut CancelAfterFirst { inner: w, token: token.clone() }))) + }); + assert!(matches!(r, Err(EngineError::Cancelled)), "{count}: {r:?}"); + assert_eq!(std::fs::read(&path).unwrap(), before, "{count} objects"); + assert_eq!(std::fs::read_dir(&d).unwrap().count(), 1, "no temporary file is left"); + // Canceled before it starts: the file isn't opened. + let mut opened = false; + let r = crate::cancel::scope(&token, None, || { + job.write_streamed(&mut |_, _| { + opened = true; + Ok(()) + }) + }); + assert!(matches!(r, Err(EngineError::Cancelled)) && !opened, "{r:?}"); + } + // A file encoded first (SVG): nothing reaches the writer. + let mut s = session(200.0, 100.0, 1); + s.execute("shape.rectangle", &json!({"x": 10, "y": 10, "width": 50, "height": 20})).unwrap(); + let plan = save_plan(&s, SaveMode::Copy, &json!({"path": d.join("a.svg").to_string_lossy()})).unwrap(); + let job = save_job(&mut s, plan).unwrap(); + let token = crate::cancel::CancelToken::new(); + token.cancel(); + let mut writes = 0; + let r = crate::cancel::scope(&token, None, || { + job.write_streamed(&mut |_, _| { + writes += 1; + Ok(()) + }) + }); + assert!(matches!(r, Err(EngineError::Cancelled)), "{r:?}"); + let r = crate::cancel::scope(&token, None, || { + job.write(|_, _| { + writes += 1; + Ok(()) + }) + }); + assert!(matches!(r, Err(EngineError::Cancelled)) && writes == 0, "{r:?}"); + assert!(!d.join("a.svg").exists()); + let _ = std::fs::remove_dir_all(&d); +} + +/// A save that writes several files (EPS with Use Artboards) and is canceled once its first file is +/// in place writes the others too and succeeds: the set is never left half written. +#[test] +fn a_save_canceled_after_its_first_file_writes_them_all() { + let d = tmp_dir("cancel-files"); + let mut s = session(100.0, 100.0, 2); + s.execute("shape.rectangle", &json!({"x": 10, "y": 10, "width": 30, "height": 30})).unwrap(); + let path = d.join("logo.eps").to_string_lossy().to_string(); + let plan = save_plan(&s, SaveMode::Copy, &json!({"path": path, "options": {"useArtboards": true}})).unwrap(); + let job = save_job(&mut s, plan).unwrap(); + let token = crate::cancel::CancelToken::new(); + let mut written = vec![]; + let r = crate::cancel::scope(&token, None, || { + job.write(|p, b| { + super::write_save_file(p, b)?; + written.push(p.to_string()); + token.cancel(); + Ok(()) + }) + }); + assert!(r.is_ok(), "{r:?}"); + assert_eq!(written.len(), 3, "{written:?}"); + assert!(written.iter().all(|p| std::path::Path::new(p).is_file()), "{written:?}"); + let _ = std::fs::remove_dir_all(&d); +} + /// A save that fails leaves File Info's dates and the saved state alone; one that works stamps them. #[test] fn a_failed_save_does_not_stamp_the_documents_dates() { diff --git a/crates/format/src/atomic.rs b/crates/format/src/atomic.rs index 8e7149cad2..e8f3c42b8e 100644 --- a/crates/format/src/atomic.rs +++ b/crates/format/src/atomic.rs @@ -9,6 +9,10 @@ //! are on disk, and the error names them. Where that copy of the old file can't be made, the file //! is left as it was and the save fails. //! +//! Work canceled ([`vectorcraft_doc::cancel`]) by the time the temporary file is written and flushed +//! puts nothing in place: the temporary file is removed, the file stays as it was (or absent), and +//! the error wraps [`vectorcraft_doc::cancel::Cancelled`]. +//! //! On macOS `File::sync_all` is a full flush (`F_FULLFSYNC`), which SMB shares refuse with //! `ENOTSUP` and virtiofs shares (folders shared into a macOS VM) with `ENOTTY`, while a plain //! `fsync` works: [`sync_file`] falls back to the plain one there (#1620). @@ -43,7 +47,8 @@ pub fn write_atomic(path: &Path, bytes: &[u8]) -> io::Result<()> { } /// Write `path` atomically with `fill`, which writes the content into the temporary file. When -/// `fill` or flushing fails the temporary file is removed and `path` is left untouched. When the +/// `fill` or flushing fails, or the work was canceled meanwhile ([`vectorcraft_doc::cancel`]), the +/// temporary file is removed and `path` is left untouched. When the /// folder refuses the temporary file or the rename, the content is copied into `path` instead (see /// the module docs). pub fn write_atomic_with(path: &Path, fill: impl FnOnce(&mut File) -> io::Result<()>) -> io::Result<()> { @@ -79,7 +84,7 @@ fn write_atomic_stepping( (tmp, f, Some(e)) } }; - let filled = fill(&mut f).and_then(|()| sync_file(&f)); + let filled = fill(&mut f).and_then(|()| sync_file(&f)).and_then(|()| not_cancelled()); drop(f); if let Err(e) = filled { // Best effort: the temporary file is all there is to clean up. @@ -176,7 +181,7 @@ fn write_new_linking( ) -> io::Result<()> { let tmp = temp_path(path)?; let mut f = OpenOptions::new().write(true).create_new(true).open(&tmp)?; - let filled = fill(&mut f).and_then(|()| sync_file(&f)); + let filled = fill(&mut f).and_then(|()| sync_file(&f)).and_then(|()| not_cancelled()); drop(f); let placed = filled.and_then(|()| match link(&tmp, path) { Err(e) if e.kind() != io::ErrorKind::AlreadyExists => copy_new(&tmp, path), @@ -187,6 +192,12 @@ fn write_new_linking( placed } +/// `Err` wrapping [`vectorcraft_doc::cancel::Cancelled`] when the work running on this thread has +/// been canceled: the last check before a written temporary file is put in place. +fn not_cancelled() -> io::Result<()> { + vectorcraft_doc::cancel::check().map_err(io::Error::other) +} + /// Create `path` (never replacing anything) with the content of the file `from`; a failed copy /// removes it again. fn copy_new(from: &Path, path: &Path) -> io::Result<()> { @@ -408,6 +419,39 @@ mod tests { let _ = std::fs::remove_dir_all(&d); } + /// Work canceled by the time the temporary file is written and flushed puts nothing in place: + /// the old file stays as it was, also where the folder refuses the rename (no copy over it), a + /// new file is not created, and no temporary file is left. + #[test] + fn canceled_work_puts_nothing_in_place() { + use vectorcraft_doc::cancel::{CancelToken, Cancelled, scope}; + fn cancelled(e: &io::Error) -> bool { + e.get_ref().is_some_and(|e| e.is::()) + } + let d = dir("cancel"); + let path = d.join("doc.vectorcraft"); + std::fs::write(&path, b"original").unwrap(); + let token = CancelToken::new(); + let r = scope(&token, None, || { + write_atomic_with(&path, |f| { + f.write_all(b"new")?; + token.cancel(); + Ok(()) + }) + }); + assert!(r.as_ref().is_err_and(cancelled), "{r:?}"); + let refused = |_: &Path, _: &Path| -> io::Result<()> { Err(io::Error::from(io::ErrorKind::PermissionDenied)) }; + let r = scope(&token, None, || write_atomic_stepping(&path, |f| f.write_all(b"new"), create_new, refused)); + assert!(r.as_ref().is_err_and(cancelled), "{r:?}"); + assert_eq!(std::fs::read(&path).unwrap(), b"original"); + let new = d.join("new.vectorcraft"); + let r = scope(&token, None, || write_new_with(&new, |f| f.write_all(b"new"))); + assert!(r.as_ref().is_err_and(cancelled), "{r:?}"); + assert!(!new.exists()); + assert!(leftovers(&d, "doc.vectorcraft").is_empty(), "{:?}", leftovers(&d, "doc.vectorcraft")); + let _ = std::fs::remove_dir_all(&d); + } + #[test] fn the_original_file_survives_a_failed_write() { let d = dir("fail"); diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index 0e3d6df203..aa0493f1ba 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -1455,6 +1455,18 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "", "{} close the export progress dialog; the exports go on, shown in the status bar → {hidden: n}", ), + ( + "file.cancelSave", + "Cancel Save", + "", + "{} stop every save running in the background (Background Save) before it replaces its file: the file stays as it was and the document keeps its file and stays modified; a save whose file was already being replaced finishes and is reported as saved → {cancelled: n}", + ), + ( + "file.saveInBackground", + "Continue in Background", + "", + "{} close the save progress window; the saves go on, shown in the status bar → {hidden: n}", + ), ( "file.cancelOpen", "Cancel Opening", diff --git a/crates/ui-egui/src/background.rs b/crates/ui-egui/src/background.rs index b0bdcc6287..34e1071813 100644 --- a/crates/ui-egui/src/background.rs +++ b/crates/ui-egui/src/background.rs @@ -1,7 +1,9 @@ //! Background Save and Background Export (Preferences → File Handling): a save or an export encodes //! and writes a snapshot of the document on a worker thread while editing goes on. The status bar //! shows what is in progress; the result is applied on the UI thread when it arrives (a save marks -//! the document saved as of its snapshot, so edits made meanwhile keep it modified). +//! the document saved as of its snapshot, so edits made meanwhile keep it modified). Exports and +//! saves show in the progress window ([`crate::export_progress`]) with Cancel and Continue in +//! Background. //! //! It needs a thread-safe writer from the host ([`crate::Services::write_shared`], desktop); //! without one (the web, which downloads) the work runs at once, as with the preference off. @@ -44,15 +46,27 @@ struct Task { scope: ScopeHandle, } +/// What a job that shows in the progress window does: its Cancel and Continue in Background act on +/// the jobs of its kind. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum Kind { + /// An export (Background Export): `file.cancelExport`, `file.exportInBackground`. + Export, + /// A save (Background Save): `file.cancelSave`, `file.saveInBackground`. + Save, +} + /// A job in progress. pub struct Job { id: u64, + /// What the job does, for the progress window and its commands. + pub kind: Kind, /// What the status bar and `ui.inspect` show ("Saving Poster.vectorcraft"); empty for work they /// don't show. pub label: String, /// The document the job reads (`DocState::uid`), if any. pub doc: Option, - /// How far an export has got, and its Cancel ([`crate::export_progress`] shows it). + /// How far an export or a save has got, and its Cancel ([`crate::export_progress`] shows it). pub progress: Option>, /// Continue in Background: the progress dialog no longer shows this job. pub hidden: bool, @@ -119,18 +133,41 @@ impl Background { /// Cancel every export in progress → how many there were. pub fn cancel_exports(&mut self) -> usize { + self.cancel(Kind::Export) + } + + /// Hide the exports in progress from the progress dialog (they go on) → how many there were. + pub fn hide_exports(&mut self) -> usize { + self.hide(Kind::Export) + } + + /// Cancel every save in progress that the progress window can show → how many there were. + pub fn cancel_saves(&mut self) -> usize { + self.cancel(Kind::Save) + } + + /// Hide the saves in progress from the progress window (they go on) → how many there were. + pub fn hide_saves(&mut self) -> usize { + self.hide(Kind::Save) + } + + /// Is a job of `kind` in progress that can still be canceled? + pub fn running(&self, kind: Kind) -> bool { + self.jobs.iter().any(|j| j.kind == kind && j.progress.is_some() && !j.cancelled()) + } + + fn cancel(&mut self, kind: Kind) -> usize { let mut n = 0; - for p in self.jobs.iter().filter(|j| !j.cancelled()).filter_map(|j| j.progress.as_ref()) { + for p in self.jobs.iter().filter(|j| j.kind == kind && !j.cancelled()).filter_map(|j| j.progress.as_ref()) { p.cancel(); n += 1; } n } - /// Hide the exports in progress from the progress dialog (they go on) → how many there were. - pub fn hide_exports(&mut self) -> usize { + fn hide(&mut self, kind: Kind) -> usize { let mut n = 0; - for j in self.jobs.iter_mut().filter(|j| j.progress.is_some() && !j.hidden && !j.cancelled()) { + for j in self.jobs.iter_mut().filter(|j| j.kind == kind && j.progress.is_some() && !j.hidden && !j.cancelled()) { j.hidden = true; n += 1; } @@ -163,6 +200,34 @@ pub fn run_with_progress( progress: Option>, work: impl FnOnce(Writer) -> Result + Send + 'static, then: impl FnOnce(&mut VectorcraftApp, Result) -> Result + 'static, +) -> Result { + start(app, enabled, label, doc, progress, Kind::Export, work, then) +} + +/// [`run_with_progress`] for a save of document `doc`: the progress window shows it as a save, and +/// its Cancel is `file.cancelSave`. +pub fn run_saving( + app: &mut VectorcraftApp, + enabled: bool, + label: String, + doc: u64, + progress: Arc, + work: impl FnOnce(Writer) -> Result + Send + 'static, + then: impl FnOnce(&mut VectorcraftApp, Result) -> Result + 'static, +) -> Result { + start(app, enabled, label, Some(doc), Some(progress), Kind::Save, work, then) +} + +#[allow(clippy::too_many_arguments)] +fn start( + app: &mut VectorcraftApp, + enabled: bool, + label: String, + doc: Option, + progress: Option>, + kind: Kind, + work: impl FnOnce(Writer) -> Result + Send + 'static, + then: impl FnOnce(&mut VectorcraftApp, Result) -> Result + 'static, ) -> Result { let mut work: Work = Box::new(work); let shared = app.services.write_shared.clone().filter(|_| enabled && !app.background.foreground && app.services.download.is_none()); @@ -174,7 +239,8 @@ pub fn run_with_progress( let (sets, status) = (app.ui.status_sets, if label.is_empty() { String::new() } else { format!("{label}…") }); let bg = &mut app.background; bg.next_id += 1; - bg.jobs.push(Job { id, label: label.clone(), doc, progress, hidden: false, sets, line: status.clone(), then: Box::new(then) }); + let line = status.clone(); + bg.jobs.push(Job { id, kind, label: label.clone(), doc, progress, hidden: false, sets, line, then: Box::new(then) }); if label.is_empty() { return Ok(json!({ "background": true })); } diff --git a/crates/ui-egui/src/export_progress.rs b/crates/ui-egui/src/export_progress.rs index 3d392c3a35..ebde2f8be2 100644 --- a/crates/ui-egui/src/export_progress.rs +++ b/crates/ui-egui/src/export_progress.rs @@ -7,11 +7,17 @@ //! Cancel), Continue in Background (`file.exportInBackground`) closes the //! dialog and leaves the export to the status bar. //! +//! A save running in the background (Background Save) shows in the same window, with a moving bar +//! (a save counts no steps) and how many more saves wait: Cancel (`file.cancelSave`, also Esc) +//! stops it before it replaces its file, and Continue in Background (`file.saveInBackground`) +//! leaves it to the status bar. +//! //! It opens after [`DELAY`] so a quick export doesn't flash it, and waits while another dialog is //! open (the overwrite question, an options dialog): never two modals at once. use serde_json::json; +use crate::background::Kind; use crate::dialogs::modal; use crate::theme::Tokens; use crate::{VectorcraftApp, widgets}; @@ -24,11 +30,12 @@ fn seen_id() -> egui::Id { egui::Id::unique("export-progress-seen") } -/// What the dialog shows: (label, steps done, steps in all, share done, exports after this one, -/// what the steps are). +/// What the dialog shows: (label, steps done, steps in all, share done, jobs of its kind after this +/// one, what the steps are). fn shown(app: &VectorcraftApp, now: f64, ctx: &egui::Context) -> Option<(String, u64, u64, f32, usize, Steps)> { let jobs: Vec<_> = app.background.jobs.iter().filter(|j| !j.hidden && !j.cancelled()).filter(|j| j.progress.is_some()).collect(); let first = jobs.first()?; + let more = jobs.iter().filter(|j| j.kind == first.kind).count() - 1; let since = ctx.data_mut(|m| { let seen = m.get_temp_mut_or_insert_with(seen_id(), || (first.id(), now)); if seen.0 != first.id() { @@ -42,11 +49,12 @@ fn shown(app: &VectorcraftApp, now: f64, ctx: &egui::Context) -> Option<(String, let (done, total) = first.progress.as_ref().map(|p| p.counts()).unwrap_or_default(); let frac = first.progress.as_ref().and_then(|p| p.fraction()).unwrap_or(0.0) as f32; let steps = match &first.progress { + _ if first.kind == Kind::Save => Steps::Save, Some(p) if p.counts_share() => Steps::Share, Some(p) if p.counts_files() => Steps::Files, _ => Steps::Artboards, }; - Some((first.label.clone(), done, total, frac, jobs.len() - 1, steps)) + Some((first.label.clone(), done, total, frac, more, steps)) } /// What an export's steps are. @@ -57,6 +65,8 @@ enum Steps { Files, /// An exporter plug-in's own steps, shown as a share of the work. Share, + /// A save, which counts no steps: a moving bar. + Save, } /// Draws the window for the first export running in the background that wasn't hidden or @@ -71,6 +81,15 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) { let t = Tokens::get(ctx); let heading = format!("{}…", crate::i18n::msg(&label)); let pressed = window(ctx, "export-progress", &heading, |ui| { + if steps == Steps::Save { + indeterminate(ui, tl!("Encoding and writing the file…")); + if more > 0 { + ui.add_space(6.0); + let queued = crate::i18n::tn(more as u64, "{n} more save waiting", "{n} more saves waiting"); + ui.label(egui::RichText::new(queued).size(11.5).color(t.text_dim)); + } + return; + } // One step says nothing a spinner doesn't: the bar would sit at 0 % until the file is written. if steps == Steps::Share && total > 0 { share(ui, tl!("Encoding and writing the file…"), frac); @@ -95,10 +114,12 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) { ui.label(egui::RichText::new(queued).size(11.5).color(t.text_dim)); } }); - let id = match pressed { - Some(Pressed::Cancel) => "file.cancelExport", - Some(Pressed::Hide) => "file.exportInBackground", - None => return, + let id = match (pressed, steps == Steps::Save) { + (Some(Pressed::Cancel), false) => "file.cancelExport", + (Some(Pressed::Hide), false) => "file.exportInBackground", + (Some(Pressed::Cancel), true) => "file.cancelSave", + (Some(Pressed::Hide), true) => "file.saveInBackground", + (None, _) => return, }; if let Err(e) = app.run(id, json!({})) { app.status(e); @@ -298,6 +319,45 @@ mod tests { assert!(app.background.jobs.is_empty()); } + /// A Background Save shows in the window after the delay, with a moving bar and how many more + /// saves wait, never over another dialog; Continue in Background hides it and the saves go on. + /// With Background Save off the save is written at once and no window shows. + #[test] + fn a_background_save_shows_in_the_window_and_continue_hides_it() { + let go = Arc::new(std::sync::atomic::AtomicBool::new(false)); + let mut app = app(go.clone()); + for name in ["a", "b"] { + app.run("file.new", json!({"width": 100, "height": 100})).unwrap(); + let r = app.run("file.save", json!({"path": format!("/docs/{name}.vectorcraft")})).unwrap(); + assert_eq!(r["background"], true, "{r}"); + } + let ctx = egui::Context::default(); + crate::theme::install_fonts(&ctx); + assert!(!frame(&mut app, &ctx, 0.0).contains("Saving a.vectorcraft"), "not before the delay"); + // Another dialog is open: the window waits. + app.ui.dialog = Some(crate::state::Dialog::new("about", json!({}))); + frame(&mut app, &ctx, 1.0); + assert!(!frame(&mut app, &ctx, 1.1).contains("Saving a.vectorcraft"), "never over another dialog"); + app.ui.dialog = None; + frame(&mut app, &ctx, 1.2); + let shown = frame(&mut app, &ctx, 1.3); + assert!(shown.contains("Saving a.vectorcraft…") && shown.contains("1 more save waiting"), "{shown}"); + assert!(shown.contains("Cancel") && shown.contains("Continue in Background") && !shown.contains("export"), "{shown}"); + assert_eq!(app.run("file.saveInBackground", json!({})).unwrap()["hidden"], 2); + assert!(!frame(&mut app, &ctx, 2.0).contains("Saving"), "hidden saves aren't shown"); + assert!(crate::menus::enabled(&app, "file.cancelSave"), "they can still be canceled"); + go.store(true, std::sync::atomic::Ordering::SeqCst); + background::wait_all(&mut app); + assert!(app.background.jobs.is_empty()); + assert_eq!(app.session.active().unwrap().path.as_deref(), Some("/docs/b.vectorcraft")); + app.session.execute("prefs.set", &json!({"values": {"backgroundSave": false}})).unwrap(); + app.services.write = Some(Box::new(|_: &str, _: &[u8]| Ok(()))); + app.run("file.new", json!({"width": 100, "height": 100})).unwrap(); + let r = app.run("file.save", json!({"path": "/docs/c.vectorcraft"})); + assert!(r.as_ref().is_ok_and(|r| r.get("background").is_none()), "{r:?}"); + assert!(app.background.jobs.is_empty() && !frame(&mut app, &ctx, 3.0).contains("Saving")); + } + #[test] fn an_export_of_files_counts_files() { let go = Arc::new(std::sync::atomic::AtomicBool::new(false)); diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index 71e443a399..65501cb6cc 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -6063,6 +6063,9 @@ theme Appearance Външен вид Continue in Background Продължаване във фонов режим Cancel Export Отказ от експортирането @msg Export cancelled Експортирането е отказано + Cancel Save Отказ от записването +@plural {n} more save waiting|{n} more saves waiting Още {n} записване в изчакване|Още {n} записвания в изчакване +@msg Save canceled Записването е отказано # Paragraph panel menu › Justification… Desired Желано Word Spacing: Разстояние между думите: diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 883d6dd387..10931ec65c 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -6084,6 +6084,9 @@ mark-style Japanese Japanski Continue in Background Nastavi u pozadini Cancel Export Otkaži izvoz @msg Export cancelled Izvoz otkazan + Cancel Save Otkaži čuvanje +@plural {n} more save waiting|{n} more saves waiting Čeka još {n} čuvanje|Čekaju još {n} čuvanja|Čeka još {n} čuvanja +@msg Save canceled Čuvanje otkazano Desired Željeno Word Spacing: Razmak riječi: Letter Spacing: Razmak slova: diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index a8a63cbf55..6c0cad2469 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -5887,6 +5887,9 @@ liquify-list-end {0}, {1} {0} i {1} @msg Expand: no gradient fills Expandeix: no hi ha farciments de degradat @msg Expand: nothing to expand Expandeix: no hi ha res per expandir @msg Export cancelled Exportació cancel·lada + Cancel Save Cancel·la el desament +@plural {n} more save waiting|{n} more saves waiting {n} desament més en espera|{n} desaments més en espera +@msg Save canceled Desament cancel·lat @msg Exported {path} S’ha exportat {path} @msg Exported {what} S’ha exportat {what} @msg Exporting {_1} S’està exportant {_1} diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 569b1347ec..3d485958c9 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -6512,6 +6512,9 @@ mark-style Japanese Japonské Continue in Background Pokračovat na pozadí Cancel Export Zrušit export @msg Export cancelled Export byl zrušen + Cancel Save Zrušit ukládání +@plural {n} more save waiting|{n} more saves waiting Čeká ještě {n} uložení|Čekají ještě {n} uložení|Čeká ještě {n} uložení +@msg Save canceled Ukládání bylo zrušeno # Paragraph panel menu › Justification… Desired Požadované Word Spacing: Mezery mezi slovy: diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 4578e4efc1..304fb63c29 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -8793,6 +8793,9 @@ swatch Bright Violet Kraftig violet Continue in Background Fortsæt i baggrunden Cancel Export Annullér eksport @msg Export cancelled Eksport annulleret + Cancel Save Annullér gemning +@plural {n} more save waiting|{n} more saves waiting {n} gemning mere venter|{n} gemninger mere venter +@msg Save canceled Gemning annulleret # Paragraph panel menu › Justification… Desired Ønsket Word Spacing: Ordafstand: diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index c943c89dd2..fd47295aad 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -6094,6 +6094,9 @@ effect Soft Weich Continue in Background Im Hintergrund fortsetzen Cancel Export Export abbrechen @msg Export cancelled Export abgebrochen + Cancel Save Speichern abbrechen +@plural {n} more save waiting|{n} more saves waiting {n} weiterer Speichervorgang wartet|{n} weitere Speichervorgänge warten +@msg Save canceled Speichern abgebrochen # Paragraph panel menu › Justification… Desired Optimal Word Spacing: Wortabstand: diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 906640aa0a..b9c540f597 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -6492,6 +6492,9 @@ effect Points Σημεία Continue in Background Συνέχεια στο παρασκήνιο Cancel Export Ακύρωση εξαγωγής @msg Export cancelled Η εξαγωγή ακυρώθηκε + Cancel Save Ακύρωση αποθήκευσης +@plural {n} more save waiting|{n} more saves waiting {n} ακόμη αποθήκευση σε αναμονή|{n} ακόμη αποθηκεύσεις σε αναμονή +@msg Save canceled Η αποθήκευση ακυρώθηκε # Paragraph panel menu › Justification… Desired Επιθυμητό Word Spacing: Απόσταση λέξεων: diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 9239c93a73..90e0ff2c62 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -6480,6 +6480,9 @@ mark-style Japanese Japonesas Continue in Background Continuar en segundo plano Cancel Export Cancelar exportación @msg Export cancelled Exportación cancelada + Cancel Save Cancelar guardado +@plural {n} more save waiting|{n} more saves waiting {n} guardado más en espera|{n} guardados más en espera +@msg Save canceled Guardado cancelado # Paragraph panel menu › Justification… Desired Deseado Word Spacing: Espaciado entre palabras: diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 423703e5c1..e553a223d0 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -6502,6 +6502,9 @@ mark-style Japanese Japanilainen Continue in Background Jatka taustalla Cancel Export Peruuta vienti @msg Export cancelled Vienti peruutettiin + Cancel Save Peruuta tallennus +@plural {n} more save waiting|{n} more saves waiting {n} tallennus odottaa|{n} tallennusta odottaa +@msg Save canceled Tallennus peruutettiin # Paragraph panel menu › Justification… Desired Haluttu Word Spacing: Sanaväli: diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 8af602785b..33c646bb8b 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -6507,6 +6507,9 @@ theme Appearance Apparence Continue in Background Continuer en arrière-plan Cancel Export Annuler l’exportation @msg Export cancelled Exportation annulée + Cancel Save Annuler l’enregistrement +@plural {n} more save waiting|{n} more saves waiting {n} autre enregistrement en attente|{n} autres enregistrements en attente +@msg Save canceled Enregistrement annulé # Paragraph panel menu › Justification… Desired Optimal Word Spacing: Espacement des mots : diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index 4eed343e3d..b6bf3c68c8 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -487,6 +487,7 @@ Can't save “{name}”. “{name}” સાચવી શકાતી નથી. Cancel રદ કરો Cancel Export નિકાસ રદ કરો + Cancel Save સાચવવાનું રદ કરો Cancel Image Trace ઇમેજ ટ્રેસ રદ કરો Cancel Key Object કી ઑબ્જેક્ટ રદ કરો Cancel Opening ખોલવાનું રદ કરો diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index de33cdbd92..9e9c146bdb 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -7085,6 +7085,9 @@ liquify-list-end {0}, {1} {0} और {1} @msg expected {{"objects": [...]}} अपेक्षित: {{"objects": [...]}} @msg export `{name}`: {e} निर्यात `{name}`: {e} @msg Export cancelled निर्यात रद्द + Cancel Save सेव रद्द करना +@plural {n} more save waiting|{n} more saves waiting {n} और सेव प्रतीक्षा में|{n} और सेव प्रतीक्षा में +@msg Save canceled सेव रद्द @msg Export for Screens writes png, png8, jpg, webp, gif, tiff, bmp, tga, psd, svg, svgz, pdf, eps, ai or vectorcraft स्क्रीन के लिए एक्सपोर्ट png, png8, jpg, webp, gif, tiff, bmp, tga, psd, svg, svgz, pdf, eps, ai या vectorcraft लिखता है @msg export presets file is larger than {MAX_PRESET_FILE_BYTES} bytes निर्यात प्रीसेट फ़ाइल {MAX_PRESET_FILE_BYTES} bytes से बड़ा है @msg Exported {path} {path} एक्सपोर्ट किया गया diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index f869e7d07b..1150f91b88 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -6496,6 +6496,9 @@ liquify-list-end {0}, {1} {0} és {1} Continue in Background Folytatás a háttérben Cancel Export Exportálás megszakítása @msg Export cancelled Az exportálás megszakítva + Cancel Save Mentés megszakítása +@plural {n} more save waiting|{n} more saves waiting Még {n} mentés várakozik +@msg Save canceled A mentés megszakítva # Paragraph panel menu › Justification… Desired Kívánt Word Spacing: Szóköz: diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index c5f865e69b..7aebab75b7 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -6062,6 +6062,9 @@ swatch Bright Violet Violet cerah Continue in Background Lanjutkan di latar belakang Cancel Export Batalkan ekspor @msg Export cancelled Ekspor dibatalkan + Cancel Save Batalkan penyimpanan +@plural {n} more save waiting|{n} more saves waiting {n} penyimpanan lagi menunggu +@msg Save canceled Penyimpanan dibatalkan # Paragraph panel menu › Justification… Desired Diinginkan Word Spacing: Spasi Kata: diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 08cefdbed7..f4af60963b 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -6130,6 +6130,9 @@ lighting Light Luce Continue in Background Continua in background Cancel Export Annulla esportazione @msg Export cancelled Esportazione annullata + Cancel Save Annulla salvataggio +@plural {n} more save waiting|{n} more saves waiting {n} altro salvataggio in attesa|{n} altri salvataggi in attesa +@msg Save canceled Salvataggio annullato # Paragraph panel menu › Justification… Desired Desiderato Word Spacing: Spaziatura parole: diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 59c7628f40..2a6a61a252 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -6177,6 +6177,9 @@ lighting Light ライト Continue in Background バックグラウンドで続行 Cancel Export 書き出しをキャンセル @msg Export cancelled 書き出しをキャンセルしました + Cancel Save 保存をキャンセル +@plural {n} more save waiting|{n} more saves waiting 待機中の保存: あと {n} 件 +@msg Save canceled 保存をキャンセルしました # Paragraph panel menu › Justification… Desired 最適 Word Spacing: 単語間隔: diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 9393433cdb..e25c5778de 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -8497,6 +8497,9 @@ liquify-list-end {0}, {1} {0} და {1} Cancel Export ექსპორტირების გაუქმება @plural {n} more export waiting|{n} more exports waiting რიგში მომლოდინე სხვა ექსპორტირება: {n} @msg Export cancelled ექსპორტირება გაუქმდა + Cancel Save შენახვის გაუქმება +@plural {n} more save waiting|{n} more saves waiting რიგში მომლოდინე სხვა შენახვა: {n} +@msg Save canceled შენახვა გაუქმდა Clear History ისტორიის გასუფთავება New Document from State ახალი დოკუმენტი მდგომარეობიდან Continue in Background ფონურ რეჟიმში გაგრძელება diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 49d5e10dc1..7a7c057b2e 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -6094,6 +6094,9 @@ lighting Light 광원 Continue in Background 백그라운드에서 계속 Cancel Export 내보내기 취소 @msg Export cancelled 내보내기를 취소했습니다 + Cancel Save 저장 취소 +@plural {n} more save waiting|{n} more saves waiting 대기 중인 저장 {n}개 더 +@msg Save canceled 저장을 취소했습니다 # Paragraph panel menu › Justification… Desired 희망 Word Spacing: 단어 간격: diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index f071ebd0e2..7b7bb07c33 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -8618,6 +8618,9 @@ swatch Bright Violet Felviolet Continue in Background Doorgaan op achtergrond Cancel Export Export annuleren @msg Export cancelled Export geannuleerd + Cancel Save Opslaan annuleren +@plural {n} more save waiting|{n} more saves waiting Nog {n} opslagactie in de wachtrij|Nog {n} opslagacties in de wachtrij +@msg Save canceled Opslaan geannuleerd # Paragraph panel menu › Justification… Desired Gewenst Word Spacing: Woordafstand: diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 2477c73abd..b77f23725c 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -6366,6 +6366,9 @@ mark-style Japanese Japońskie Continue in Background Kontynuuj w tle Cancel Export Anuluj eksport @msg Export cancelled Eksport anulowany + Cancel Save Anuluj zapisywanie +@plural {n} more save waiting|{n} more saves waiting Czeka jeszcze {n} zapis|Czekają jeszcze {n} zapisy|Czeka jeszcze {n} zapisów +@msg Save canceled Zapisywanie anulowane # Paragraph panel menu › Justification… Desired Optymalne Word Spacing: Odstępy między wyrazami: diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 333351b9af..9eea52c773 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -6424,6 +6424,9 @@ mark-style Japanese Japonesas Continue in Background Continuar em Segundo Plano Cancel Export Cancelar Exportação @msg Export cancelled Exportação cancelada + Cancel Save Cancelar Salvamento +@plural {n} more save waiting|{n} more saves waiting Mais {n} salvamento aguardando|Mais {n} salvamentos aguardando +@msg Save canceled Salvamento cancelado # Paragraph panel menu › Justification… Desired Desejado Word Spacing: Espaçamento entre Palavras: diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index ae33aa0d55..741bb5a641 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -6130,6 +6130,9 @@ lighting Light Свет Continue in Background Продолжить в фоне Cancel Export Отменить экспорт @msg Export cancelled Экспорт отменён + Cancel Save Отменить сохранение +@plural {n} more save waiting|{n} more saves waiting Ещё {n} сохранение в очереди|Ещё {n} сохранения в очереди|Ещё {n} сохранений в очереди +@msg Save canceled Сохранение отменено # Paragraph panel menu › Justification… Desired Желательно Word Spacing: Интервал между словами: diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 1bd4fd0692..10c87e89d0 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -6552,6 +6552,9 @@ swatch Yellow Green Gulgrön Continue in Background Fortsätt i bakgrunden Cancel Export Avbryt export @msg Export cancelled Exporten avbröts + Cancel Save Avbryt sparande +@plural {n} more save waiting|{n} more saves waiting {n} sparande till väntar|{n} sparanden till väntar +@msg Save canceled Sparandet avbröts # Paragraph panel menu › Justification… Desired Önskat Word Spacing: Ordavstånd: diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index a2a38c679a..e84fc15f2f 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -6622,6 +6622,9 @@ theme Appearance Görünüm @msg Flat Logo traced the image at {_1} × {_2} pixels, averaged down from {_3} × {_4}. Düz Logo modu görüntüyü {_3} × {_4} boyutundan ortalama alarak küçültüp {_1} × {_2} pikselde izledi. @plural {n} more export waiting|{n} more exports waiting {n} dışa aktarma daha bekliyor|{n} dışa aktarma daha bekliyor @msg Export cancelled Dışa aktarma iptal edildi + Cancel Save Kaydetmeyi İptal Et +@plural {n} more save waiting|{n} more saves waiting {n} kaydetme daha bekliyor|{n} kaydetme daha bekliyor +@msg Save canceled Kaydetme iptal edildi Add filters from the list above Yukarıdaki listeden filtre ekleyin Add to Stack Yığına Ekle Applied Filters Uygulanan Filtreler diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 17c673885d..85e2fcc1a8 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -6112,6 +6112,9 @@ lighting Light Світло Continue in Background Продовжити у фоні Cancel Export Скасувати експорт @msg Export cancelled Експорт скасовано + Cancel Save Скасувати збереження +@plural {n} more save waiting|{n} more saves waiting Ще {n} збереження в очікуванні|Ще {n} збереження в очікуванні|Ще {n} збережень в очікуванні +@msg Save canceled Збереження скасовано # Paragraph panel menu › Justification… Desired Бажане Word Spacing: Інтервал між словами: diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index da89525314..7136d5cb96 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -6141,6 +6141,9 @@ liquify-list-end {0}, {1} {0} và {1} Continue in Background Tiếp tục trong nền Cancel Export Hủy xuất @msg Export cancelled Đã hủy xuất + Cancel Save Hủy lưu +@plural {n} more save waiting|{n} more saves waiting Còn {n} lượt lưu đang chờ +@msg Save canceled Đã hủy lưu # Paragraph panel menu › Justification… Desired Mong muốn Word Spacing: Khoảng cách từ: diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 5f612cb0d4..8af2fbeb47 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -6348,6 +6348,9 @@ lighting Light 光源 Continue in Background 在后台继续 Cancel Export 取消导出 @msg Export cancelled 已取消导出 + Cancel Save 取消保存 +@plural {n} more save waiting|{n} more saves waiting 另有 {n} 个保存等待中 +@msg Save canceled 已取消保存 # Paragraph panel menu › Justification… Desired 所需 Word Spacing: 字间距: diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index e0b5a13ee2..bf65eccdd4 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -6146,6 +6146,9 @@ lighting Light 光源 Continue in Background 在背景繼續 Cancel Export 取消匯出 @msg Export cancelled 已取消匯出 + Cancel Save 取消儲存 +@plural {n} more save waiting|{n} more saves waiting 另有 {n} 個儲存等待中 +@msg Save canceled 已取消儲存 # Paragraph panel menu › Justification… Desired 所需 Word Spacing: 字間距: diff --git a/crates/ui-egui/src/io.rs b/crates/ui-egui/src/io.rs index ea27320b52..462d903d55 100644 --- a/crates/ui-egui/src/io.rs +++ b/crates/ui-egui/src/io.rs @@ -35,7 +35,9 @@ pub use open::{ #[cfg(test)] pub(crate) use open::{open_file, opened_with_notes}; pub(crate) use save::save_current; -pub use save::{ask_format_options, ask_pdf_options, remember_active_artboard, remember_view, save, save_pdf}; +pub use save::{ + SAVE_CANCELED, ask_format_options, ask_pdf_options, cancel_saves, hide_saves, remember_active_artboard, remember_view, save, save_pdf, +}; pub(crate) use save::{export_path, is_web, notes_of, report_saved, show_with_notes, target_path, write_named, write_reporting, write_to}; #[cfg(test)] pub(crate) use save::{report_write_error, saved_status}; diff --git a/crates/ui-egui/src/io/save.rs b/crates/ui-egui/src/io/save.rs index e1f50fba45..47d83173af 100644 --- a/crates/ui-egui/src/io/save.rs +++ b/crates/ui-egui/src/io/save.rs @@ -1,10 +1,30 @@ use super::export::file_url; use super::open::{note_recent, open_options}; use super::{ - EngineError, FilePick, Format, SAVE_FORMATS, SaveMode, SavePlan, SavedView, Services, TEMPLATE_FORMATS, Value, VectorcraftApp, Writer, - background, dialogs, fileio, json, svg_options, + EngineError, FilePick, Format, Progress, SAVE_FORMATS, SaveMode, SavePlan, SavedView, Services, TEMPLATE_FORMATS, Value, VectorcraftApp, Writer, + background, dialogs, fileio, json, progress, svg_options, }; +/// The status once a save running in the background was canceled. +pub const SAVE_CANCELED: &str = "Save canceled"; + +/// File › Cancel Save (the progress window's Cancel): every save running in the background stops +/// before it replaces its file. The file stays as it was, and the document keeps its file, format +/// and modified state → `{cancelled: n}`. A save whose file was already written is reported as saved. +pub fn cancel_saves(app: &mut VectorcraftApp) -> Value { + let n = app.background.cancel_saves(); + if n > 0 { + app.status(SAVE_CANCELED); + } + json!({ "cancelled": n }) +} + +/// The progress window's Continue in Background for saves: they go on, shown in the status bar +/// only → `{hidden: n}`. +pub fn hide_saves(app: &mut VectorcraftApp) -> Value { + json!({ "hidden": app.background.hide_saves() }) +} + /// A save or an export that didn't write `path`: say so in a dialog that names the file and the /// reason and stays until it is closed, as an editor does (#1685). The status bar's line, which /// the caller's error becomes, is replaced by the next message, and a document that wasn't saved @@ -566,7 +586,10 @@ fn write_plan( let stream = app.services.stream_shared.clone().filter(|_| job.streams() && !is_web(app)); let (exists, allowed) = checks_replaced(app); let known: Vec = allowed.iter().chain(app.picks.written_beside.get(&uid).into_iter().flatten()).cloned().collect(); - let work = move |write: Writer| { + // The progress window's Cancel: a save canceled before it replaces its file writes nothing. + let progress = Progress::new(); + let (reporting, asked) = (progress.clone(), progress.clone()); + let write_file = move |write: Writer| { let mut own_refused = false; let mut observed = |p: &str, r: vectorcraft_engine::Result<()>| { own_refused = own_path.as_deref() == Some(p) && matches!(&r, Err(EngineError::ReadOnlyLocation(_))); @@ -583,16 +606,21 @@ fn write_plan( (_, _, Some(stream)) => job.write_streamed(&mut |p, fill| stream(p, fill).map_err(EngineError::Other)), _ => job.write_unless(check, |p, b| write(p, b).map_err(EngineError::Other)), }; - r.map_err(|e| { - if let EngineError::ReadOnlyLocation(reason) = &e { - refused_by_work.store(own_refused, std::sync::atomic::Ordering::Relaxed); - if !by_control { - return reason.clone(); + match r { + // Nothing written: the file is as it was. + Err(EngineError::Cancelled) => Ok(json!({ "cancelled": true })), + r => r.map_err(|e| { + if let EngineError::ReadOnlyLocation(reason) = &e { + refused_by_work.store(own_refused, std::sync::atomic::Ordering::Relaxed); + if !by_control { + return reason.clone(); + } } - } - e.to_string() - }) + e.to_string() + }), + } }; + let work = move |write: Writer| progress::scope(&reporting, || write_file(write)); let failed = target.clone().unwrap_or_default(); // The status line before the save starts: on the worker, the save sets one line ("