|
@@ -26,7 +26,7 @@
|
|
|
|
|
|
import { SObjectItem } from "./SObjectItem";
|
|
import { SObjectItem } from "./SObjectItem";
|
|
import { SPainter, SRect, SSize, SColor, SPoint } from "@persagy-web/draw";
|
|
import { SPainter, SRect, SSize, SColor, SPoint } from "@persagy-web/draw";
|
|
-import { SImageShowType, STextOrigin } from "..";
|
|
|
|
|
|
+import { SImageShowType, STextOrigin, SLineStyle } from "..";
|
|
import { SGraphItem } from "../SGraphItem";
|
|
import { SGraphItem } from "../SGraphItem";
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -59,6 +59,16 @@ export class SImageItem extends SObjectItem {
|
|
this.update();
|
|
this.update();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /** 线条样式 */
|
|
|
|
+ private _lineStyle: SLineStyle = SLineStyle.Solid;
|
|
|
|
+ get lineStyle(): SLineStyle {
|
|
|
|
+ return this._lineStyle;
|
|
|
|
+ }
|
|
|
|
+ set lineStyle(v: SLineStyle) {
|
|
|
|
+ this._lineStyle = v;
|
|
|
|
+ this.update();
|
|
|
|
+ }
|
|
|
|
+
|
|
/** 边框宽度 */
|
|
/** 边框宽度 */
|
|
private _lineWidth: number = 1;
|
|
private _lineWidth: number = 1;
|
|
get lineWidth(): number {
|
|
get lineWidth(): number {
|
|
@@ -259,6 +269,19 @@ export class SImageItem extends SObjectItem {
|
|
} else {
|
|
} else {
|
|
painter.shadow.shadowColor = SColor.Transparent;
|
|
painter.shadow.shadowColor = SColor.Transparent;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if (this.lineStyle == SLineStyle.Dashed) {
|
|
|
|
+ painter.pen.lineDash = [
|
|
|
|
+ painter.toPx(this.lineWidth * 3),
|
|
|
|
+ painter.toPx(this.lineWidth * 7)
|
|
|
|
+ ];
|
|
|
|
+ } else if (this.lineStyle == SLineStyle.Dotted) {
|
|
|
|
+ painter.pen.lineDash = [
|
|
|
|
+ painter.toPx(2 * this.lineWidth),
|
|
|
|
+ painter.toPx(2 * this.lineWidth)
|
|
|
|
+ ];
|
|
|
|
+ }
|
|
|
|
+
|
|
painter.pen.lineWidth = this.lineWidth;
|
|
painter.pen.lineWidth = this.lineWidth;
|
|
painter.pen.color = this.strokeColor;
|
|
painter.pen.color = this.strokeColor;
|
|
painter.brush.color = SColor.Transparent;
|
|
painter.brush.color = SColor.Transparent;
|