Merge branch 'master' of github.com:konvajs/konva

This commit is contained in:
Anton Lavrenov 2019-01-14 13:29:36 -05:00
commit d90b0f15c2
2 changed files with 8 additions and 14 deletions

View File

@ -220,18 +220,12 @@ export class Shape extends Node {
// try to use it without stage (use global buffer canvas)
_useBufferCanvas(caching) {
return (
(!caching &&
(this.perfectDrawEnabled() &&
this.getAbsoluteOpacity() !== 1 &&
this.hasFill() &&
this.hasStroke() &&
this.getStage())) ||
(this.perfectDrawEnabled() &&
this.hasShadow() &&
this.getAbsoluteOpacity() !== 1 &&
this.hasFill() &&
this.hasStroke() &&
this.getStage())
(!caching || this.hasShadow()) &&
this.perfectDrawEnabled() &&
this.getAbsoluteOpacity() !== 1 &&
this.hasFill() &&
this.hasStroke() &&
this.getStage()
);
}
/**

View File

@ -336,11 +336,11 @@ export class Text extends Shape {
return this.textArr.push({ text: line, width: width });
}
_getTextWidth(text) {
var latterSpacing = this.letterSpacing();
var letterSpacing = this.letterSpacing();
var length = text.length;
return (
getDummyContext().measureText(text).width +
(length ? latterSpacing * (length - 1) : 0)
(length ? letterSpacing * (length - 1) : 0)
);
}
_setTextData() {