@antv/g-canvas
Advanced tools
Comparing version 0.3.8 to 0.3.9
@@ -7,2 +7,13 @@ /** | ||
declare class Circle extends ShapeBase { | ||
getDefaultAttrs(): { | ||
x: number; | ||
y: number; | ||
r: number; | ||
lineWidth: number; | ||
lineAppendWidth: number; | ||
opacity: number; | ||
strokeOpacity: number; | ||
fillOpacity: number; | ||
matrix: any; | ||
}; | ||
getInnerBox(attrs: any): { | ||
@@ -9,0 +20,0 @@ x: number; |
@@ -5,6 +5,6 @@ /** | ||
*/ | ||
import { __extends } from "tslib"; | ||
import { __assign, __extends } from "tslib"; | ||
import ShapeBase from './base'; | ||
import { distance } from '../util/util'; | ||
// 暂时不需要圆的工具方法,后续如果需要支持 pointAt,tangentAngle 时再引入 | ||
// TODO: 暂时不需要圆的工具方法,后续如果需要支持 pointAt,tangentAngle 时再引入 | ||
// import CircleUtil from '@antv/g-math/lib/circle'; | ||
@@ -16,2 +16,6 @@ var Circle = /** @class */ (function (_super) { | ||
} | ||
Circle.prototype.getDefaultAttrs = function () { | ||
var attrs = _super.prototype.getDefaultAttrs.call(this); | ||
return __assign(__assign({}, attrs), { x: 0, y: 0, r: 0 }); | ||
}; | ||
Circle.prototype.getInnerBox = function (attrs) { | ||
@@ -18,0 +22,0 @@ var x = attrs.x, y = attrs.y, r = attrs.r; |
@@ -7,2 +7,14 @@ /** | ||
declare class Ellipse extends ShapeBase { | ||
getDefaultAttrs(): { | ||
x: number; | ||
y: number; | ||
rx: number; | ||
ry: number; | ||
lineWidth: number; | ||
lineAppendWidth: number; | ||
opacity: number; | ||
strokeOpacity: number; | ||
fillOpacity: number; | ||
matrix: any; | ||
}; | ||
getInnerBox(attrs: any): { | ||
@@ -9,0 +21,0 @@ x: number; |
@@ -5,3 +5,3 @@ /** | ||
*/ | ||
import { __extends } from "tslib"; | ||
import { __assign, __extends } from "tslib"; | ||
import ShapeBase from './base'; | ||
@@ -19,2 +19,6 @@ // 暂时不需要 | ||
} | ||
Ellipse.prototype.getDefaultAttrs = function () { | ||
var attrs = _super.prototype.getDefaultAttrs.call(this); | ||
return __assign(__assign({}, attrs), { x: 0, y: 0, rx: 0, ry: 0 }); | ||
}; | ||
Ellipse.prototype.getInnerBox = function (attrs) { | ||
@@ -21,0 +25,0 @@ var x = attrs.x, y = attrs.y, rx = attrs.rx, ry = attrs.ry; |
@@ -7,2 +7,14 @@ /** | ||
declare class ImageShape extends ShapeBase { | ||
getDefaultAttrs(): { | ||
x: number; | ||
y: number; | ||
width: number; | ||
height: number; | ||
lineWidth: number; | ||
lineAppendWidth: number; | ||
opacity: number; | ||
strokeOpacity: number; | ||
fillOpacity: number; | ||
matrix: any; | ||
}; | ||
initAttrs(attrs: any): void; | ||
@@ -9,0 +21,0 @@ isStroke(): boolean; |
@@ -5,3 +5,3 @@ /** | ||
*/ | ||
import { __extends } from "tslib"; | ||
import { __assign, __extends } from "tslib"; | ||
import ShapeBase from './base'; | ||
@@ -17,2 +17,6 @@ import { isString, isNil } from '../util/util'; | ||
} | ||
ImageShape.prototype.getDefaultAttrs = function () { | ||
var attrs = _super.prototype.getDefaultAttrs.call(this); | ||
return __assign(__assign({}, attrs), { x: 0, y: 0, width: 0, height: 0 }); | ||
}; | ||
ImageShape.prototype.initAttrs = function (attrs) { | ||
@@ -19,0 +23,0 @@ this._setImage(attrs.img); |
import ShapeBase from './base'; | ||
declare class Line extends ShapeBase { | ||
getDefaultAttrs(): { | ||
x1: number; | ||
y1: number; | ||
x2: number; | ||
y2: number; | ||
startArrow: boolean; | ||
@@ -5,0 +9,0 @@ endArrow: boolean; |
@@ -17,3 +17,3 @@ import { __assign, __extends } from "tslib"; | ||
var attrs = _super.prototype.getDefaultAttrs.call(this); | ||
return __assign(__assign({}, attrs), { startArrow: false, endArrow: false }); | ||
return __assign(__assign({}, attrs), { x1: 0, y1: 0, x2: 0, y2: 0, startArrow: false, endArrow: false }); | ||
}; | ||
@@ -20,0 +20,0 @@ Line.prototype.getInnerBox = function (attrs) { |
@@ -8,2 +8,7 @@ /** | ||
getDefaultAttrs(): { | ||
x: number; | ||
y: number; | ||
width: number; | ||
height: number; | ||
radius: number; | ||
lineWidth: number; | ||
@@ -10,0 +15,0 @@ lineAppendWidth: number; |
@@ -5,3 +5,3 @@ /** | ||
*/ | ||
import { __extends } from "tslib"; | ||
import { __assign, __extends } from "tslib"; | ||
import ShapeBase from './base'; | ||
@@ -20,5 +20,3 @@ import { parseRadius } from '../util/parse'; | ||
var attrs = _super.prototype.getDefaultAttrs.call(this); | ||
// 设置默认值 | ||
attrs['radius'] = 0; | ||
return attrs; | ||
return __assign(__assign({}, attrs), { x: 0, y: 0, width: 0, height: 0, radius: 0 }); | ||
}; | ||
@@ -25,0 +23,0 @@ Rect.prototype.getInnerBox = function (attrs) { |
@@ -9,2 +9,5 @@ /** | ||
getDefaultAttrs(): { | ||
x: number; | ||
y: number; | ||
text: any; | ||
fontSize: number; | ||
@@ -11,0 +14,0 @@ fontFamily: string; |
@@ -16,3 +16,3 @@ /** | ||
var attrs = _super.prototype.getDefaultAttrs.call(this); | ||
return __assign(__assign({}, attrs), { fontSize: 12, fontFamily: 'sans-serif', fontStyle: 'normal', fontWeight: 'normal', fontVariant: 'normal', textAlign: 'start', textBaseline: 'bottom' }); | ||
return __assign(__assign({}, attrs), { x: 0, y: 0, text: null, fontSize: 12, fontFamily: 'sans-serif', fontStyle: 'normal', fontWeight: 'normal', fontVariant: 'normal', textAlign: 'start', textBaseline: 'bottom' }); | ||
}; | ||
@@ -19,0 +19,0 @@ // 仅仅使用包围盒检测来进行拾取 |
@@ -51,3 +51,3 @@ export function getPixelRatio() { | ||
maxX: Math.max(region1.maxX, region2.maxX), | ||
maxY: Math.max(region1.maxY, region2.maxX), | ||
maxY: Math.max(region1.maxY, region2.maxY), | ||
}; | ||
@@ -54,0 +54,0 @@ } |
@@ -7,2 +7,13 @@ /** | ||
declare class Circle extends ShapeBase { | ||
getDefaultAttrs(): { | ||
x: number; | ||
y: number; | ||
r: number; | ||
lineWidth: number; | ||
lineAppendWidth: number; | ||
opacity: number; | ||
strokeOpacity: number; | ||
fillOpacity: number; | ||
matrix: any; | ||
}; | ||
getInnerBox(attrs: any): { | ||
@@ -9,0 +20,0 @@ x: number; |
@@ -10,3 +10,3 @@ "use strict"; | ||
var util_1 = require("../util/util"); | ||
// 暂时不需要圆的工具方法,后续如果需要支持 pointAt,tangentAngle 时再引入 | ||
// TODO: 暂时不需要圆的工具方法,后续如果需要支持 pointAt,tangentAngle 时再引入 | ||
// import CircleUtil from '@antv/g-math/lib/circle'; | ||
@@ -18,2 +18,6 @@ var Circle = /** @class */ (function (_super) { | ||
} | ||
Circle.prototype.getDefaultAttrs = function () { | ||
var attrs = _super.prototype.getDefaultAttrs.call(this); | ||
return tslib_1.__assign(tslib_1.__assign({}, attrs), { x: 0, y: 0, r: 0 }); | ||
}; | ||
Circle.prototype.getInnerBox = function (attrs) { | ||
@@ -20,0 +24,0 @@ var x = attrs.x, y = attrs.y, r = attrs.r; |
@@ -7,2 +7,14 @@ /** | ||
declare class Ellipse extends ShapeBase { | ||
getDefaultAttrs(): { | ||
x: number; | ||
y: number; | ||
rx: number; | ||
ry: number; | ||
lineWidth: number; | ||
lineAppendWidth: number; | ||
opacity: number; | ||
strokeOpacity: number; | ||
fillOpacity: number; | ||
matrix: any; | ||
}; | ||
getInnerBox(attrs: any): { | ||
@@ -9,0 +21,0 @@ x: number; |
@@ -20,2 +20,6 @@ "use strict"; | ||
} | ||
Ellipse.prototype.getDefaultAttrs = function () { | ||
var attrs = _super.prototype.getDefaultAttrs.call(this); | ||
return tslib_1.__assign(tslib_1.__assign({}, attrs), { x: 0, y: 0, rx: 0, ry: 0 }); | ||
}; | ||
Ellipse.prototype.getInnerBox = function (attrs) { | ||
@@ -22,0 +26,0 @@ var x = attrs.x, y = attrs.y, rx = attrs.rx, ry = attrs.ry; |
@@ -7,2 +7,14 @@ /** | ||
declare class ImageShape extends ShapeBase { | ||
getDefaultAttrs(): { | ||
x: number; | ||
y: number; | ||
width: number; | ||
height: number; | ||
lineWidth: number; | ||
lineAppendWidth: number; | ||
opacity: number; | ||
strokeOpacity: number; | ||
fillOpacity: number; | ||
matrix: any; | ||
}; | ||
initAttrs(attrs: any): void; | ||
@@ -9,0 +21,0 @@ isStroke(): boolean; |
@@ -18,2 +18,6 @@ "use strict"; | ||
} | ||
ImageShape.prototype.getDefaultAttrs = function () { | ||
var attrs = _super.prototype.getDefaultAttrs.call(this); | ||
return tslib_1.__assign(tslib_1.__assign({}, attrs), { x: 0, y: 0, width: 0, height: 0 }); | ||
}; | ||
ImageShape.prototype.initAttrs = function (attrs) { | ||
@@ -20,0 +24,0 @@ this._setImage(attrs.img); |
import ShapeBase from './base'; | ||
declare class Line extends ShapeBase { | ||
getDefaultAttrs(): { | ||
x1: number; | ||
y1: number; | ||
x2: number; | ||
y2: number; | ||
startArrow: boolean; | ||
@@ -5,0 +9,0 @@ endArrow: boolean; |
@@ -19,3 +19,3 @@ "use strict"; | ||
var attrs = _super.prototype.getDefaultAttrs.call(this); | ||
return tslib_1.__assign(tslib_1.__assign({}, attrs), { startArrow: false, endArrow: false }); | ||
return tslib_1.__assign(tslib_1.__assign({}, attrs), { x1: 0, y1: 0, x2: 0, y2: 0, startArrow: false, endArrow: false }); | ||
}; | ||
@@ -22,0 +22,0 @@ Line.prototype.getInnerBox = function (attrs) { |
@@ -8,2 +8,7 @@ /** | ||
getDefaultAttrs(): { | ||
x: number; | ||
y: number; | ||
width: number; | ||
height: number; | ||
radius: number; | ||
lineWidth: number; | ||
@@ -10,0 +15,0 @@ lineAppendWidth: number; |
@@ -21,5 +21,3 @@ "use strict"; | ||
var attrs = _super.prototype.getDefaultAttrs.call(this); | ||
// 设置默认值 | ||
attrs['radius'] = 0; | ||
return attrs; | ||
return tslib_1.__assign(tslib_1.__assign({}, attrs), { x: 0, y: 0, width: 0, height: 0, radius: 0 }); | ||
}; | ||
@@ -26,0 +24,0 @@ Rect.prototype.getInnerBox = function (attrs) { |
@@ -9,2 +9,5 @@ /** | ||
getDefaultAttrs(): { | ||
x: number; | ||
y: number; | ||
text: any; | ||
fontSize: number; | ||
@@ -11,0 +14,0 @@ fontFamily: string; |
@@ -18,3 +18,3 @@ "use strict"; | ||
var attrs = _super.prototype.getDefaultAttrs.call(this); | ||
return tslib_1.__assign(tslib_1.__assign({}, attrs), { fontSize: 12, fontFamily: 'sans-serif', fontStyle: 'normal', fontWeight: 'normal', fontVariant: 'normal', textAlign: 'start', textBaseline: 'bottom' }); | ||
return tslib_1.__assign(tslib_1.__assign({}, attrs), { x: 0, y: 0, text: null, fontSize: 12, fontFamily: 'sans-serif', fontStyle: 'normal', fontWeight: 'normal', fontVariant: 'normal', textAlign: 'start', textBaseline: 'bottom' }); | ||
}; | ||
@@ -21,0 +21,0 @@ // 仅仅使用包围盒检测来进行拾取 |
@@ -58,3 +58,3 @@ "use strict"; | ||
maxX: Math.max(region1.maxX, region2.maxX), | ||
maxY: Math.max(region1.maxY, region2.maxX), | ||
maxY: Math.max(region1.maxY, region2.maxY), | ||
}; | ||
@@ -61,0 +61,0 @@ } |
{ | ||
"name": "@antv/g-canvas", | ||
"version": "0.3.8", | ||
"version": "0.3.9", | ||
"description": "A canvas library which providing 2d", | ||
@@ -58,3 +58,3 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@antv/g-base": "^0.3.6", | ||
"@antv/g-base": "^0.3.7", | ||
"@antv/g-math": "^0.1.1", | ||
@@ -66,3 +66,3 @@ "@antv/gl-matrix": "~2.7.1", | ||
"__npminstall_done": false, | ||
"gitHead": "8ba7a45a25340d8e6c70cd8a91070c58e26f7821" | ||
"gitHead": "e9a25074e1edac1b3c94a07e614b21bd2d77998d" | ||
} |
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
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
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
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
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1264853
7885
Updated@antv/g-base@^0.3.7