Commit Graph
19817 Commits
Author SHA1 Message Date
dotCooCoo 49d4698c6a 3D: a twisted bevel's smoothed normals follow its curved pieces
With a twist, a band cuts each edge into pieces whose cut corners lie on
the art's curve, but the smoothed mesh normals and the 60 degree crease
test were worked out on straight chords between the edge's corners. On
a curved outline the normals then described quads other than the faces
the mesh holds. The corner rule is now one function, cut_corner, which
curved_band and smoothed_rows both use, so each piece's smoothed normal
comes from the quad that is built. Straight and uncut edges are as
before.

The test a_twisted_round_bevels_smoothed_normals_follow_its_curved_pieces
checks that each smoothed corner of a twisted, rounded bevel on a circle
is the mean of the normals of the two faces that meet there, with and
without perspective.
2026-11-22 03:56:16 -08:00
dotCooCoo 80b90c5ebb Quick Pen: a length drag out and back to the same length records no undo step
A length drag that changed the length and then came back to where it
started previewed the path again at its first length, so letting go
recorded an undo step for an unchanged path. A drag that ends at the
length the piece started with is now taken back as Escape takes it
back, on the path being drawn and on a selected path.
2026-11-22 02:07:27 -08:00
dotCooCoo d1eb3f4ad3 Merge main into feat/quick-pen-length-handles 2026-11-22 01:38:35 -08:00
dotCooCoo 47276ca0f2 Quick Pen: the stale-hover tests allow the path's length handles
The two tests that check a stale hover's Smart Guides stay hidden with
Smart Guides off counted every overlay other than the path's points as
a guide. The length handles at the ends of the path being drawn now
show there too, so the tests failed although the guides were hidden.
The shared check accepts a handle and the line to it from the path's
end, and still fails when the tool shows a stale hover's guides.
2026-11-22 01:38:31 -08:00
dotCooCoo 33bcf63381 JavaScript: a global function declaration reads the global object's own property
With ES2015 scripts, a function declaration was judged by a property the
global object inherits, so a fixed property on Object.prototype stopped
`function name() {}`. The check now reads the global object's own
property, as ECMA-262 2015 section 8.1.1.4.16 does, and declares nothing
when the global object is not extensible and has no property of that
name. Indirect eval code makes the same check for all of its functions
before it declares any of them, and a function declaration never adds a
property to a global object that is not extensible.
2026-11-22 01:13:14 -08:00
dotCooCoo 4447e02955 JavaScript: a rest parameter checks the heap before its array is made
A call to a function with a rest parameter built the array of its extra
arguments without reserving room for it, so `f.apply(null, big)` could
push the heap estimate past the limit. The call now counts the rest
array, its binding and one property per extra argument in the room it
reserves before the function's environment is made.
2026-11-22 00:52:01 -08:00
dotCooCoo e5a1f339c3 JavaScript: spreading a string counts its flattened copy against the heap
Spreading a concatenated string (`[...s]`, `f(...s)`) flattened it before
any limit was checked, so a script could make the host build the whole
copy before the per-element fuel and heap accounting ran. The spread now
flattens through the same counted helper the string built-ins use, which
ends the run with the heap limit before the copy is made.
2026-11-22 00:44:02 -08:00
dotCooCoo e1e99023c2 Scripts: a failed UnitValue install leaves no constructor or operators behind
When defining the UnitValue members fails part way, the realm turns the
unit operators off again and restores the global UnitValue to what it was
before the call, so a second add_unit_values() installs everything.
2026-11-22 00:30:42 -08:00
dotCooCoo af91c28c64 Merge main into feat/scripts-unitvalue 2026-11-22 00:30:37 -08:00
dotCooCoo 70a56fb5be Path Precision Tools: Add Inscribed Circle bounds its work and memory
- The searches for all the selected objects share one limit of
  134,217,728 distances from a point to an edge, as Add Bounding Circle
  shares its splits, and each cell is measured only when the limit has
  room for it. One search keeps at most 1,048,576 cells waiting. The
  pathops crate adds inscribed_circle_within for a shared budget.
- The search stops once its best center is within the precision of half
  the box's narrower side, so a long rectangle ends at its first cells,
  and cells that cannot beat the best center are no longer queued.
- A fill much smaller than the precision still gets a circle: the
  search keeps splitting until it finds a center inside the outline.
