|
@@ -26,15 +26,14 @@
|
|
|
|
|
|
import { SGraphItem } from "../SGraphItem";
|
|
|
import { SPainter, SPoint, SPolygonUtil, SRect } from "@persagy-web/draw/lib";
|
|
|
-import { SGraphShape } from "./SGraphShape";
|
|
|
-import { PolyGroup } from "..";
|
|
|
+import { PolyGroup, SGraphStyleItem } from "..";
|
|
|
|
|
|
/**
|
|
|
* 多边形组
|
|
|
*
|
|
|
* @author 郝建龙 <haojianlong@sagacloud.cn>
|
|
|
*/
|
|
|
-export class SGraphPolyGroupItem extends SGraphShape {
|
|
|
+export class SGraphPolyGroupItem extends SGraphStyleItem {
|
|
|
/** X 坐标最小值 */
|
|
|
private minX = Number.MAX_SAFE_INTEGER;
|
|
|
/** X 坐标最大值 */
|
|
@@ -53,7 +52,7 @@ export class SGraphPolyGroupItem extends SGraphShape {
|
|
|
* @param data 轮廓线及风格数据
|
|
|
*/
|
|
|
constructor(parent: SGraphItem | null, data: PolyGroup) {
|
|
|
- super(parent, data.style);
|
|
|
+ super(parent);
|
|
|
if (data.outline.length && data.outline[0] && data.outline[0].length) {
|
|
|
this.minX = data.outline[0][0].x;
|
|
|
this.maxX = this.minX;
|
|
@@ -120,7 +119,9 @@ export class SGraphPolyGroupItem extends SGraphShape {
|
|
|
* @param painter 绘制对象
|
|
|
*/
|
|
|
onDraw(painter: SPainter): void {
|
|
|
- super.onDraw(painter);
|
|
|
+ painter.pen.color = this.strokeColor;
|
|
|
+ painter.brush.color = this.fillColor;
|
|
|
+ painter.pen.lineWidth = this.lineWidth;
|
|
|
this.pointList.forEach((t): void => {
|
|
|
painter.drawPolygon(t);
|
|
|
});
|