|
@@ -69,7 +69,7 @@ export class SBaseLineEdit extends SGraphEdit {
|
|
|
this._line = arr;
|
|
|
this.update();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
|
|
|
private _verAndLeve: Boolean = false;
|
|
|
get verAndLeve(): Boolean {
|
|
@@ -144,7 +144,7 @@ export class SBaseLineEdit extends SGraphEdit {
|
|
|
|
|
|
dis: number = 5;
|
|
|
|
|
|
- private sceneDis: number = 5;
|
|
|
+ protected sceneDis: number = 5;
|
|
|
|
|
|
curIndex: number = -1;
|
|
|
|
|
@@ -162,18 +162,15 @@ export class SBaseLineEdit extends SGraphEdit {
|
|
|
super(parent);
|
|
|
this.showSelect = false;
|
|
|
this.data = data;
|
|
|
- if (data.style) {
|
|
|
+ if (data.style && data.style.default) {
|
|
|
|
|
|
- if (data.style.line) {
|
|
|
+ if (data.style.default.line) {
|
|
|
let setPointList: SPoint[];
|
|
|
- setPointList = data.style.line.map(i => {
|
|
|
+ setPointList = data.style.default.line.map((i: { x: number; y: number; }) => {
|
|
|
return new SPoint(i.x, i.y)
|
|
|
});
|
|
|
this.line = setPointList;
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- if (data.style && data.style.default) {
|
|
|
|
|
|
if (data.style.default.strokeColor) {
|
|
|
this.strokeColor = new SColor(data.style.default.strokeColor)
|
|
@@ -246,7 +243,9 @@ export class SBaseLineEdit extends SGraphEdit {
|
|
|
|
|
|
if (event.buttons == SMouseButton.LeftButton) {
|
|
|
if (this.status == SItemStatus.Normal) {
|
|
|
- return super.onMouseDown(event);
|
|
|
+
|
|
|
+ super.onMouseDown(event);
|
|
|
+ return true;
|
|
|
} else if (this.status == SItemStatus.Edit) {
|
|
|
|
|
|
this.findNearestPoint(new SPoint(event.x, event.y));
|
|
@@ -438,10 +437,10 @@ export class SBaseLineEdit extends SGraphEdit {
|
|
|
*/
|
|
|
contains(x: number, y: number): boolean {
|
|
|
if (this.line.length == 2) {
|
|
|
- let p = new SPoint(x, y);
|
|
|
+ let p = new SPoint(x, y);
|
|
|
if (
|
|
|
SMathUtil.pointToLine(p, new SLine(this.line[0], this.line[1]))
|
|
|
- .MinDis < this.dis
|
|
|
+ .MinDis < this.sceneDis
|
|
|
) {
|
|
|
return true;
|
|
|
}
|