|
@@ -92,8 +92,8 @@ export class SPolygonItem extends SGraphStyleItem {
|
|
|
/** 灵敏像素 */
|
|
|
private len: number = 10;
|
|
|
/** 场景像素 内部将灵敏像素换算为场景实际距离 */
|
|
|
- private scenceLen: number = 15;
|
|
|
- /** 场景像素 */
|
|
|
+ private sceneLen: number = 15;
|
|
|
+ /** shift键是否按下 */
|
|
|
private isAlt: boolean = false;
|
|
|
/** undo/redo 堆栈 */
|
|
|
protected undoStack: SUndoStack = new SUndoStack();
|
|
@@ -265,7 +265,7 @@ export class SPolygonItem extends SGraphStyleItem {
|
|
|
this.lastPoint.y,
|
|
|
this.pointList[0].x,
|
|
|
this.pointList[0].y
|
|
|
- ) < this.scenceLen
|
|
|
+ ) < this.sceneLen
|
|
|
) {
|
|
|
// 绘制第一个点的顶点块
|
|
|
painter.pen.color = SColor.Black;
|
|
@@ -318,7 +318,7 @@ export class SPolygonItem extends SGraphStyleItem {
|
|
|
if (this.isAlt) {
|
|
|
// 1 判断是否点击在多边形顶点
|
|
|
let lenIndex = -1; // 当前点击到的点位索引;
|
|
|
- let curenLen = this.scenceLen; // 当前的灵敏度
|
|
|
+ let curLen = this.sceneLen; // 当前的灵敏度
|
|
|
this.pointList.forEach((item, index): void => {
|
|
|
let dis = SMathUtil.pointDistance(
|
|
|
event.x,
|
|
@@ -326,8 +326,8 @@ export class SPolygonItem extends SGraphStyleItem {
|
|
|
item.x,
|
|
|
item.y
|
|
|
);
|
|
|
- if (dis < curenLen) {
|
|
|
- curenLen = dis;
|
|
|
+ if (dis < curLen) {
|
|
|
+ curLen = dis;
|
|
|
lenIndex = index;
|
|
|
}
|
|
|
});
|
|
@@ -354,7 +354,7 @@ export class SPolygonItem extends SGraphStyleItem {
|
|
|
this.curIndex = -1;
|
|
|
this.curPoint = null;
|
|
|
let lenIndex = -1; // 当前点击到的点位索引;
|
|
|
- let curenLen = this.scenceLen; // 当前的灵敏度
|
|
|
+ let curLen = this.sceneLen; // 当前的灵敏度
|
|
|
this.pointList.forEach((item, index): void => {
|
|
|
let dis = SMathUtil.pointDistance(
|
|
|
event.x,
|
|
@@ -362,8 +362,8 @@ export class SPolygonItem extends SGraphStyleItem {
|
|
|
item.x,
|
|
|
item.y
|
|
|
);
|
|
|
- if (dis < curenLen) {
|
|
|
- curenLen = dis;
|
|
|
+ if (dis < curLen) {
|
|
|
+ curLen = dis;
|
|
|
lenIndex = index;
|
|
|
}
|
|
|
});
|
|
@@ -398,7 +398,7 @@ export class SPolygonItem extends SGraphStyleItem {
|
|
|
// 判断是否有点
|
|
|
if (len.Point) {
|
|
|
// 点在了多边形的边上
|
|
|
- if (len.MinDis <= this.scenceLen) {
|
|
|
+ if (len.MinDis <= this.sceneLen) {
|
|
|
this.pointList.splice(index + 1, 0, len.Point);
|
|
|
// 记录新增顶点操作记录压入堆栈
|
|
|
this.recordAction(SGraphPointListInsert, [
|
|
@@ -625,7 +625,7 @@ export class SPolygonItem extends SGraphStyleItem {
|
|
|
* @param painter 绘制对象
|
|
|
*/
|
|
|
onDraw(painter: SPainter): void {
|
|
|
- this.scenceLen = painter.toPx(this.len);
|
|
|
+ this.sceneLen = painter.toPx(this.len);
|
|
|
// 当状态为展示状态
|
|
|
if (this.status == SItemStatus.Normal) {
|
|
|
// 闭合多边形
|