|
@@ -46,11 +46,11 @@ export class SLineItem extends SGraphItem {
|
|
|
}
|
|
|
|
|
|
/** 线条颜色 */
|
|
|
- private _strokeColor: string = "#000000";
|
|
|
- get strokeColor(): string {
|
|
|
+ private _strokeColor: SColor = SColor.Black;
|
|
|
+ get strokeColor(): SColor {
|
|
|
return this._strokeColor;
|
|
|
}
|
|
|
- set strokeColor(v: string) {
|
|
|
+ set strokeColor(v: SColor) {
|
|
|
this._strokeColor = v;
|
|
|
this.update();
|
|
|
}
|
|
@@ -66,21 +66,21 @@ export class SLineItem extends SGraphItem {
|
|
|
}
|
|
|
|
|
|
/** 端点填充色 */
|
|
|
- private _fillColor: string = "#ffffff";
|
|
|
- get fillColor(): string {
|
|
|
+ private _fillColor: SColor = SColor.White;
|
|
|
+ get fillColor(): SColor {
|
|
|
return this._fillColor;
|
|
|
}
|
|
|
- set fillColor(v: string) {
|
|
|
+ set fillColor(v: SColor) {
|
|
|
this._fillColor = v;
|
|
|
this.update();
|
|
|
}
|
|
|
|
|
|
/** 选中端点填充色 */
|
|
|
- private _activeFillColor: string = "#2196f3";
|
|
|
- get activeFillColor(): string {
|
|
|
+ private _activeFillColor: SColor = new SColor("#2196f3");
|
|
|
+ get activeFillColor(): SColor {
|
|
|
return this._activeFillColor;
|
|
|
}
|
|
|
- set activeFillColor(v: string) {
|
|
|
+ set activeFillColor(v: SColor) {
|
|
|
this._activeFillColor = v;
|
|
|
this.update();
|
|
|
}
|
|
@@ -419,13 +419,8 @@ export class SLineItem extends SGraphItem {
|
|
|
onDraw(painter: SPainter): void {
|
|
|
this.sceneDis = painter.toPx(this.dis);
|
|
|
painter.pen.lineWidth = painter.toPx(this.lineWidth);
|
|
|
- painter.pen.color = new SColor(this.strokeColor);
|
|
|
+ painter.pen.color = this.strokeColor;
|
|
|
if (this.line.length == 2) {
|
|
|
- // 绘制外轮廓
|
|
|
- // painter.brush.color = SColor.Transparent;
|
|
|
- // painter.pen.color = new SColor("#128eee");
|
|
|
- // painter.drawRect(this.boundingRect());
|
|
|
-
|
|
|
// 绘制直线
|
|
|
painter.pen.color = new SColor(this.strokeColor);
|
|
|
if (this.lineStyle == SLineStyle.Dashed) {
|
|
@@ -453,9 +448,9 @@ export class SLineItem extends SGraphItem {
|
|
|
) {
|
|
|
// 绘制端点
|
|
|
this.line.forEach((p, i): void => {
|
|
|
- painter.brush.color = new SColor(this.fillColor);
|
|
|
+ painter.brush.color = this.fillColor;
|
|
|
if (i == this.curIndex) {
|
|
|
- painter.brush.color = new SColor(this.activeFillColor);
|
|
|
+ painter.brush.color = this.activeFillColor;
|
|
|
}
|
|
|
painter.drawCircle(p.x, p.y, painter.toPx(5));
|
|
|
});
|
|
@@ -466,7 +461,7 @@ export class SLineItem extends SGraphItem {
|
|
|
this.status == SItemStatus.Create
|
|
|
) {
|
|
|
// 绘制端点
|
|
|
- painter.brush.color = new SColor(this.fillColor);
|
|
|
+ painter.brush.color = this.fillColor;
|
|
|
painter.drawCircle(
|
|
|
this.line[0].x,
|
|
|
this.line[0].y,
|