Comparing version 9.3.11 to 9.3.12
@@ -19,3 +19,3 @@ "use strict"; | ||
_global: exports.glob, | ||
version: '9.3.11', | ||
version: '9.3.12', | ||
isBrowser: detectBrowser(), | ||
@@ -22,0 +22,0 @@ isUnminified: /param/.test(function (param) { }.toString()), |
@@ -11,3 +11,3 @@ import { Node, NodeConfig } from './Node.js'; | ||
export interface ShapeConfig extends NodeConfig { | ||
fill?: string; | ||
fill?: string | CanvasGradient; | ||
fillPatternImage?: HTMLImageElement; | ||
@@ -130,3 +130,3 @@ fillPatternX?: number; | ||
dashOffset: GetSet<number, this>; | ||
fill: GetSet<string, this>; | ||
fill: GetSet<string | CanvasGradient, this>; | ||
fillEnabled: GetSet<boolean, this>; | ||
@@ -180,3 +180,3 @@ fillLinearGradientColorStops: GetSet<Array<number | string>, this>; | ||
shadowBlur: GetSet<number, this>; | ||
stroke: GetSet<string, this>; | ||
stroke: GetSet<string | CanvasGradient, this>; | ||
strokeEnabled: GetSet<boolean, this>; | ||
@@ -183,0 +183,0 @@ fillAfterStrokeEnabled: GetSet<boolean, this>; |
@@ -274,4 +274,13 @@ "use strict"; | ||
getClientRect(config = {}) { | ||
let hasCachedParent = false; | ||
let parent = this.getParent(); | ||
while (parent) { | ||
if (parent.isCached()) { | ||
hasCachedParent = true; | ||
break; | ||
} | ||
parent = parent.getParent(); | ||
} | ||
const skipTransform = config.skipTransform; | ||
const relativeTo = config.relativeTo; | ||
const relativeTo = config.relativeTo || (hasCachedParent && this.getStage()) || undefined; | ||
const fillRect = this.getSelfRect(); | ||
@@ -278,0 +287,0 @@ const applyStroke = !config.skipStroke && this.hasStroke(); |
@@ -19,8 +19,17 @@ import { Shape, ShapeConfig } from '../Shape.js'; | ||
getLength(): number; | ||
getPointAtLength(length: any): any; | ||
getPointAtLength(length: any): { | ||
x: any; | ||
y: any; | ||
} | null; | ||
data: GetSet<string, this>; | ||
static getLineLength(x1: any, y1: any, x2: any, y2: any): number; | ||
static getPathLength(dataArray: PathSegment[]): number; | ||
static getPointAtLengthOfDataArray(length: number, dataArray: any): any; | ||
static getPointOnLine(dist: any, P1x: any, P1y: any, P2x: any, P2y: any, fromX?: any, fromY?: any): any; | ||
static getPointAtLengthOfDataArray(length: number, dataArray: any): { | ||
x: any; | ||
y: any; | ||
} | null; | ||
static getPointOnLine(dist: any, P1x: any, P1y: any, P2x: any, P2y: any, fromX?: any, fromY?: any): { | ||
x: any; | ||
y: any; | ||
}; | ||
static getPointOnCubicBezier(pct: any, P1x: any, P1y: any, P2x: any, P2y: any, P3x: any, P3y: any, P4x: any, P4y: any): { | ||
@@ -27,0 +36,0 @@ x: number; |
@@ -186,47 +186,25 @@ "use strict"; | ||
static getPointOnLine(dist, P1x, P1y, P2x, P2y, fromX, fromY) { | ||
if (fromX === undefined) { | ||
fromX = P1x; | ||
fromX = fromX !== null && fromX !== void 0 ? fromX : P1x; | ||
fromY = fromY !== null && fromY !== void 0 ? fromY : P1y; | ||
const len = this.getLineLength(P1x, P1y, P2x, P2y); | ||
if (len < 1e-10) { | ||
return { x: P1x, y: P1y }; | ||
} | ||
if (fromY === undefined) { | ||
fromY = P1y; | ||
} | ||
var m = (P2y - P1y) / (P2x - P1x + 0.00000001); | ||
var run = Math.sqrt((dist * dist) / (1 + m * m)); | ||
if (P2x < P1x) { | ||
run *= -1; | ||
} | ||
var rise = m * run; | ||
var pt; | ||
if (P2x === P1x) { | ||
pt = { | ||
x: fromX, | ||
y: fromY + rise, | ||
}; | ||
return { x: fromX, y: fromY + (P2y > P1y ? dist : -dist) }; | ||
} | ||
else if ((fromY - P1y) / (fromX - P1x + 0.00000001) === m) { | ||
pt = { | ||
x: fromX + run, | ||
y: fromY + rise, | ||
}; | ||
const m = (P2y - P1y) / (P2x - P1x); | ||
const run = Math.sqrt((dist * dist) / (1 + m * m)) * (P2x < P1x ? -1 : 1); | ||
const rise = m * run; | ||
if (Math.abs(fromY - P1y - m * (fromX - P1x)) < 1e-10) { | ||
return { x: fromX + run, y: fromY + rise }; | ||
} | ||
else { | ||
var ix, iy; | ||
var len = this.getLineLength(P1x, P1y, P2x, P2y); | ||
var u = (fromX - P1x) * (P2x - P1x) + (fromY - P1y) * (P2y - P1y); | ||
u = u / (len * len); | ||
ix = P1x + u * (P2x - P1x); | ||
iy = P1y + u * (P2y - P1y); | ||
var pRise = this.getLineLength(fromX, fromY, ix, iy); | ||
var pRun = Math.sqrt(dist * dist - pRise * pRise); | ||
run = Math.sqrt((pRun * pRun) / (1 + m * m)); | ||
if (P2x < P1x) { | ||
run *= -1; | ||
} | ||
rise = m * run; | ||
pt = { | ||
x: ix + run, | ||
y: iy + rise, | ||
}; | ||
} | ||
return pt; | ||
const u = ((fromX - P1x) * (P2x - P1x) + (fromY - P1y) * (P2y - P1y)) / (len * len); | ||
const ix = P1x + u * (P2x - P1x); | ||
const iy = P1y + u * (P2y - P1y); | ||
const pRise = this.getLineLength(fromX, fromY, ix, iy); | ||
const pRun = Math.sqrt(dist * dist - pRise * pRise); | ||
const adjustedRun = Math.sqrt((pRun * pRun) / (1 + m * m)) * (P2x < P1x ? -1 : 1); | ||
const adjustedRise = m * adjustedRun; | ||
return { x: ix + adjustedRun, y: iy + adjustedRise }; | ||
} | ||
@@ -233,0 +211,0 @@ static getPointOnCubicBezier(pct, P1x, P1y, P2x, P2y, P3x, P3y, P4x, P4y) { |
@@ -30,3 +30,6 @@ import { Context } from '../Context.js'; | ||
_getTextPathLength(): number; | ||
_getPointAtLength(length: number): any; | ||
_getPointAtLength(length: number): { | ||
x: any; | ||
y: any; | ||
} | null; | ||
_readDataAttribute(): void; | ||
@@ -33,0 +36,0 @@ _sceneFunc(context: Context): void; |
@@ -447,2 +447,5 @@ "use strict"; | ||
_handleMouseDown(e) { | ||
if (this._transforming) { | ||
return; | ||
} | ||
this._movingAnchorName = e.target.name().split(' ')[0]; | ||
@@ -449,0 +452,0 @@ var attrs = this._getNodeRect(); |
{ | ||
"name": "konva", | ||
"version": "9.3.11", | ||
"version": "9.3.12", | ||
"author": "Anton Lavrenov", | ||
@@ -5,0 +5,0 @@ "files": [ |
@@ -67,2 +67,6 @@ <p align="center"> | ||
# 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 | ||
@@ -69,0 +73,0 @@ |
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
1405102
206
32663