|
@@ -218,9 +218,9 @@ export class SPolygonItem extends SGraphItem {
|
|
protected drawShowPolygon(painter: SPainter, pointList: SPoint[]): void {
|
|
protected drawShowPolygon(painter: SPainter, pointList: SPoint[]): void {
|
|
painter.save();
|
|
painter.save();
|
|
painter.pen.lineCapStyle = SLineCapStyle.Square;
|
|
painter.pen.lineCapStyle = SLineCapStyle.Square;
|
|
- painter.pen.color = this._strokeColor;
|
|
|
|
- painter.brush.color = this._fillColor;
|
|
|
|
- painter.pen.lineWidth = painter.toPx(this._lineWidth);
|
|
|
|
|
|
+ painter.pen.color = this.strokeColor;
|
|
|
|
+ painter.brush.color = this.fillColor;
|
|
|
|
+ painter.pen.lineWidth = painter.toPx(this.lineWidth);
|
|
if (this.lineStyle == SLineStyle.Dashed) {
|
|
if (this.lineStyle == SLineStyle.Dashed) {
|
|
painter.pen.lineDash = [
|
|
painter.pen.lineDash = [
|
|
painter.toPx(this.lineWidth * 3),
|
|
painter.toPx(this.lineWidth * 3),
|
|
@@ -252,8 +252,8 @@ export class SPolygonItem extends SGraphItem {
|
|
*/
|
|
*/
|
|
protected drawCreatePolygon(painter: SPainter, pointList: SPoint[]): void {
|
|
protected drawCreatePolygon(painter: SPainter, pointList: SPoint[]): void {
|
|
painter.pen.lineCapStyle = SLineCapStyle.Square;
|
|
painter.pen.lineCapStyle = SLineCapStyle.Square;
|
|
- painter.pen.color = this._strokeColor;
|
|
|
|
- painter.pen.lineWidth = painter.toPx(this._lineWidth);
|
|
|
|
|
|
+ painter.pen.color = this.strokeColor;
|
|
|
|
+ painter.pen.lineWidth = painter.toPx(this.lineWidth);
|
|
if (this.lastPoint && pointList.length) {
|
|
if (this.lastPoint && pointList.length) {
|
|
painter.drawLine(
|
|
painter.drawLine(
|
|
pointList[pointList.length - 1].x,
|
|
pointList[pointList.length - 1].x,
|
|
@@ -264,8 +264,8 @@ export class SPolygonItem extends SGraphItem {
|
|
}
|
|
}
|
|
painter.drawPolyline(pointList);
|
|
painter.drawPolyline(pointList);
|
|
painter.pen.color = SColor.Transparent;
|
|
painter.pen.color = SColor.Transparent;
|
|
- painter.brush.color = new SColor(this._fillColor.value + "80");
|
|
|
|
- painter.pen.lineWidth = painter.toPx(this._lineWidth);
|
|
|
|
|
|
+ painter.brush.color = new SColor(this.fillColor.value);
|
|
|
|
+ painter.pen.lineWidth = painter.toPx(this.lineWidth);
|
|
|
|
|
|
if (this.lastPoint) {
|
|
if (this.lastPoint) {
|
|
painter.drawPolygon([...pointList, this.lastPoint]);
|
|
painter.drawPolygon([...pointList, this.lastPoint]);
|
|
@@ -310,9 +310,9 @@ export class SPolygonItem extends SGraphItem {
|
|
protected drawEditPolygon(painter: SPainter, pointList: SPoint[]): void {
|
|
protected drawEditPolygon(painter: SPainter, pointList: SPoint[]): void {
|
|
// 展示多边形
|
|
// 展示多边形
|
|
painter.pen.lineCapStyle = SLineCapStyle.Square;
|
|
painter.pen.lineCapStyle = SLineCapStyle.Square;
|
|
- painter.pen.color = this._strokeColor;
|
|
|
|
- painter.pen.lineWidth = painter.toPx(this._lineWidth);
|
|
|
|
- painter.brush.color = new SColor(this._fillColor.value + "80");
|
|
|
|
|
|
+ painter.pen.color = this.strokeColor;
|
|
|
|
+ painter.pen.lineWidth = painter.toPx(this.lineWidth);
|
|
|
|
+ painter.brush.color = new SColor(this.fillColor.value);
|
|
painter.drawPolygon([...pointList]);
|
|
painter.drawPolygon([...pointList]);
|
|
// 绘制顶点块
|
|
// 绘制顶点块
|
|
painter.pen.color = SColor.Black;
|
|
painter.pen.color = SColor.Black;
|
|
@@ -320,7 +320,7 @@ export class SPolygonItem extends SGraphItem {
|
|
pointList.forEach((item, index) => {
|
|
pointList.forEach((item, index) => {
|
|
painter.brush.color = SColor.White;
|
|
painter.brush.color = SColor.White;
|
|
if (index == this.curIndex) {
|
|
if (index == this.curIndex) {
|
|
- painter.brush.color = new SColor(this.fillColor);
|
|
|
|
|
|
+ painter.brush.color = new SColor("#2196f3");
|
|
}
|
|
}
|
|
painter.drawCircle(item.x, item.y, painter.toPx(this.len / 2));
|
|
painter.drawCircle(item.x, item.y, painter.toPx(this.len / 2));
|
|
});
|
|
});
|