- The precision also follows the box of the area the fill rule leaves.
- Flattening stops at the first curve past the edge limit. An outline
  that flattening closes up, or whose center lands outside the curves,
  is flattened up to four times, 16 times finer each time; one it still
  cannot resolve is too complex to measure, not empty. Areas are summed
  from each contour's own first point.
- An outline with more than 262,144 anchors in its filled subpaths is
  refused before it is resolved.
- A selected layer is refused like any other object that is not a path,
  and inside an isolated compound path the circles join it, as Tangent
  Circle's do.
- The menu item uses a named constant, and a UI test checks that it
  runs the command with no dialog and selects a new live circle in each
  selected shape, as one undo step.
- The params text and docs say that the 0.02 pt bound holds before the
  circle is drawn 0.03% smaller, that a shape under 10 pt across is
  measured to a five-hundredth of its narrower side, when long curves
  are flattened more coarsely, and that edges can move by 1e-6 pt as in
  the other path operations.
2026-11-21 23:53:37 -08:00
dotCooCoo e717698e02 Scripts: Annex B block functions are judged one declaration at a time
A function declared in a block sets the enclosing variable of its name
only when that declaration itself is eligible, so a declaration inside
a let of the same name no longer assigns the variable because another
declaration of that name elsewhere in the body is eligible.
2026-11-21 23:37:47 -08:00
dotCooCoo 2ba5dd3735 Scripts: spread reads lengths with ToLength and function scopes stay rooted
Spread of an object with a length property reads the length with
ToLength, so a negative or NaN length adds no elements instead of
wrapping to a count near 2^32. A function body's environments stay on
the collector's roots while its scope, functions and arguments object
are made.
2026-11-21 23:31:38 -08:00
dotCooCoo 21ce815b34 Scripts: global let and const reach functions from every run
Global code runs in the realm's lexical scope in either language, so a
function an earlier ES5.1 run, an indirect eval or the Function
constructor made can read a let or const a later .js run declares. With
the ES2015 option, a script whose function cannot replace a property of
the global object throws a TypeError before any of its let or const
names is declared, so a failed run leaves no name uninitialized.
2026-11-21 23:24:52 -08:00
dotCooCoo f287c5fabb Docs: name the failing test262 runs as ECMAScript 2015 rules 2026-11-21 23:07:28 -08:00
dotCooCoo 8d0001308f Merge main into feat/js-es2015-block-arrow-template 2026-11-21 22:52:36 -08:00
dotCooCoo c48b3e8c93 Merge main into feat/three-d-mesh-attributes 2026-11-21 22:34:22 -08:00
dotCooCoo ecc9a35499 Retype: each mark of a compound path keeps its own other character
The other character a shape read as a combining mark also is was kept
by the shape's id. The parts of a compound path share that id, so with
two such marks in one compound the second mark's character replaced the
first's, and a split that left the first mark first on a line set it as
the second mark's character (a dot below became a small tilde). The
character is now kept by the part's own glyph match, and the new test
moves a dot below and a tilde off their base into one compound path.
2026-11-21 21:58:11 -08:00
dotCooCoo b364b31523 3D: curved_band takes its two rings as one argument
curved_band took eight arguments once it gained the mesh's band data,
and an allow attribute silenced clippy's too_many_arguments lint. It now
takes the partner rings as one [a, b] array, and the allow attribute has
been removed.
2026-11-21 21:53:47 -08:00
dotCooCoo 6f0af81f91 3D: a twisted bevel's cut edges keep their smoothed normals
With a twist, each edge of a band is cut into pieces, and the mesh gave
those pieces their flat face normals, so a rounded or custom bevel with
a twist was exported faceted. The smoothed normals are now worked out
for each piece of each edge, from the same pieces the band is cut into,
and every piece takes its own.

The test a_twisted_rounded_bevel_keeps_its_normals_smoothed_on_every_piece_of_a_cut_edge
checks that where the pieces of two bevel bands meet, the two bands
give each piece one normal.
2026-11-21 21:49:44 -08:00
dotCooCoo 26200f0599 Smooth: read the anchors around a run through the edited list
The merge of main brought in code that indexes the anchor list while
smooth_open now keeps it in an EditsFromEnd, which has no indexing, so
the engine did not build. The anchors at both ends of a run and of its
neighboring segments are now read from the span that EditsFromEnd::get
returns.
2026-11-21 21:44:17 -08:00
dotCooCoo 4b176782be 3D: caps, Rotate's plane and Inflate's faces take UVs in the object's bounds
Extrude & Bevel's caps, Rotate's plane and Inflate's front and back took
their texture coordinates in the bounds of each part's own rings, so a
part smaller than its object had its coordinates stretched to its own
extent and did not line up with the object's other parts. They now use
the bounds the solid is built with, which every part of one object
shares, as the Turn, Placing and Camera transforms already do.

