some fixes

This commit is contained in:
Anton Lavrenov 2019-01-20 18:06:46 -05:00
parent 521070cb05
commit 199bbbbff1
7 changed files with 9 additions and 24 deletions

View File

@ -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;
};

View File

@ -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;

View File

@ -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);

View File

@ -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,

View File

@ -194,8 +194,6 @@ export const Mask = function(imageData) {
// Apply mask
applyMask(imageData, mask);
// todo : Update hit region function according to mask
}
return imageData;

View File

@ -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

View File

@ -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',