From b54f3888e3a4ca7d46ee825e08ec3912070f7f26 Mon Sep 17 00:00:00 2001 From: Tac Tacelosky Date: Thu, 30 May 2024 13:40:04 -0600 Subject: [PATCH 1/3] add link to konva-dev This extension is invaluable for debugging. --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index f60a2363d..48eb3c938 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,10 @@ Konva works in all modern mobile and desktop browsers. A browser need to be capa At the current moment `Konva` doesn't work in IE11 directly. To make it work you just need to provide some polyfills such as `Array.prototype.find`, `String.prototype.trimLeft`, `String.prototype.trimRight`, `Array.from`. +# Debugging + +The Chrome inspector simply shows the canvas element. To see the Konva objects and their details, install the konva-dev extension at https://github.com/konvajs/konva-devtool. + # Loading and installing Konva Konva supports UMD loading. So you can use all possible variants to load the framework into your project: From 01f4bb605e1cee8c68cbfc1474c5b920a6a9c33b Mon Sep 17 00:00:00 2001 From: Elazar Kopyrin Date: Mon, 3 Jun 2024 20:20:05 +0300 Subject: [PATCH 2/3] Update `fill` type to accpet `CanvasGradient` --- src/Shape.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Shape.ts b/src/Shape.ts index 6f403878c..8d5a27ffb 100644 --- a/src/Shape.ts +++ b/src/Shape.ts @@ -26,7 +26,7 @@ export type LineJoin = 'round' | 'bevel' | 'miter'; export type LineCap = 'butt' | 'round' | 'square'; export interface ShapeConfig extends NodeConfig { - fill?: string; + fill?: string | CanvasGradient; fillPatternImage?: HTMLImageElement; fillPatternX?: number; fillPatternY?: number; From 52977b5c0c98007ee890555ed58aaa8f9f47cc5a Mon Sep 17 00:00:00 2001 From: Elazar Kopyrin Date: Mon, 3 Jun 2024 22:18:08 +0300 Subject: [PATCH 3/3] Update `fill` and `stroke` GetSet type to accept `CanvasGradient` --- src/Shape.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Shape.ts b/src/Shape.ts index 8d5a27ffb..de9ef0708 100644 --- a/src/Shape.ts +++ b/src/Shape.ts @@ -766,7 +766,7 @@ export class Shape< dash: GetSet; dashEnabled: GetSet; dashOffset: GetSet; - fill: GetSet; + fill: GetSet; fillEnabled: GetSet; fillLinearGradientColorStops: GetSet, this>; fillLinearGradientStartPoint: GetSet; @@ -815,7 +815,7 @@ export class Shape< shadowOffsetY: GetSet; shadowOpacity: GetSet; shadowBlur: GetSet; - stroke: GetSet; + stroke: GetSet; strokeEnabled: GetSet; fillAfterStrokeEnabled: GetSet; strokeScaleEnabled: GetSet;