Comparing version 9.3.0 to 9.3.1
@@ -136,4 +136,4 @@ import { Transform } from './Util.js'; | ||
_prepareArrayForTween(startArray: any, endArray: any, isClosed: any): number[]; | ||
_prepareToStringify(obj: any): any; | ||
_assign<T, U>(target: T, source: U): T & U; | ||
_prepareToStringify<T>(obj: any): T | null; | ||
_assign<T_1, U>(target: T_1, source: U): T_1 & U; | ||
_getFirstPointerId(evt: any): any; | ||
@@ -140,0 +140,0 @@ releaseCanvas(...canvases: HTMLCanvasElement[]): void; |
@@ -141,4 +141,4 @@ import { Arc } from './shapes/Arc.js'; | ||
_prepareArrayForTween(startArray: any, endArray: any, isClosed: any): number[]; | ||
_prepareToStringify(obj: any): any; | ||
_assign<T, U>(target: T, source: U): T & U; | ||
_prepareToStringify<T>(obj: any): T | null; | ||
_assign<T_1, U>(target: T_1, source: U): T_1 & U; | ||
_getFirstPointerId(evt: any): any; | ||
@@ -145,0 +145,0 @@ releaseCanvas(...canvases: HTMLCanvasElement[]): void; |
@@ -28,3 +28,7 @@ import { Node, NodeConfig } from './Node.js'; | ||
private _descendants; | ||
toObject(): any; | ||
toObject(): { | ||
attrs: any; | ||
className: string; | ||
children?: any[] | undefined; | ||
}; | ||
isAncestorOf(node: Node): boolean; | ||
@@ -35,5 +39,5 @@ clone(obj?: any): this; | ||
_setChildrenIndices(): void; | ||
drawScene(can?: SceneCanvas, top?: Node): this; | ||
drawScene(can?: SceneCanvas, top?: Node, bufferCanvas?: SceneCanvas): this; | ||
drawHit(can?: HitCanvas, top?: Node): this; | ||
_drawChildren(drawMethod: any, canvas: any, top: any): void; | ||
_drawChildren(drawMethod: any, canvas: any, top: any, bufferCanvas?: any): void; | ||
getClientRect(config?: { | ||
@@ -40,0 +44,0 @@ skipTransform?: boolean; |
@@ -171,3 +171,3 @@ "use strict"; | ||
} | ||
drawScene(can, top) { | ||
drawScene(can, top, bufferCanvas) { | ||
var layer = this.getLayer(), canvas = can || (layer && layer.getCanvas()), context = canvas && canvas.getContext(), cachedCanvas = this._getCanvasCache(), cachedSceneCanvas = cachedCanvas && cachedCanvas.scene; | ||
@@ -186,3 +186,3 @@ var caching = canvas && canvas.isCache; | ||
else { | ||
this._drawChildren('drawScene', canvas, top); | ||
this._drawChildren('drawScene', canvas, top, bufferCanvas); | ||
} | ||
@@ -208,3 +208,3 @@ return this; | ||
} | ||
_drawChildren(drawMethod, canvas, top) { | ||
_drawChildren(drawMethod, canvas, top, bufferCanvas) { | ||
var _a; | ||
@@ -240,3 +240,3 @@ var context = canvas && canvas.getContext(), clipWidth = this.clipWidth(), clipHeight = this.clipHeight(), clipFunc = this.clipFunc(), hasClip = (clipWidth && clipHeight) || clipFunc; | ||
(_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child) { | ||
child[drawMethod](canvas, top); | ||
child[drawMethod](canvas, top, bufferCanvas); | ||
}); | ||
@@ -243,0 +243,0 @@ if (hasComposition) { |
@@ -54,2 +54,3 @@ import { Canvas } from './Canvas.js'; | ||
rect(x: number, y: number, width: number, height: number): void; | ||
roundRect(x: number, y: number, width: number, height: number, radii: number | DOMPointInit | (number | DOMPointInit)[]): void; | ||
putImageData(imageData: ImageData, dx: number, dy: number): void; | ||
@@ -56,0 +57,0 @@ quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; |
@@ -42,2 +42,3 @@ "use strict"; | ||
'rect', | ||
'roundRect', | ||
'restore', | ||
@@ -281,2 +282,5 @@ 'rotate', | ||
} | ||
roundRect(x, y, width, height, radii) { | ||
this._context.roundRect(x, y, width, height, radii); | ||
} | ||
putImageData(imageData, dx, dy) { | ||
@@ -283,0 +287,0 @@ this._context.putImageData(imageData, dx, dy); |
@@ -19,3 +19,3 @@ "use strict"; | ||
_global: exports.glob, | ||
version: '9.3.0', | ||
version: '9.3.1', | ||
isBrowser: detectBrowser(), | ||
@@ -22,0 +22,0 @@ isUnminified: /param/.test(function (param) { }.toString()), |
@@ -24,2 +24,4 @@ import { Transform } from './Util.js'; | ||
scaleX?: number; | ||
skewX?: number; | ||
skewY?: number; | ||
scaleY?: number; | ||
@@ -95,3 +97,3 @@ rotation?: number; | ||
isCached(): boolean; | ||
abstract drawScene(canvas?: Canvas, top?: Node): void; | ||
abstract drawScene(canvas?: Canvas, top?: Node, bufferCanvas?: Canvas): void; | ||
abstract drawHit(canvas?: Canvas, top?: Node): void; | ||
@@ -130,3 +132,3 @@ getClientRect(config?: { | ||
getAncestors(): Node<NodeConfig>[]; | ||
getAttrs(): any; | ||
getAttrs(): Config & Record<string, any>; | ||
setAttrs(config: any): this; | ||
@@ -181,3 +183,7 @@ isListening(): any; | ||
moveTo(newContainer: any): this; | ||
toObject(): any; | ||
toObject(): { | ||
attrs: Config & Record<string, any>; | ||
className: string; | ||
children?: any[] | undefined; | ||
}; | ||
toJSON(): string; | ||
@@ -184,0 +190,0 @@ getParent(): Container<Node<NodeConfig>> | null; |
@@ -114,4 +114,6 @@ "use strict"; | ||
} | ||
width += offset * 2 + 1; | ||
height += offset * 2 + 1; | ||
const extraPaddingX = Math.abs(Math.round(rect.x) - x) > 0.5 ? 1 : 0; | ||
const extraPaddingY = Math.abs(Math.round(rect.y) - y) > 0.5 ? 1 : 0; | ||
width += offset * 2 + extraPaddingX; | ||
height += offset * 2 + extraPaddingY; | ||
x -= offset; | ||
@@ -381,3 +383,3 @@ y -= offset; | ||
getAttrs() { | ||
return this.attrs || {}; | ||
return (this.attrs || {}); | ||
} | ||
@@ -725,4 +727,7 @@ setAttrs(config) { | ||
toObject() { | ||
var obj = {}, attrs = this.getAttrs(), key, val, getter, defaultValue, nonPlainObject; | ||
obj.attrs = {}; | ||
var attrs = this.getAttrs(), key, val, getter, defaultValue, nonPlainObject; | ||
const obj = { | ||
attrs: {}, | ||
className: this.getClassName(), | ||
}; | ||
for (key in attrs) { | ||
@@ -743,3 +748,2 @@ val = attrs[key]; | ||
} | ||
obj.className = this.getClassName(); | ||
return Util_1.Util._prepareToStringify(obj); | ||
@@ -956,2 +960,7 @@ } | ||
}), context = canvas.getContext(); | ||
const bufferCanvas = new Canvas_1.SceneCanvas({ | ||
width: canvas.width, | ||
height: canvas.height, | ||
pixelRatio: canvas.pixelRatio, | ||
}); | ||
if (config.imageSmoothingEnabled === false) { | ||
@@ -964,3 +973,3 @@ context._context.imageSmoothingEnabled = false; | ||
} | ||
this.drawScene(canvas); | ||
this.drawScene(canvas, undefined, bufferCanvas); | ||
context.restore(); | ||
@@ -967,0 +976,0 @@ return canvas; |
@@ -118,3 +118,3 @@ import { Node, NodeConfig } from './Node.js'; | ||
}; | ||
drawScene(can?: SceneCanvas, top?: Node): this; | ||
drawScene(can?: SceneCanvas, top?: Node, bufferCanvas?: SceneCanvas): this; | ||
drawHit(can?: HitCanvas, top?: Node, skipDragCheck?: boolean): this; | ||
@@ -121,0 +121,0 @@ drawHitFromCache(alphaThreshold?: number): this; |
@@ -230,5 +230,2 @@ "use strict"; | ||
var _a; | ||
if (!this.getStage()) { | ||
return false; | ||
} | ||
const perfectDrawEnabled = (_a = this.attrs.perfectDrawEnabled) !== null && _a !== void 0 ? _a : true; | ||
@@ -308,5 +305,5 @@ if (!perfectDrawEnabled) { | ||
} | ||
drawScene(can, top) { | ||
drawScene(can, top, bufferCanvas) { | ||
var layer = this.getLayer(); | ||
var canvas = can || layer.getCanvas(), context = canvas.getContext(), cachedCanvas = this._getCanvasCache(), drawFunc = this.getSceneFunc(), hasShadow = this.hasShadow(), stage, bufferCanvas, bufferContext; | ||
var canvas = can || layer.getCanvas(), context = canvas.getContext(), cachedCanvas = this._getCanvasCache(), drawFunc = this.getSceneFunc(), hasShadow = this.hasShadow(), stage, bufferContext; | ||
var skipBuffer = canvas.isCache; | ||
@@ -331,4 +328,4 @@ var cachingSelf = top === this; | ||
stage = this.getStage(); | ||
bufferCanvas = stage.bufferCanvas; | ||
bufferContext = bufferCanvas.getContext(); | ||
const bc = bufferCanvas || stage.bufferCanvas; | ||
bufferContext = bc.getContext(); | ||
bufferContext.clear(); | ||
@@ -341,3 +338,3 @@ bufferContext.save(); | ||
bufferContext.restore(); | ||
var ratio = bufferCanvas.pixelRatio; | ||
var ratio = bc.pixelRatio; | ||
if (hasShadow) { | ||
@@ -348,3 +345,3 @@ context._applyShadow(this); | ||
context._applyGlobalCompositeOperation(this); | ||
context.drawImage(bufferCanvas._canvas, 0, 0, bufferCanvas.width / ratio, bufferCanvas.height / ratio); | ||
context.drawImage(bc._canvas, 0, 0, bc.width / ratio, bc.height / ratio); | ||
} | ||
@@ -351,0 +348,0 @@ else { |
import { Transform } from '../Util.js'; | ||
import { Node } from '../Node.js'; | ||
import { Shape } from '../Shape.js'; | ||
import { Rect } from './Rect.js'; | ||
@@ -37,2 +38,4 @@ import { Group } from '../Group.js'; | ||
shouldOverdrawWholeArea?: boolean; | ||
anchorDragBoundFunc?: (oldPos: Vector2d, newPos: Vector2d, evt: any) => Vector2d; | ||
anchorStyleFunc?: (anchor: Shape) => void; | ||
} | ||
@@ -92,3 +95,7 @@ export declare class Transformer extends Group { | ||
destroy(): this; | ||
toObject(): any; | ||
toObject(): { | ||
attrs: any; | ||
className: string; | ||
children?: any[] | undefined; | ||
}; | ||
clone(obj?: any): this; | ||
@@ -95,0 +102,0 @@ getClientRect(): IRect; |
@@ -126,4 +126,4 @@ import { Context } from './Context.js'; | ||
_prepareArrayForTween(startArray: any, endArray: any, isClosed: any): number[]; | ||
_prepareToStringify(obj: any): any; | ||
_assign<T, U>(target: T, source: U): T & U; | ||
_prepareToStringify<T>(obj: any): T | null; | ||
_assign<T_1, U>(target: T_1, source: U): T_1 & U; | ||
_getFirstPointerId(evt: any): any; | ||
@@ -130,0 +130,0 @@ releaseCanvas(...canvases: HTMLCanvasElement[]): void; |
{ | ||
"name": "konva", | ||
"version": "9.3.0", | ||
"version": "9.3.1", | ||
"author": "Anton Lavrenov", | ||
@@ -5,0 +5,0 @@ "files": [ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1396622
32539