From 3f2c2e504297ba118587666dae305a6cf415150e Mon Sep 17 00:00:00 2001 From: Anton Lavrenov Date: Thu, 27 May 2021 10:12:44 -0500 Subject: [PATCH] fix readme --- README.md | 11 ++--------- src/Layer.ts | 5 +++-- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index c642bd48..7ac509db 100644 --- a/README.md +++ b/README.md @@ -123,21 +123,14 @@ import { Blur } from 'konva/lib/filters/Blur'; ### 4 NodeJS env -We are using [node-canvas](https://github.com/Automattic/node-canvas) to create canvas element. -Please check installation instructions for it. Then just run +In order to run `konva` in nodejs environment you also need to install `canvas` package manually. Konva will use it for 2d canvas API. ```bash -npm install konva-node +npm install konva canvas ``` Then in you javascript file you will need to use -```javascript -const Konva = require('konva-node'); -``` - -See file `konva-node/demo.js` file in this repo as a sample. - # Backers - [myposter GmbH](https://www.myposter.de/) diff --git a/src/Layer.ts b/src/Layer.ts index 8a20ca9d..5408d4c0 100644 --- a/src/Layer.ts +++ b/src/Layer.ts @@ -86,7 +86,7 @@ export class Layer extends Container { /** * get native canvas element * @method - * @name Konva.Layer#getCanvas + * @name Konva.Layer#getNativeCanvasElement */ getNativeCanvasElement() { return this.canvas._canvas; @@ -263,7 +263,8 @@ export class Layer extends Container { } _setSmoothEnabled() { - this.getContext()._context.imageSmoothingEnabled = this.imageSmoothingEnabled(); + this.getContext()._context.imageSmoothingEnabled = + this.imageSmoothingEnabled(); } /** * get/set width of layer. getter return width of stage. setter doing nothing.