skia-canvas
Advanced tools
Changelog
📦 ⟩ [v1.0.2] ⟩ Aug 21, 2024
Changelog
📦 ⟩ [v1.0.1] ⟩ Oct 15, 2022
drawCanvas()
routine now works even when the destination canvas is later saved as an SVG (previously, the source canvas would be missing from the output). Caveat: this only works if the destination canvas is using the default source-over
blend mode, has its globalAlpha
set to 1, and is not using shadows or the effect
property. If any of those defaults have been changed, the drawn canvas will not appear in the saved SVG. Bitmap and PDF exports do not have this restriction.fullscreen
event to the Window
class to flag changes into and out of full-screen mode.Changelog
📦 ⟩ [v1.0.0] ⟩ Aug 5, 2022
.gpu
][canvas_gpu] property. If the platform supports hardware-accelerated rendering (using Metal on macOS and Vulkan on Linux & Windows), the property will be true
by default and can be set to false
to use the software renderer.reset()
][chrome_reset] context method which erases the canvas, resets the transformation state, and clears the current pathroundRect()
][chrome_rrect] method on contexts and Path2D objects which adds a rounded rectangle using 1–4 corner radii (provided as a single value or an array of numbers and/or DOMPoint objects)FontLibrary.reset()
method didn't actually remove previously installed fonts that had already been drawn with (and thus cached). It now clears those caches, which also means previously used fonts can now be replaced by calling .use()
again with the same family name..drawCanvas()
][drawCanvas] routine now applies filter effects and shadows consistent with the current resolution and transformation state..filter
][filter] property's "blur(…)"
and "drop-shadow(…)"
effects now match browser behavior much more closely and scale appropriately with the density
export option.clearRect()
with dimensions that fully enclose the canvas will now discard all the vector objects that have been drawn so far (rather than simply covering them up).Changelog
📦 ⟩ [v0.9.30] ⟩ Jun 7, 2022
reset()
][FontLibrary.reset] method to FontLibrary which uninstalls any fonts that had been dynamically installed via FontLibrary.use()
use()
][FontLibrary.use] method now checks for previously installed fonts with the same family name (or alias) and will replace them with the newly added fontclip
with an empty path (or one that does not intersect the current clipping mask) will now prevent drawing altogethertranslate
, rotate
, etc.) and line-drawing methods (moveTo
, lineTo
, ellipse
, etc.) are now silently ignored if called with NaN
, Infinity
, or non-Number values in the arguments rather than throwing an error
conicCurveTo()
][conicCurveTo] now correctly reflects the canvas's transform stateloadImage()
][loadImage] now returns a Promise that correctly resolves to an Image object<rect/>
as their first elementnode:alpine
docker images and the version used when building the precompiled binariesChangelog
📦 ⟩ [v0.9.29] ⟩ Feb 7, 2022
matte
][matte] argument.drawImage()
][mdn_drawImage] function is passed a Canvas object as its image source it will now rasterize the canvas before drawing. The prior behavior (in which it is drawn as a vector graphic) can now be accessed through the new [drawCanvas()
][drawCanvas] method which supports the same numerical arguments as drawImage
but requires that its first argument be a Canvas.clearRect()
][mdn_clearRect] are now properly antialiasedclip()
][mdn_clip] method now interprets the current translate/scale/rotate state correctly when combining clipping masksChangelog
📦 ⟩ [v0.9.28] ⟩ Jan 12, 2022
.async
property has been deprecated and will be removed in a future release.
saveAs
, toBuffer
, and toDataURL
methods will now be async-only (likewise the shorthand properties).saveAsSync
, toBufferSync
, and toDataURLSync
) if you want to block execution while exporting images.source-in
, source-out
, destination-atop
, and copy
composite operations now work correctly for paths rather than rendering shapes without color (contributed by @meihuanyu)rect()
now issues an initial moveTo
rather than extending the path, then leaves the ‘current’ point in its upper left cornerellipse()
extends the current path rather than implicitly closing it (contributed by @meihuanyu)arc()
also extends the current path rather than closing itChangelog
📦 ⟩ [v0.9.26] ⟩ Oct 18, 2021
icudtl.dat
fileFontLibrary.use
now reports an error if the specified font file doesn't existmeasureText
with various unicode escapesChangelog
📦 ⟩ [v0.9.25] ⟩ Aug 22, 2021
drawImage()
][mdn_drawImage]imageSmoothingQuality
settings to provide a more meaningful range across low
, medium
, and high
measureText()
now returns correct metrics regardless of current textAlign
settingicudtl.dat
changes on Windows (which suppressed the misleading warning message but required running as Administrator)Changelog
📦 ⟩ [v0.9.24] ⟩ Aug 18, 2021
d
property with an SVG representation of the path’s contours and an unwind()
method for converting from even-odd to non-zero winding rulescreateTexture()
context method returns CanvasTexture objects which can be assigned to fillStyle
or strokeStyle
setLineDash
is active can now be customized by assigning a Path2D to the context’s lineDashMarker
property (default dashing can be restored by assigning null
)lineDashFit
property which defaults to "turn"
but can be set to "move"
(which preserves orientation) or "follow"
(which distorts the marker’s shape to match the contour)??
operator which is unavailable prior to Node 14icudtl.dat
file could not be foundsimplify()
method now takes an optional fill-rule argument