Skip to content

Releases: kyranet/canvas-constructor

canvas-constructor@1.1.1

11 Sep 21:19
Compare
Choose a tag to compare

Fixed

  • Fixed addCircularImage() not adding a circule clip before adding the image.

canvas-constructor@1.1.0

11 Sep 21:19
0371a62
Compare
Choose a tag to compare

Added

  • Added toDataURL() and toDataURLAsync().
  • Added addCircularImage(), similar to addCircle().
  • Added setTextSize(), similar to setTextFont() but changes the font size only (not the font itself).
  • Added all overloads for addImage().
  • (Documentation) Added MDN link for addImage().

Changed

  • createBeveledPath() now accepts an object type BeveledRadiusOptions.
  • Renamed addBevelImage() to addBeveledImage() to prevent confusions (naming inconsistency). The old method is still available but it's deprecated and will be removed in the next major update.

canvas-constructor@0.4.0

11 Sep 21:21
Compare
Choose a tag to compare
Pre-release

Added

  • addMultilineText() to print texts that are too long to be displayed.

canvas-constructor@0.3.1

11 Sep 21:18
Compare
Choose a tag to compare
Pre-release

Added

  • Both printLinearGradient() and printRadialGradient() to have chainable methods.
  • Added a new parameter for both createLinearGradient() and createRadialGradient(), steps, which is typeof GradientStep[].

Changed

  • Both createLinearGradient() and createRadialGradient() are not longer chainable, they'll return CanvasGradient instead.

canvas-constructor@0.3.0

11 Sep 21:18
Compare
Choose a tag to compare
Pre-release

Added

  • Typings. This package will also work in TypeScript.
  • createBeveledPath() same usage as createBeveledClip(), but does not create clips (so you can use shadows and fill to colourize it).
  • createRoundPath() same usage as createRoundClip(), but does not create clips (so you can use shadows and fill to colourize it).
  • clip() (how come this was not implemented?).

Changed

  • Canvas has been moved from dependency to peer dependency.

canvas-constructor@0.2.0

11 Sep 21:24
Compare
Choose a tag to compare
Pre-release

Changed

  • addResponsiveText() changed the parser to be passive, faster, and more accurate.

Removed

  • Two private methods that were being used in setTextFont().

canvas-constructor@0.1.7

11 Sep 21:18
Compare
Choose a tag to compare
Pre-release

Added

  • changeCanvasSize() to change the canvas' width/height.
  • changeCanvasWidth() to change the canvas' width.
  • changeCanvasHeigth() to change the canvas' heigth.

Removed

  • registerTextFont() as canvas-constructor relies on Canvas 1.6.6, this method is useless.

canvas-constructor@0.1.6

11 Sep 21:24
Compare
Choose a tag to compare
Pre-release

Added

  • setStrokeWidth() to change stroke/line's width.
  • beginPath() to start making paths.
  • closePath() to start closing paths.
  • createLinearGradient() to create linear gradients.
  • createRadialGradient() to create radial gradients.
  • arc() and arcTo(), to create arcs.
  • quadraticCurveTo() to create quadratic Bèzier curves.
  • bezierCurveTo() to create cubic Bèzier curves.
  • lineTo() to connect lines.
  • moveTo() to move the starting point of a path to any (x, y) coordinates.

Changed

  • Added default '#000000' for the setStroke() method.
  • addImage() removed this.save() and this.restore() so users can use their own paths.

Fixed

  • Examples for measureText().

canvas-constructor@0.1.5

11 Sep 21:25
Compare
Choose a tag to compare
Pre-release

Added

  • save() To save the current state onto a stack.
  • rotate() To add a rotation to the transformation matrix.
  • scale() To perform scaling transformations.
  • traslate() To perform translating transformations.
  • fill() To fill the current/given path.
  • stroke() To stroke the current/given path.
  • addStrokeText() To add stroked text.
  • measureText() To measure in pixels a text. Be careful, if you do not
    provide a callback (second argument), this method will return an Integer value
    instead of being chainable.
  • setTextBaseline() To set the text's baseline.
  • setShadowOffsetX() To set the shadow offset for the axis X.
  • setShadowOffsetY() To set the shadow offset for the axis Y.
  • setGlobalAlpha() To set the global alpha value for the next elements.
  • clearCircle() To clear the pixels with a circle shape.
  • clearPixels() To clear the pixels with a rectangle shape. (Usage is
    identical to addRect()).

Changed

  • Breaking | fillRect() -> addRect() | To keep consistency.
  • addText() now accepts a third argument: maxWidth.
  • addImage() now saves and restores the context.

Fixed

  • addRoundImage() now points to addImage() with the correct arguments.
  • addBevelImage() now points to addImage() with the correct arguments.

canvas-constructor@0.1.4

11 Sep 21:18
Compare
Choose a tag to compare
Pre-release

Fixed

  • Re-organized the badges