- A text cache that renders empty now falls back the page instead of
leaving blank text.
- Fake-bold strokes pair only with fill glyphs at the same paint order.
- Retain single-point closed subpaths (round-cap dots) without emitting
duplicate phantom points; test added.
- Device methods documented; paint-order test covers text on both sides
of a path.
The Patch tool's cursor shows a new single right-pointing arrow badge over the selection (no Shift or Alt), also while a drag that started inside is in progress. Content-Aware Move keeps no badge and the Curvature Pen keeps its four-arrow badge.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Model-Effort: Opus 5.5 drove; Opus 5.5 briefed; Sonnet 5.5 wrote at medium
A plain rectangular selection is translated by the drag offset in the same history state as the pixel change. Source, Content-Aware, feathered and non-rectangular selections keep today's behaviour.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Model-Effort: Opus 5.5 drove; Opus 5.5 briefed; Sonnet 5.5 wrote at medium
Main added a Layer menu item of its own, so after the rebase the menu
counts 663 items; raise the floor to match.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Free Transform keeps its box in a preview until it is committed; the
document's layers stay where they were. Layer › Copy CSS reads the
document, so with a box moved but not yet committed it put the old
left/top/width/height on the clipboard, not what the canvas showed.
Copy CSS now joins Save for Web (#6737) in the transform tool's guard:
the menu item is disabled under an open box, and any caller (menu,
shortcut, palette, control channel) gets "Commit or cancel the
transform first", with nothing copied and the box left open. After
Cancel it copies the old place, after a commit the new one.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Scaled 200 % across and 100 % down, a live rounded rectangle keeps one
radius per corner (r times the smaller scale), while its path, which is
what renders, has r·sx by r·sy elliptical corners. The rule wrote the
single circular radius. It now writes border-radius only when the path's
anchors are the ones the live radii draw (in any order, so a flipped
shape still writes its corners); otherwise none, as the module doc says.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No test checked the copied border-radius after `shape.edit`'s
`transform` scales the live radii. With radii 12 and a uniform 2x scale
the rule now has to say `border-radius: 24px;`, so a regression in that
scaling fails the test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A solid live ellipse got the plain rectangle rule, so pasting it showed a
rectangle. It now writes `border-radius: 50%;` where a rounded rectangle
writes its radii, before the fill. The module doc lists it, and lists the
geometry of other shapes (live polygons, stars and lines, custom paths)
as not written.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A layer named `a */ b` writes no `*/` outside its quoted image name and a
sanitised class; a layer with a drop shadow writes the same rule as
without it, with no shadow and no panic.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The module doc said it writes CSS "as Photoshop writes it", but strokes,
layer effects, CSS gradients, blend modes and fill opacity are never
written. List what each kind of layer gives, in order, and what is left
out.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A shape layer that is still a live rectangle with rounded corners now gets
`border-radius` before its fill, as Photoshop writes it: one value when all
four corners are equal, else top-left, top-right, bottom-right,
bottom-left, in px. Sharp rectangles write none.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every type layer was written like point text: no width or height, placed at its first pixel.
Photoshop 2025 writes paragraph text differently. For a 200 × 120 box at (60, 40) whose two
lines span 156 × 51 px it writes `left: 59.937px; top: 36.948px; width: 156px; height: 51px;`:
placed at the box (within a few px, from its font metrics), moved down by an explicit leading
(36 px gives `top: 72.948px`), and sized by its text rather than the box (centred "Hi" in the
same box: `width: 19px; height: 17px;`). Do the same; point text keeps its position only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A `"` in a layer name ended `url("…")` early, a backslash started an escape, and a `"` in a font
family was turned into `'`, which names another font. Write each name as a CSS string the way
CSSOM serializes one (`\"`, `\\`, hex escapes for control characters). Photoshop 2025 writes
these names unescaped (`url("Say "hi".png")`); ordinary names come out exactly as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A layer named "2nd Box" gave `.2nd_Box`, which isn't a valid class selector. Photoshop 2025
writes `._2nd_Box`: it puts a `_` in front of a leading digit and turns a hyphen into `_` like
the other punctuation ("-2x" is `._2x`, "my-box" `.my_box`). Do the same.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Photoshop's Layer › Copy CSS puts CSS for the selected layers on the
clipboard. The new engine command layer.copyCSS writes each layer as a
class named after it (characters CSS doesn't allow become _): a type
layer's font size, family, colour, line height and alignment, a solid
fill or shape's background colour, or an image named after the layer;
then its opacity under 100 %, its absolute position and size (none for
type) and its z-index from the bottom, in Photoshop's format and order.
The Layer menu item copies the result to the clipboard.
Fixes#9372
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Colours: AlphaColor components are straight, not premultiplied; use
them directly instead of dividing by alpha (the opacity test now
checks RGB, not just alpha).
- Text: key families by font content key, not PostScript name, so two
faces with one name cannot share a family. Keep text layers at the
path index where their glyphs were painted instead of appending them
after all paths.
- Correctness: reject bow-tie clip paths, start a new subpath after
close, fall back on unparseable/unsupported glyph mappings, truncated
content, failed font registration, and shape-cache budget exhaustion.
- Cancellation: check between text-cache renders as well as between
objects.
- Include Bezier control points in the cache-size estimate; cache the
content hash per Hayro font identity.
- Docs: ImportOptions/CLI help now describe editable text and the
embedded-font caveat. Tests: text cache is not blank, paint order,
bow-tie clip, line after close, cancellation between objects.
FredApps [P2] on bfdf12463: the Lasso reads its own raw pointer events
(`lasso_ui::canvas_input` takes `ctx.input().events` directly), so the `buttons`
starvation the other tools get never reaches it. A press that dismissed the canvas
tool menu still drew a Lasso selection, leaving the shared selection-menu case of
the dismissal fix incomplete. The Freeform Pen draws through the same dispatcher.
Gate the dispatcher on `menu_dismiss_press`, as the Crop press above it is gated.
The regression follows the reported case: right-click at document (300, 100), then
left-press outside the menu at (50, 250) and drag through (50, 200), (150, 200),
(150, 250), release. It asserts no drag is left behind, no selection and no history
step, and that the next ordinary Lasso drag draws again.
Fails on bfdf12463 at "the consumed gesture must draw no selection", passes here.
Between the Clean after each stroke toggle and Wet: Custom, then Dry, Moist,
Wet and Very Wet with their Light/Heavy variants (separators above each
group). Picking an entry sets Wet, Load and Mix in one change and leaves
Flow; the picked entry stays shown after a typed value, and Reset Tool shows
Custom again.
The Current Brush Load menu gets a separator and the checkable entry Load
Solid Colors Only, off by default and kept with the Mixer Brush's own brush
(MixerSettings.solid_colors_only). With it on, Alt+click loads the one
colour under the hotspot (paint.mixerLoad) instead of the sampled tip image;
off, it loads the tip image as before.
When an earlier document is held for its profile prompt and the next open skips the prompt, admission numbers the second document photo-1 again, but the reply reported the name read before admission (photo-2). The reply now reads the name from the admitted document.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Model-Effort: Opus 5.5 drove; Opus 5.5 briefed; Sonnet 5.5 wrote at medium
The Brush must open its alert; the other tools must keep the status-bar
message and open no dialog, as #11898 asks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The test checked the quad only after release, so a regression that put
the neighbours back only on Up would have passed with a skewed preview
during the drag. It now also checks the quad right after the Alt-free move.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Always suffix an embedded face's alias with a hash of its bytes, so the
same PostScript name from different documents cannot collide in the
process-wide shared engine; a face imported twice reuses its entry.
Registration is skipped when the alias or an installed full family is
already present.
- Release the shared text engine lock between layers so a text-heavy
import does not block the UI's layout for the whole cache loop.
- Test: two documents with one font name but different bytes get
distinct aliases and both families are present in the shared engine.
- Register imported fonts in photocraft_text::shared() so the app can
re-lay text after edits or DPI changes. Prefer an installed full
family, and register an embedded face under its PostScript name
(key-suffixed when two faces share it) so a subset cannot shadow it.
- Warn that text using PDF-embedded fonts may change font when edited or
reopened; the document format does not carry the bytes yet.
- Reject mirrored text and b == -c matrices; scale the tolerance by the
em size so 90-degree text stays editable. Tests for rotated and
mirrored text.
- Use pdfcer's 0.30 em line tolerance.
- Text: build one TextLayer per line/style run from the Device's glyph
draws. Derive the family from the PostScript name (subset tag, style
suffix, MT/PS, camel spacing); italic from the font flags/attributes
or name; bold from the weight or name; pair fill+stroke glyphs as fake
bold (Tr 2/6) instead of a second run.
- Require an embedded font with a PostScript name; standard-14/Type 1
substitutes and Type 3 text fall back to the raster page.
- Register embedded font bytes in the text engine, use the family the
font reports, and render text caches on import. Tests compare the
text composite with the raster page.
- Review fixes: accept a page-sized no-op clip; draw zero-width strokes
as 1 px hairlines and use 1 px as the dash base; reject non-uniform
stroke transforms; repeat odd dash arrays and keep zero dashes;
ExtGState ca/CA already reach the colour alpha (tested); note that
catch_unwind only guards unwinding profiles.
Add an experimental, opt-in PDF path importer on craft-pdf's interpret
Device. Fills and strokes become ShapeLayers in document pixels with
their real colours, widths and dash patterns; text, images, clipping
paths, transparency groups, patterns, soft masks and annotations keep
the raster page with a warning, so a page is never half imported.
- ImportOptions::pdf_editable (off by default) and --pdf-editable.
- pdf-editable Cargo feature in photocraft-io; the CLI enables it.
- Shape caches are rendered within a 256 MiB page budget.
- Cancellation is forwarded through a 5 ms watcher; hostile pages are
caught and fall back instead of panicking.
Tests cover fill/stroke colours and dashes, composite parity with the
raster page, text fallback and cancellation.
A restored fractional Tolerance (12.5) reached the stroke unrounded while the
options bar was hidden, and as 13 once the bar had shown it. The stroke params
now round it with the field's rule, as the Background Eraser's do.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
At Smoothing 0 % the gear's four Smoothing Options (Pulled String Mode,
Stroke Catch-up, Catch-up on Stroke End, Adjust for Zoom) are drawn
greyed and can't be toggled, keeping their values, as in the reference
application; above 0 % they work again. For the Brush and the Eraser,
the tools with this gear.
Shift pressed after mouse-down snaps the Patch offset to the dominant axis (0/90 degrees only, no 45); the outline, the live preview and the applied patch use the snapped offset; Shift at mouse-down still adds to the selection. Four tests in patch_shift_constrain_tests.rs cover snapping, the three consumers, the add-at-press case and the no-45-degree case.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Model-Effort: Opus 5.5 drove; Opus 5.5 briefed; Sonnet 5.5 wrote at medium
On the Eraser's bar, Opacity and Flow take whole percents 1-100 and
Smoothing 0-100; a value typed past the range keeps the closest one and,
once the field is left, the reference application's alert says so with
OK. A new widgets::value_field_whole_alerting reports the clamp. The
Brush's bar (not measured) keeps today's silent clamp.
With the Eraser in Block mode, a plain right-click on the canvas opens
the Brush / Pencil / Block menu at the pointer instead of the Brush
Preset picker, whose Size and Hardness mean nothing for the Block, as in
the reference application. Picking an entry sets the mode without
erasing or adding history. Brush and Pencil mode keep the picker,
Shift+right-click opens the menu in every mode, and with the Erase
preference a right-click still erases.
The Color Replacement options bar's Tolerance takes whole numbers 1-100
as the Background Eraser's does (its field, now shared): a value typed
past the range becomes the closest one with the reference application's
alert, a fraction the nearest whole number, text that isn't a number
nothing. paint.colorReplacement runs tolerance 0 and below as 1, and the
bar's Mode, Limits, Tolerance and Anti-alias get the reference tooltips.
paint.colorReplacement and its live stroke refuse the modes and depths
the reference application refuses, with its words: 32 bit per channel
RGB, Grayscale and Bitmap (only full color modes), and Indexed Color.
Nothing is painted and no history is added. RGB/8, RGB/16, CMYK and Lab
paint as before; cases that weren't measured keep today's behaviour.
CodeRabbit round 2 on #12212:
- 4504550937 (b): a PSD that recovered from damaged data is held for File > Open's confirmation (the app passes confirmDamage; headless callers open it as before).
- 4504550942: a document held for its prompt counts when numbering, and the number is re-taken when each document is admitted, so two held files with one stem no longer share a name.
- 4504550943 is not changed here (needs colour transforms at regeneration), as are 4504550937 (a), (c) and 4504550953.
- 4504550946: the successful reply carries smartObject, so a document queued behind another open prompt is admitted with the Open As Smart Object history label.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Model-Effort: Opus 5.5 drove; Opus 5.5 briefed; Sonnet 5.5 wrote at medium