The test the_parts_of_one_object_place_their_caps_and_planes_in_its_shared_bounds
builds a small part inside a larger object's bounds with each effect and
checks every front and back corner against the shared bounds.
2026-11-21 21:39:03 -08:00
dotCooCoo 675c53eed6 Merge main into fix/retype-drawn-shape-font-state 2026-11-21 21:21:54 -08:00
dotCooCoo cd03842fb1 Docs: path.smoothRegion states its sampling limits and acceptance test
docs/mcp.md now says the measuring spacing is a target (at least 4 and at
most 1,024 pieces per curved segment, fewer on subpaths of more than 256
segments) and gives the acceptance test as formulas: t1 <= t0 + 0.001 * s
and fewer anchors, t0 - t1 >= 0.000001 * s, or b0 - b1 > 0.0001 * b0,
with s the larger of t0 and 1. The roughness doc comment says the points
are about `step` apart.
2026-11-21 21:18:03 -08:00
dotCooCoo 68602e24ad Merge main into fix/smooth-region-bounds-prefilter 2026-11-21 21:11:55 -08:00
dotCooCoo 5379d77fec Merge main into feat/dimension-alt-object-size 2026-11-21 21:06:53 -08:00
dotCooCoo dc9a724b6a Merge main into fix/script-export-linked-files 2026-11-21 21:04:37 -08:00
dotCooCoo 47840d28e3 Scripts: the large km to mi test checks the converted value
The expected value multiplied 1e307 by 1000 before dividing, which
overflows to infinity, so the closeness check accepted any finite
result. The expected value now divides the factors first.
2026-11-21 21:04:03 -08:00
dotCooCoo 39e2a19ee0 Merge main into feat/quick-pen-arc-center-i9314 2026-11-21 20:52:46 -08:00
dotCooCoo f312abf05a Merge main into fix/smooth-no-worse-pass 2026-11-21 20:52:42 -08:00
dotCooCoo 7d3094afe6 Scripts: .js scripts run let, const, arrows, templates, default and rest parameters and spread
vectorcraft-js gains Options::es2015, which reads and runs these
ECMAScript 2015 forms: let and const with block scope and their
temporal dead zone, a new let binding for each loop iteration,
function declarations scoped to their block (with the Annex B.3.3
variable outside strict mode code), arrow functions, template
literals and tagged templates, default and rest parameters, and
spread in array literals, calls and new. Spread reads arrays,
strings by code point and objects with a length, by index, and
throws a TypeError for anything else until iterators are added.

Eval code outside strict mode code cannot declare a var that clashes
with a let or const around it, or with a parameter inside a default
value. Spread, template objects and the new scopes take fuel and
count against the heap limit, and nested arrows and templates count
against the depth limit.

script.run sets the option for a .js file; eval, Function, #include
files, $.evalFile and a kept #targetengine read code the way the
running script does. A .jsx file and a source string stay ES5.1.

