|
@@ -24,6 +24,7 @@ import { Relation } from "../types/Relation";
|
|
|
import { SMouseEvent } from "@saga-web/base/lib";
|
|
|
import { BaseRelationItem } from "./BaseRelationItem";
|
|
|
import { AnchorItem } from "./AnchorItem";
|
|
|
+import { ItemOrder } from "../types/ItemOrder";
|
|
|
|
|
|
/**
|
|
|
* 关系item-折线画法-横平竖直
|
|
@@ -43,6 +44,17 @@ export class RelationItem extends BaseRelationItem {
|
|
|
Anchor1: AnchorItem | null = null;
|
|
|
//
|
|
|
Anchor2: AnchorItem | null = null;
|
|
|
+ //
|
|
|
+ private _dashOffset: number = 20;
|
|
|
+ get dashOffset(): number {
|
|
|
+ return this._dashOffset;
|
|
|
+ }
|
|
|
+ set dashOffset(value: number) {
|
|
|
+ this._dashOffset = value;
|
|
|
+ this.update();
|
|
|
+ }
|
|
|
+ // 定时器
|
|
|
+ timer: number | null = null;
|
|
|
/**
|
|
|
* 构造函数
|
|
|
*
|
|
@@ -54,6 +66,7 @@ export class RelationItem extends BaseRelationItem {
|
|
|
this.data = data;
|
|
|
this.Anchor1 = data.Anchor1 || null;
|
|
|
this.Anchor2 = data.Anchor2 || null;
|
|
|
+ this.zOrder = ItemOrder.RelateOrder;
|
|
|
if (data.PointList) {
|
|
|
this.pointList = data.PointList.map(it => {
|
|
|
let x = it.X,
|
|
@@ -113,7 +126,6 @@ export class RelationItem extends BaseRelationItem {
|
|
|
*/
|
|
|
onMouseMove(event: SMouseEvent): boolean {
|
|
|
if (this.pointList.length) {
|
|
|
- console.log("dowm");
|
|
|
this.lastPointList = [
|
|
|
this.pointList[this.pointList.length - 1],
|
|
|
this.getPoint(
|
|
@@ -189,11 +201,19 @@ export class RelationItem extends BaseRelationItem {
|
|
|
* @param painter painter对象
|
|
|
*/
|
|
|
onDraw(painter: SPainter): void {
|
|
|
- painter.pen.lineWidth = 2;
|
|
|
+ painter.pen.lineWidth = 3;
|
|
|
painter.pen.color = new SColor("#409EFF");
|
|
|
painter.brush.color = new SColor("#409EFF");
|
|
|
painter.drawPolyline(this.pointList);
|
|
|
+
|
|
|
+ painter.pen.lineWidth = 1;
|
|
|
+ painter.pen.lineDash = [10, 10];
|
|
|
+ painter.pen.dashOffset = this.dashOffset;
|
|
|
+ painter.pen.color = SColor.White;
|
|
|
+ painter.drawPolyline(this.pointList);
|
|
|
+ this.dashOffset -= 2;
|
|
|
if (!this.closeFlag) {
|
|
|
+ painter.pen.color = new SColor("#409EFF");
|
|
|
painter.drawPolyline(this.lastPointList);
|
|
|
}
|
|
|
} // Function onDraw()
|