mirror of
https://github.com/konvajs/konva.git
synced 2025-06-28 15:23:44 +08:00
Merge branch 'master' of github.com:konvajs/konva
This commit is contained in:
commit
d90b0f15c2
18
src/Shape.ts
18
src/Shape.ts
@ -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()
|
||||
);
|
||||
}
|
||||
/**
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user