Compare commits

...

6 Commits

Author SHA1 Message Date
Anton Lavrenov
aa510ccbba Merge pull request #1970 from crazyurus/master
Some checks failed
Test Browser / build (20.x) (push) Has been cancelled
Test NodeJS / build (23.x) (push) Has been cancelled
Fix config parameter modified by toKonvaCanvas
2025-09-05 14:54:11 -05:00
Anton Lavrevov
40d7a934cd update ndoe 2025-09-05 10:19:18 -05:00
Anton Lavrevov
009076fd59 update cdn link 2025-09-05 07:47:00 -05:00
Anton Lavrevov
2063709e0e build for 10.0.0 2025-09-05 07:47:00 -05:00
Anton Lavrevov
53b358ed33 update CHANGELOG with new version 2025-09-05 07:46:58 -05:00
Crazy Urus
c7a9078911 fix: config parameter modified by toKonvaCanvas 2025-09-05 18:18:52 +08:00
6 changed files with 13 additions and 15 deletions

View File

@@ -3,11 +3,7 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
## 10.0.0-1 (2025-09-02)
- Brave detection and warning
## 10.0.0-0 (2025-08-14)
## 10.0.0 (2025-09-07)
### Breaking Changes
@@ -89,6 +85,7 @@ var text = new Konva.Text({
- **Performance**: Rewrote Emboss and Solarize filters for improved performance and usability
- Changed return type of `node.toImage()`
- Brave detection and warning
## 9.3.22 (2025-07-08)

View File

@@ -22,7 +22,7 @@ This repository began as a GitHub fork of [ericdrowell/KineticJS](https://github
# Quick Look
```html
<script src="https://unpkg.com/konva@9/konva.min.js"></script>
<script src="https://unpkg.com/konva@10.0.0-1/konva.min.js"></script>
<div id="container"></div>
<script>
var stage = new Konva.Stage({
@@ -75,7 +75,7 @@ Konva supports UMD loading. So you can use all possible variants to load the fra
### Load Konva via classical `<script>` tag from CDN:
```html
<script src="https://unpkg.com/konva@9/konva.min.js"></script>
<script src="https://unpkg.com/konva@10.0.0-1/konva.min.js"></script>
```
### Install with npm:
@@ -126,16 +126,20 @@ import { Blur } from 'konva/lib/filters/Blur';
### 4 NodeJS env
In order to run `konva` in nodejs environment you also need to install `canvas` package manually. Konva will use it for 2d canvas API.
In order to run `konva` in nodejs environment you also need to install `canvas` or `skia-canvas` package manually for rendering backend.
```bash
# node-canvas backend
npm install konva canvas
# skia-canvas backend
npm install konva skia-canvas
```
Then you can use the same Konva API and all Konva demos will work just fine. You just don't need to use `container` attribute in your stage.
```js
import Konva from 'konva';
import 'konva/canvas-backend'; // or import 'konva/skia-backend';
const stage = new Konva.Stage({
width: 500,

View File

@@ -1,6 +1,6 @@
{
"name": "konva",
"version": "10.0.0-1",
"version": "10.0.0",
"description": "HTML5 2d canvas library.",
"author": "Anton Lavrenov",
"type": "module",

View File

@@ -5,9 +5,6 @@ old_version="$(git describe --abbrev=0 --tags)"
new_version=$1
old_cdn="https://unpkg.com/konva@${old_version}/konva.js"
new_cdn="https://unpkg.com/konva@${new_version}/konva.js"
old_cdn_min="https://unpkg.com/konva@${old_version}/konva.min.js"
new_cdn_min="https://unpkg.com/konva@${new_version}/konva.min.js"
@@ -59,7 +56,7 @@ git tag $1 >/dev/null
cd ../konva
git push >/dev/null
git push --tags >/dev/null
npm publish --tag next
npm publish
echo "DONE!"

View File

@@ -228,7 +228,7 @@ export class Layer extends Container<Group | Shape> {
}
}
_toKonvaCanvas(config) {
config = config || {};
config = { ...config };
config.width = config.width || this.getWidth();
config.height = config.height || this.getHeight();
config.x = config.x !== undefined ? config.x : this.x();

View File

@@ -316,7 +316,7 @@ export class Stage extends Container<Layer> {
return this.content;
}
_toKonvaCanvas(config) {
config = config || {};
config = { ...config };
config.x = config.x || 0;
config.y = config.y || 0;