|
@@ -29,17 +29,19 @@
|
|
|
*
|
|
|
* @author 韩耀龙 <han_yao_long@163.com>
|
|
|
*/
|
|
|
-import { SGraphStyleItem, SGraphItem, SLineStyle } from "./../"
|
|
|
import { SPainter, SPoint } from "@persagy-web/draw";
|
|
|
+import { SLineStyle } from "../enums/SGraphLineStyle";
|
|
|
+import { SGraphItem } from "../SGraphItem";
|
|
|
+import { SGraphStyleItem } from "./SGraphStyleItem";
|
|
|
|
|
|
export class SGraphBaseCircle extends SGraphStyleItem {
|
|
|
// 圆坐标
|
|
|
set localtion(v) {
|
|
|
this._localtion = new SPoint(v);
|
|
|
- this.update()
|
|
|
+ this.update();
|
|
|
}
|
|
|
get localtion(): SPoint {
|
|
|
- return this._localtion
|
|
|
+ return this._localtion;
|
|
|
}
|
|
|
_localtion: SPoint = new SPoint(0, 0);
|
|
|
// 圆半径
|
|
@@ -48,7 +50,7 @@ export class SGraphBaseCircle extends SGraphStyleItem {
|
|
|
this.update();
|
|
|
}
|
|
|
get radius(): number {
|
|
|
- return this._radius
|
|
|
+ return this._radius;
|
|
|
}
|
|
|
_radius: number = 0;
|
|
|
|
|
@@ -58,14 +60,14 @@ export class SGraphBaseCircle extends SGraphStyleItem {
|
|
|
* @param parent
|
|
|
*/
|
|
|
constructor(parent: SGraphItem | null) {
|
|
|
- super(parent)
|
|
|
+ super(parent);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Item 绘制操作
|
|
|
- *
|
|
|
- * @param painter 绘制对象
|
|
|
- */
|
|
|
+ * Item 绘制操作
|
|
|
+ *
|
|
|
+ * @param painter 绘制对象
|
|
|
+ */
|
|
|
onDraw(painter: SPainter): void {
|
|
|
painter.pen.color = this.strokeColor;
|
|
|
painter.brush.color = this.fillColor;
|
|
@@ -84,4 +86,4 @@ export class SGraphBaseCircle extends SGraphStyleItem {
|
|
|
|
|
|
painter.drawCircle(this.localtion.x, this.localtion.y, this.radius);
|
|
|
} // Function onDraw()
|
|
|
-}
|
|
|
+}
|