Skip to content

v1.0.0-rc.1

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 04 Dec 21:37
· 6 commits to main since this release

Released on 4 December 2026.

News

  • Paper.js 1.0 is a rewrite in TypeScript as ES modules, with its own type declarations. MIGRATION.md lists the changes that can break existing code, with the old and the new form side by side.
  • paper works as before: import it, call paper.setup(canvas) and draw. paper/core has the classes alone, so bundlers include only what an app uses, e.g. 15 KB for Point (#1844).
  • paper/boolean, paper/offset and paper/smoothing work on plain path data, without items. paper/node runs Paper.js on Node.js, paper/paperscript adds PaperScript, and paper/hosted lets an application back projects with its own documents, so scripts work on the application's items.
  • Views handle pointer events, so a mouse, pen or finger works the same everywhere.
  • Stroke profiles, outlines and offsets are faster and much more robust.

Added

  • Add the entry points paper/core, paper/boolean, paper/offset, paper/smoothing, paper/node and paper/hosted, and the script file dist/paper-hosted.js.
  • Add use(), which adds the features that paper/core leaves out: boolean operations, offsetting, SVG, effects, tweens and rasters.
  • Add the factories Path.line(), Path.circle(), Path.rectangle(), Path.ellipse(), Path.arc(), Path.regularPolygon(), Path.star(), Shape.circle(), Shape.rectangle() and Shape.ellipse().
  • Add Item#expand(), which turns an item into plain items that draw the same, as Illustrator's Expand does (#953).
  • Add the options strokes, gradients and patterns to Item#transform().
  • Add Item#loadSVG(), Project#loadSVG() and Raster#load(), which return promises.
  • Add new Color(type, ...components), e.g. new Color('hsb', 0, 1, 1).
  • Make Line public, with new Line(from, to) and an infinite property (#1589).
  • Add Curve#getPeaks() and Numerical.solveQuartic().
  • Keep stroke profiles through boolean operations, offset() and interpolate(), and in SVG files written by Paper.js (#2505, #2506).
  • Let symbol items pass their style on to their definition's content, as SVG's <use> does (#1329).
  • Add button, buttons, pointerType and pressure to mouse and tool events (#1354).
  • Add Tool#onMouseEnter and Tool#onMouseLeave (#1462).
  • Add the canvas attribute input="off" for views that ignore the user's input (#1491).
  • Support current JavaScript syntax in PaperScript.
  • Add Effect#interactive, for effects quick enough to draw while the user interacts.
  • Return from View#dispatchKeyEvent() whether a handler prevented the default.
  • Document how to subclass items (#1050).
  • Add PatternDefinition#pitch and shift, which arrange the tiles as bricks, e.g. with shift: [0.5, 0], or as hexagons, with pitch: [0.75, 1], shift: [0, 0.5].
  • Add PatternDefinition#rightInFront and bottomInFront, which choose the tiles in front where the item reaches beyond its tile.
  • Add Point.coerce() and Size.coerce(), which read a single number as both coordinates, as point.multiply(2) and item.translate(10) do.
  • Take the coordinates of cubicCurveTo(), quadraticCurveTo(), cubicCurveBy() and quadraticCurveBy() as numbers, as canvas takes them.
  • Add the shadow option to Item#getBounds(), which includes the shadows of the item and its children.

Changed

  • Make the package ES modules only, for Node.js 22.22 or later, and let only its entries and script files be imported (#2035).
  • Rename dist/paper-core.js to dist/paper-slim.js.
  • Generate the type declarations from the sources, with null where values can be missing and unions for fixed sets of strings.
  • Make Item#name, Segment#name, Item#children and Tool#minDistance and its siblings null instead of undefined.
  • Return the path from its drawing commands, so calls can be chained (#605).
  • Read and write Item#pivot in the parent's coordinates, as position is (#1272).
  • Return a plain Rectangle from Item#getBounds() without arguments, and booleans from Item#replaceWith() and Matrix#isInvertible().
  • Read every argument of Path#add() and #insert() as a segment.
  • Start rectangles and ellipses where SVG starts them (#601).
  • Keep the items of symbol definitions in place instead of centering them (#2435).
  • Make PathItem#reorient() take { fillRule, clockwise } and use the item's fill rule.
  • Scale strokes and dashes along when an item applies a matrix it kept.
  • Make offset(), outline() and dash() fall back to the item's width and dashArray where these are null, and take a miterLimit of 0 as given.
  • Outline stroke profiles three times as fast, and offset and outline paths 10% faster.
  • Return a promise from Tween#then().
  • Rename text styles to their names in CSS, e.g. fontFeatures, letterCase and lineWrap, and default justification to 'start'.
  • Rename TextItem#range() and TextStory#range() to getRange().
  • Import the layers of SVG files written by Paper.js as layers again (#483).
  • Handle pointer events instead of mouse and touch events; event.event is a PointerEvent (#1354, #1959).
  • Read the characters of key events from keydown events.
  • List Project#selectedItems in drawing order.
  • Parse PaperScript as a module, and load scripts with src through fetch().
  • Run PaperScript through eval, so a content security policy has to allow unsafe-eval.
  • Run the page's PaperScripts only from the script files: with paper/paperscript, call PaperScript.load().
  • Return promises from exportFrames() and exportImage() on Node.js.
  • Decide from the environment whether views update by themselves: with a DOM of your own on Node.js, set view.autoUpdate = false.
  • Stop paper/hosted from changing the core classes when it loads, and rename the host's getItem() to getContent().
  • Stop clipping the item of a pattern by its tile: parts beyond it lie over the tiles around it, the left and top ones in front by default.
  • Replace PatternDefinition#tile by size, which defaults to the item's bounds.
  • Clip the content of patterns by their tiles in SVG import, as SVG draws them, and write each tile that reaches into a pattern's repeat in SVG export.
  • Throw an error for a single number where a point or size is expected, instead of reading it as both coordinates, so calls such as new Segment(10, 20) fail rather than draw in the wrong place.
  • Leave the id of canvases alone: views find themselves from their canvases, and no longer write ids such as paper-view-0 into them.
  • Unite, intersect and subtract several paths at once faster, by about a fifth to a third for 5 to 50 paths without stroke profiles.
  • Start the dashes of rounded rectangle and ellipse shapes where those of the same paths start, at the top left, as SVG converts rectangles.
  • Create items from their segments, children, path data or other arguments as from the same properties, so that new Path({ x, y, strokeColor }) sets its segment before its other properties, as new Path({ segments, strokeColor }) does.
  • Type selected only on the points and rectangles that items, segments and curves return, which are SelectablePoint and SelectableRectangle, as other points and rectangles can't be selected.
  • Type the properties of HitResult that only some kinds of hits have as optional: name, location, segment and point.

Removed

  • Remove the getter and setter methods, such as item.getPosition(): use the properties.
  • Remove argument forms that spread numbers, such as new Segment(x, y), and points given as strings.
  • Remove the constructors of predefined paths and shapes, such as new Path.Circle(): use the factories.
  • Remove paper.Symbol, paper.PlacedSymbol and the other deprecated APIs, listed in MIGRATION.md.
  • Remove Item.extend(): use class extends.
  • Remove PaperScope#execute(): use PaperScript.execute().
  • Remove loading files from importSVG(): use loadSVG().
  • Remove settings.scaleStrokes: use transform(matrix, { strokes: true }).
  • Remove paper.DomEvent, paper.DomElement, paper.Http and the undocumented static methods of Curve, listed in MIGRATION.md.
  • Remove support for node-canvas, jsdom and CommonJS, and the paper-jsdom packages.
  • Remove the key names of Internet Explorer, such as Spacebar.

Fixed

  • Fix slits, spikes, hairlines and other defects in the outlines of strokes and stroke profiles.
  • Fix offset() of stroke profiles and of paths with tiny handles or no length.
  • Fix boolean operations losing areas, and divide() of touching paths.
  • Fix getIntersections(), contains() and hit-tests at cusps and where paths turn back.
  • Fix arcTo() and its siblings for straight arcs.
  • Fix object literals for rectangles, and properties left over by the factories.
  • Fix gradient stops without an offset, and Gradient#equals().
  • Fix Segment#reverse(), Segment#interpolate() and evaluating curves at locations.
  • Fix the stroke bounds, hit-tests and interpolate() of compound paths.
  • Fix pivots after toShape(), copies and boolean operations.
  • Fix Matrix#scale(), #shear() and #invert() on the matrix of an item.
  • Fix raster.width = …, which lost the raster's content.
  • Fix effects applying the opacity and blend mode of their item twice.
  • Fix new Path([]), Item#addChildren() of several items, and TextStory#replace().
  • Fix selected paths drawn with another scope's settings.
  • Fix SVG import of <use> styles (#1329), the styles and rotation of text (#2665, #2784), strokes in transformed groups, and empty polygons.
  • Fix nested SVG imports and exports, and exporting items scaled to nothing.
  • Fix repeated mouseenter events, and views sharing their state.
  • Fix drags with two mouse buttons (#1355) and mouse moves with pointer lock (#1802).
  • Fix event.modifiers and the values of tool events, which changed after the event.
  • Fix handlers returning 0 or '' stopping events.
  • Fix PaperScript reading names in comments and strings as globals.
  • Fix the declarations for apps with strict settings.
  • Resolve references to the host's definitions, such as ['@pattern/Dots'], in importJSON() of hosted projects, where they stayed arrays and failed later, e.g. in a current style with a pattern fill.
  • Name the key in the error when the host of a project has no definition for it, instead of failing on null.
  • Include shadows in Item#previewBounds, so that Item#rasterize(), pattern tiles and groups with an opacity no longer cut them off.
  • Keep the matrix of groups and compound paths that Item#reduce() replaces by their single child, which also misplaced the results of boolean operations, outline() and dash() of such compound paths.
  • Fix the bounds of transformed items that keep their matrix, which ignored changes to their children.
  • Send the events of canvases that share an id, as in different shadow roots, to their own views.