The test262 runner gains an ES2015 subset run, read without and with
the option. docs/mcp.md and docs/target-app-parity.md describe the
new forms.
2026-11-21 20:43:20 -08:00
BFlat db9acab4da Merge pull request #9004 from dotCooCoo/fix/retype-even-odd-turned-counters
Retype: a glyph in an even-odd compound matches with only some of its contours reversed
2026-11-22 11:38:53 +07:00
BFlat 90cd5eef57 Merge pull request #9016 from dotCooCoo/fix/dynamic-symbol-part-selection-paint
Symbols: Direct Selection picks a dynamic instance's part where its fill and stroke effects draw it
2026-11-22 11:38:33 +07:00
BFlat f03d04b91b Merge pull request #8996 from dotCooCoo/fix/simplify-smooth-keep-closed-start
Paths: Object > Path > Simplify and Smooth keep a closed path's start
2026-11-22 11:38:13 +07:00
BFlat 37610608f1 Merge pull request #8976 from dotCooCoo/fix/smooth-region-rejects-bad-params
Smooth: path.smoothRegion and path.joinScrub refuse a radius, fidelity or tolerance out of range
2026-11-22 11:37:54 +07:00
BFlat d13a06b2f2 Merge pull request #8963 from dotCooCoo/fix/live-paint-bucket-lent-tool-release
Live Paint: a Cmd-drag cut short keeps the bucket's colors
2026-11-22 11:37:34 +07:00
BFlat 1360f9ac6f Merge pull request #8961 from dotCooCoo/fix/safe-mode-expand-hidden-symbol-art
Expand Appearance: Safe Mode skips art that a group's raster image leaves out
2026-11-22 11:37:14 +07:00
BFlat 789f5033bb Merge pull request #8954 from dotCooCoo/fix/params-textedit-rest
Type: text commands refuse a parameter of the wrong type
2026-11-22 11:36:54 +07:00
BFlat 55064f7f59 Merge pull request #8949 from dotCooCoo/feat/dimension-drag-reposition
Dimension tool: a drag from a dimension already drawn moves it
2026-11-22 11:36:34 +07:00
BFlat b9c9e82f74 Merge pull request #8943 from dotCooCoo/fix/font-version-rescan-and-steady-gate
Fonts: a rescan clears the version record after it publishes its catalog
2026-11-22 11:36:13 +07:00
dotCooCoo ceab5d7e11 Merge main into fix/script-grants-read-failure 2026-11-21 20:33:50 -08:00
dotCooCoo ee5b31420f Merge main into fix/pdf-masked-cmyk-warp-image-size 2026-11-21 20:27:47 -08:00
dotCooCoo f9498b1735 Merge main into fix/relink-mask-matching-file-path-docs 2026-11-21 20:27:41 -08:00
dotCooCoo 7e5b421db2 Scripts: UnitValue pixels and percentages use the left object's base
With two UnitValues and a left one in px or %, the right one is now
converted with the left one's baseUnit, so a 1 px value with a 2 pt base
plus 1 in gives 37 px. Conversions keep their intermediate values in
range, so a result that is a finite number no longer fails because a
step on the way overflows or reaches 0.
2026-11-21 20:25:38 -08:00
dotCooCoo e10c3f1157 Merge main into feat/quick-pen-length-handles 2026-11-21 20:17:47 -08:00
dotCooCoo 3a9c3a763f Merge main into fix/live-paint-bucket-journal-replay
# Conflicts:
#	crates/engine/src/cmd/library.rs
#	crates/engine/src/cmd/swatchlib.rs
#	crates/engine/src/cmd/xform.rs
2026-11-21 20:12:17 -08:00
dotCooCoo 1ab09c8978 Scripts: UnitValue measurements convert and calculate with their units
Scripts get the global UnitValue constructor: a number with one of the
length units (inches, feet, yards, miles, millimeters, centimeters,
meters, kilometers, points, picas, traditional points and picas,
ciceros), pixels or percent. as() and convert() give or change the
unit, baseUnit sets what one pixel and 100% measure, and the arithmetic,
comparison and unary operators calculate with the object's number. With
two objects the right one is converted to the left one's unit.

Conversions go through exact ratios to the inch, so 1 in is exactly
72 pt. An unknown unit or text makes an invalid object; converting it or
using it with an operator, a result that is not finite and a comparison
with a number that is not finite throw a RangeError.

A realm without UnitValue keeps the standard operators. docs/mcp.md
describes the class.
2026-11-21 19:56:57 -08:00
BFlat 1cf0a2806a Merge pull request #9045 from dotCooCoo/feat/quick-pen-arc-protractor-i9314
Pen: Quick Pen shows a protractor around an arc's center and snaps to its ticks
2026-11-22 10:54:06 +07:00
BFlat 7ad52eacb8 Merge pull request #9017 from dotCooCoo/fix/test262-runner-coverage
Tests: the test262 runner parses and runs the Annex B tests
2026-11-22 10:53:45 +07:00
BFlat f658b42bc6 Merge pull request #9013 from dotCooCoo/feat/psd-invert-threshold-posterize-layers
PSD import: apply Invert, Threshold and Posterize adjustment layers
2026-11-22 10:53:23 +07:00
BFlat 0aa2601eb9 Merge pull request #8995 from dotCooCoo/fix/3d-expand-inflate-bevel-twist-curves
3D: Expand Appearance keeps curves on Inflate faces, interior bevel edges and twist cuts
2026-11-22 10:53:03 +07:00