@antv/g-canvas
Advanced tools
Comparing version 0.3.9 to 0.3.10
@@ -6,2 +6,3 @@ /** | ||
import { __extends } from "tslib"; | ||
import path2Absolute from '@antv/path-util/lib/path-2-absolute'; | ||
import ShapeBase from './base'; | ||
@@ -30,3 +31,3 @@ import { isFunction } from '../util/util'; | ||
var diffY = r * Math.sin((1 / 3) * Math.PI); | ||
return [['M', x - r, y + diffY], ['L', x, y - diffY], ['L', x + r, y + diffY], ['z']]; | ||
return [['M', x - r, y + diffY], ['L', x, y - diffY], ['L', x + r, y + diffY], ['Z']]; | ||
}, | ||
@@ -80,7 +81,13 @@ // 倒三角形 | ||
var method; | ||
var path; | ||
if (isFunction(symbol)) { | ||
method = symbol; | ||
path = method(x, y, r); | ||
// 将 path 转成绝对路径 | ||
path = path2Absolute(path); | ||
} | ||
else { | ||
// 内置 symbol 的 path 都是绝对路径,直接绘制即可,不需要对 path 进行特殊处理 | ||
method = Marker.Symbols[symbol]; | ||
path = method(x, y, r); | ||
} | ||
@@ -91,3 +98,3 @@ if (!method) { | ||
} | ||
return method(x, y, r); | ||
return path; | ||
}; | ||
@@ -94,0 +101,0 @@ Marker.prototype.createPath = function (context) { |
@@ -8,2 +8,3 @@ "use strict"; | ||
var tslib_1 = require("tslib"); | ||
var path_2_absolute_1 = require("@antv/path-util/lib/path-2-absolute"); | ||
var base_1 = require("./base"); | ||
@@ -32,3 +33,3 @@ var util_1 = require("../util/util"); | ||
var diffY = r * Math.sin((1 / 3) * Math.PI); | ||
return [['M', x - r, y + diffY], ['L', x, y - diffY], ['L', x + r, y + diffY], ['z']]; | ||
return [['M', x - r, y + diffY], ['L', x, y - diffY], ['L', x + r, y + diffY], ['Z']]; | ||
}, | ||
@@ -82,7 +83,13 @@ // 倒三角形 | ||
var method; | ||
var path; | ||
if (util_1.isFunction(symbol)) { | ||
method = symbol; | ||
path = method(x, y, r); | ||
// 将 path 转成绝对路径 | ||
path = path_2_absolute_1.default(path); | ||
} | ||
else { | ||
// 内置 symbol 的 path 都是绝对路径,直接绘制即可,不需要对 path 进行特殊处理 | ||
method = Marker.Symbols[symbol]; | ||
path = method(x, y, r); | ||
} | ||
@@ -93,3 +100,3 @@ if (!method) { | ||
} | ||
return method(x, y, r); | ||
return path; | ||
}; | ||
@@ -96,0 +103,0 @@ Marker.prototype.createPath = function (context) { |
{ | ||
"name": "@antv/g-canvas", | ||
"version": "0.3.9", | ||
"version": "0.3.10", | ||
"description": "A canvas library which providing 2d", | ||
@@ -58,3 +58,3 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@antv/g-base": "^0.3.7", | ||
"@antv/g-base": "^0.3.8", | ||
"@antv/g-math": "^0.1.1", | ||
@@ -66,3 +66,3 @@ "@antv/gl-matrix": "~2.7.1", | ||
"__npminstall_done": false, | ||
"gitHead": "e9a25074e1edac1b3c94a07e614b21bd2d77998d" | ||
"gitHead": "d3533a49ee2c8883b9c1b2c1accba86041453ebc" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1266845
7899
Updated@antv/g-base@^0.3.8