This commit is contained in:
Anton Lavrenov 2019-05-27 12:54:11 -05:00
parent b4902595e0
commit 6b9f73f280
5 changed files with 13 additions and 13 deletions

View File

@ -5,6 +5,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
## Not released: ## Not released:
* Typescript fixes
## [3.2.6][2019-05-09] ## [3.2.6][2019-05-09]
* Typescript fixes again * Typescript fixes again

View File

@ -8,7 +8,7 @@
* Konva JavaScript Framework v3.2.6 * Konva JavaScript Framework v3.2.6
* http://konvajs.org/ * http://konvajs.org/
* Licensed under the MIT * Licensed under the MIT
* Date: Sat May 11 2019 * Date: Mon May 27 2019
* *
* Original work Copyright (C) 2011 - 2013 by Eric Rowell (KineticJS) * Original work Copyright (C) 2011 - 2013 by Eric Rowell (KineticJS)
* Modified work Copyright (C) 2014 - present by Anton Lavrenov (Konva) * Modified work Copyright (C) 2014 - present by Anton Lavrenov (Konva)
@ -6964,7 +6964,8 @@
* shape.drawHitFromCache(); * shape.drawHitFromCache();
*/ */
Shape.prototype.drawHitFromCache = function (alphaThreshold) { Shape.prototype.drawHitFromCache = function (alphaThreshold) {
var threshold = alphaThreshold || 0, cachedCanvas = this._getCanvasCache(), sceneCanvas = this._getCachedSceneCanvas(), hitCanvas = cachedCanvas.hit, hitContext = hitCanvas.getContext(), hitWidth = hitCanvas.getWidth(), hitHeight = hitCanvas.getHeight(), hitImageData, hitData, len, rgbColorKey, i, alpha; if (alphaThreshold === void 0) { alphaThreshold = 0; }
var cachedCanvas = this._getCanvasCache(), sceneCanvas = this._getCachedSceneCanvas(), hitCanvas = cachedCanvas.hit, hitContext = hitCanvas.getContext(), hitWidth = hitCanvas.getWidth(), hitHeight = hitCanvas.getHeight(), hitImageData, hitData, len, rgbColorKey, i, alpha;
hitContext.clear(); hitContext.clear();
hitContext.drawImage(sceneCanvas._canvas, 0, 0, hitWidth, hitHeight); hitContext.drawImage(sceneCanvas._canvas, 0, 0, hitWidth, hitHeight);
try { try {
@ -6975,7 +6976,7 @@
// replace non transparent pixels with color key // replace non transparent pixels with color key
for (i = 0; i < len; i += 4) { for (i = 0; i < len; i += 4) {
alpha = hitData[i + 3]; alpha = hitData[i + 3];
if (alpha > threshold) { if (alpha > alphaThreshold) {
hitData[i] = rgbColorKey.r; hitData[i] = rgbColorKey.r;
hitData[i + 1] = rgbColorKey.g; hitData[i + 1] = rgbColorKey.g;
hitData[i + 2] = rgbColorKey.b; hitData[i + 2] = rgbColorKey.b;

4
konva.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -666,9 +666,8 @@ export class Shape<Config extends ShapeConfig = ShapeConfig> extends Node<
* shape.cache(); * shape.cache();
* shape.drawHitFromCache(); * shape.drawHitFromCache();
*/ */
drawHitFromCache(alphaThreshold) { drawHitFromCache(alphaThreshold = 0) {
var threshold = alphaThreshold || 0, var cachedCanvas = this._getCanvasCache(),
cachedCanvas = this._getCanvasCache(),
sceneCanvas = this._getCachedSceneCanvas(), sceneCanvas = this._getCachedSceneCanvas(),
hitCanvas = cachedCanvas.hit, hitCanvas = cachedCanvas.hit,
hitContext = hitCanvas.getContext(), hitContext = hitCanvas.getContext(),
@ -693,7 +692,7 @@ export class Shape<Config extends ShapeConfig = ShapeConfig> extends Node<
// replace non transparent pixels with color key // replace non transparent pixels with color key
for (i = 0; i < len; i += 4) { for (i = 0; i < len; i += 4) {
alpha = hitData[i + 3]; alpha = hitData[i + 3];
if (alpha > threshold) { if (alpha > alphaThreshold) {
hitData[i] = rgbColorKey.r; hitData[i] = rgbColorKey.r;
hitData[i + 1] = rgbColorKey.g; hitData[i + 1] = rgbColorKey.g;
hitData[i + 2] = rgbColorKey.b; hitData[i + 2] = rgbColorKey.b;

View File

@ -1,13 +1,11 @@
import { Collection } from '../Util'; import { Collection } from '../Util';
import { Factory } from '../Factory'; import { Factory } from '../Factory';
import { Line } from './Line'; import { Line, LineConfig } from './Line';
import { GetSet } from '../types'; import { GetSet } from '../types';
import { getNumberValidator } from '../Validators'; import { getNumberValidator } from '../Validators';
import { _registerNode } from '../Global'; import { _registerNode } from '../Global';
import { ShapeConfig } from '../Shape'; export interface ArrowConfig extends LineConfig {
export interface ArrowConfig extends ShapeConfig {
points: number[]; points: number[];
tension?: number; tension?: number;
closed?: boolean; closed?: boolean;