Permalink
Browse files

fix: if text shape's x or y is NaN, there will be a drawing error in …

…webchart mini program. Related to antvis/wx-f2#81.
  • Loading branch information...
simaQ committed Aug 29, 2018
1 parent 3c55a3b commit 4f0ca529731476d9618c32bc911f1b6e7c17a873
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/graphic/shape/text.js
@@ -77,14 +77,14 @@ class Text extends Shape {
const self = this;
const attrs = self._attrs.attrs;
const text = attrs.text;
if (Util.isNil(text)) { // text will be 0
let x = attrs.x;
let y = attrs.y;
if (Util.isNil(text) || isNaN(x) || isNaN(y)) { // text will be 0
return;
}
const textArr = attrs.textArr;
const fontSize = attrs.fontSize * 1;
const spaceingY = self._getSpaceingY();
let x = attrs.x;
let y = attrs.y;
if (attrs.rotate) { // do rotation
context.translate(x, y);

0 comments on commit 4f0ca52

Please sign in to comment.