diff --git a/konva.js b/konva.js index 7dde7c33..10171499 100644 --- a/konva.js +++ b/konva.js @@ -3228,7 +3228,6 @@ } return res; }; - // TODO: should we remove that function? it was added to resolve types Node.prototype.isAncestorOf = function (node) { return false; }; @@ -3588,7 +3587,6 @@ callback(img); }); }; - // TODO: create overloaded method Node.prototype.setSize = function (size) { this.width(size.width); this.height(size.height); @@ -6390,7 +6388,7 @@ * @name Konva.BaseLayer#batchDraw * @return {Konva.Layer} this */ - // TODO: don't use animation or make sure they all run at the same time + // TODO: don't use animation and make sure they all run at the same time BaseLayer.prototype.batchDraw = function () { var that = this, Anim = Animation; if (!this.batchAnim) { @@ -11226,10 +11224,6 @@ Factory.addGetterSetter(Star, 'outerRadius', 0, Validators.getNumberValidator()); Collection.mapMethods(Star); - // TODO: - // deprecate fill pattern image and fill gradient for text (and textpath?) - // we have API for that in docs - // I guess we should show a error or warning // constants var AUTO = 'auto', //CANVAS = 'canvas', @@ -11320,7 +11314,6 @@ var padding = this.padding(), textHeight = this.getTextHeight(), lineHeightPx = this.lineHeight() * textHeight, textArr = this.textArr, textArrLen = textArr.length, verticalAlign = this.verticalAlign(), alignY = 0, align = this.align(), totalWidth = this.getWidth(), letterSpacing = this.letterSpacing(), fill = this.fill(), fontSize = this.fontSize(), textDecoration = this.textDecoration(), shouldUnderline = textDecoration.indexOf('underline') !== -1, shouldLineThrough = textDecoration.indexOf('line-through') !== -1, n; context.setAttr('font', this._getContextFont()); context.setAttr('textBaseline', MIDDLE); - // TODO: do we have that property in context? context.setAttr('textAlign', LEFT$1); // handle vertical alignment if (verticalAlign === MIDDLE) { @@ -12419,7 +12412,7 @@ ].join(' '); var NODE_RECT = 'nodeRect'; // TODO: check circles and text here!!!! - // change text? change radius? + // change text? change radius? change arc? var TRANSFORM_CHANGE_STR$1 = [ 'xChange.resizer', 'yChange.resizer', @@ -15167,7 +15160,6 @@ mask = smoothEdgeMask(mask, imageData.width, imageData.height); // Apply mask applyMask(imageData, mask); - // todo : Update hit region function according to mask } return imageData; }; diff --git a/src/Animation.ts b/src/Animation.ts index 15b81fbc..343e32d3 100644 --- a/src/Animation.ts +++ b/src/Animation.ts @@ -283,7 +283,7 @@ export class Animation { * @name Konva.BaseLayer#batchDraw * @return {Konva.Layer} this */ -// TODO: don't use animation or make sure they all run at the same time +// TODO: don't use animation and make sure they all run at the same time BaseLayer.prototype.batchDraw = function() { var that = this, Anim = Animation; diff --git a/src/Node.ts b/src/Node.ts index 933e3dbd..ddb3439e 100644 --- a/src/Node.ts +++ b/src/Node.ts @@ -11,6 +11,8 @@ import { import { Container } from './Container'; import { GetSet, Vector2d } from './types'; +export type Filter = (this: Node, imageData: ImageData) => void; + type globalCompositeOperationType = | '' | 'source-over' @@ -1343,7 +1345,6 @@ export abstract class Node { } return res; } - // TODO: should we remove that function? it was added to resolve types isAncestorOf(node) { return false; } @@ -1741,7 +1742,6 @@ export abstract class Node { callback(img); }); } - // TODO: create overloaded method setSize(size) { this.width(size.width); this.height(size.height); diff --git a/src/filters/Brighten.ts b/src/filters/Brighten.ts index e0dcc432..51d45cee 100644 --- a/src/filters/Brighten.ts +++ b/src/filters/Brighten.ts @@ -1,5 +1,6 @@ import { Factory, Validators } from '../Factory'; -import { Node } from '../Node'; +import { Node, Filter } from '../Node'; + /** * Brighten Filter. * @function @@ -10,7 +11,7 @@ import { Node } from '../Node'; * node.filters([Konva.Filters.Brighten]); * node.brightness(0.8); */ -export const Brighten = function(imageData) { +export const Brighten: Filter = function(imageData) { var brightness = this.brightness() * 255, data = imageData.data, len = data.length, diff --git a/src/filters/Mask.ts b/src/filters/Mask.ts index 7b505cd2..5eac4c3a 100644 --- a/src/filters/Mask.ts +++ b/src/filters/Mask.ts @@ -194,8 +194,6 @@ export const Mask = function(imageData) { // Apply mask applyMask(imageData, mask); - - // todo : Update hit region function according to mask } return imageData; diff --git a/src/shapes/Text.ts b/src/shapes/Text.ts index 1b3c5001..4c791a45 100644 --- a/src/shapes/Text.ts +++ b/src/shapes/Text.ts @@ -5,11 +5,6 @@ import { UA } from '../Global'; import { GetSet } from '../types'; -// TODO: -// deprecate fill pattern image and fill gradient for text (and textpath?) -// we have API for that in docs -// I guess we should show a error or warning - // constants var AUTO = 'auto', //CANVAS = 'canvas', @@ -148,7 +143,6 @@ export class Text extends Shape { context.setAttr('textBaseline', MIDDLE); - // TODO: do we have that property in context? context.setAttr('textAlign', LEFT); // handle vertical alignment diff --git a/src/shapes/Transformer.ts b/src/shapes/Transformer.ts index 84c2acbc..4fd8c018 100644 --- a/src/shapes/Transformer.ts +++ b/src/shapes/Transformer.ts @@ -28,7 +28,7 @@ var ATTR_CHANGE_LIST = [ var NODE_RECT = 'nodeRect'; // TODO: check circles and text here!!!! -// change text? change radius? +// change text? change radius? change arc? var TRANSFORM_CHANGE_STR = [ 'xChange.resizer',