Skip to content

v2.0.0

Latest
Compare
Choose a tag to compare
@github-actions github-actions released this 02 Dec 19:59

New Features

  • Docs Website
  • Imagery
  • Typography
  • GUI
    • New Window property resizable allows resizing to be disabled
    • Added keyboard support for CJK IME via compose* and input events
  • Rendering
    • New Canvas engine property gives status of GPU or CPU renderer
    • The number of background threads used for asynchronous exports can now be set with the SKIA_CANVAS_THREADS environment variable
    • The sample-count used by the GPU for multiscale antialiasing can now be configured through the optional msaa export argument. If omitted, defaults to 4x MSAA.

Breaking Changes

  • The minimum required Node version is now 12.22+, 14.17+, or 16+.
  • Images now load asynchronously in cases where the src property has been set to a local path. As a result, it's now necessary to await img.decode() or set up an .on("load", …) handler before drawing it—even when the src is non-remote.
  • The KeyboardEvent object returned by the keyup/keydown and input event listeners now has fields and values consistent with browser behavior. In particular, code is now a name (e.g., ShiftLeft or KeyS) rather than a numeric scancode, key is a straightforward label for the key (e.g., Shift or s) and the new location field provides a numeric description of which variant of a key was pressed.
  • The deprecated .async property has been removed. See the v0.9.28 release notes for details.
  • The non-standard .textTracking property has been removed in favor of the new .letterSpacing property

Bugfixes

  • Made Vulkan device selection & initialization more reliable
  • The Image.onload callback now properly sets this to point to the new image (contributed by @mpaperno & @ForkKILLET).
  • Creating a Window with fullscreen set to true now takes effect immediately
  • Drawing paths after setting an invalid transform no longer crashes (contributed by @mpaperno)
  • Windows with .on("draw") handlers no longer become unresponsive on macOS 14+ after being fully occluded by other windows
  • Ellipses with certain combinations of positive and negative start- and stop-angles now render correctly—previously they would not appear at all if the total sweep exceeded 360° (contributed by @mpaperno)
  • The drawCanvas() method now clips to the specified crop size (contributed by @mpaperno)
  • isPointInPath and isPointInStroke now work with Path2D objects

Misc. Improvements

  • Upgraded Skia to milestone 131
  • Added more thorough TypeScript definitions
  • Significant performance improvements to FontLibrary and getImageData(), which now makes use of the GPU (if enabled) and caches data between calls
  • New Vulkan renderer using Vulkano for window-drawing on Windows and Linux.
  • Wait to initialize GPU until it is used, not at startup. Set Canvas.gpu to false to prevent any GPU-related resource acquisition from occurring
  • Now supports ES Modules and the import statement
  • The getImageData() method now makes use of the GPU (if enabled) and caches data between calls, greatly improving performance for sequential queries