mirror of
https://github.com/konvajs/konva.git
synced 2026-01-24 05:45:14 +08:00
ts fixes
This commit is contained in:
@@ -666,9 +666,8 @@ export class Shape<Config extends ShapeConfig = ShapeConfig> extends Node<
|
||||
* shape.cache();
|
||||
* shape.drawHitFromCache();
|
||||
*/
|
||||
drawHitFromCache(alphaThreshold) {
|
||||
var threshold = alphaThreshold || 0,
|
||||
cachedCanvas = this._getCanvasCache(),
|
||||
drawHitFromCache(alphaThreshold = 0) {
|
||||
var cachedCanvas = this._getCanvasCache(),
|
||||
sceneCanvas = this._getCachedSceneCanvas(),
|
||||
hitCanvas = cachedCanvas.hit,
|
||||
hitContext = hitCanvas.getContext(),
|
||||
@@ -693,7 +692,7 @@ export class Shape<Config extends ShapeConfig = ShapeConfig> extends Node<
|
||||
// replace non transparent pixels with color key
|
||||
for (i = 0; i < len; i += 4) {
|
||||
alpha = hitData[i + 3];
|
||||
if (alpha > threshold) {
|
||||
if (alpha > alphaThreshold) {
|
||||
hitData[i] = rgbColorKey.r;
|
||||
hitData[i + 1] = rgbColorKey.g;
|
||||
hitData[i + 2] = rgbColorKey.b;
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
import { Collection } from '../Util';
|
||||
import { Factory } from '../Factory';
|
||||
import { Line } from './Line';
|
||||
import { Line, LineConfig } from './Line';
|
||||
import { GetSet } from '../types';
|
||||
import { getNumberValidator } from '../Validators';
|
||||
import { _registerNode } from '../Global';
|
||||
|
||||
import { ShapeConfig } from '../Shape';
|
||||
|
||||
export interface ArrowConfig extends ShapeConfig {
|
||||
export interface ArrowConfig extends LineConfig {
|
||||
points: number[];
|
||||
tension?: number;
|
||||
closed?: boolean;
|
||||
|
||||
Reference in New Issue
Block a user