|
@@ -86,7 +86,17 @@ export class SGraphSelectContainer extends SGraphItem {
|
|
|
/** 灵敏度转换为场景长度 */
|
|
|
private sceneDis: number = 10;
|
|
|
/** 当前点索引 */
|
|
|
- private curIndex: number = -1;
|
|
|
+ private _curIndex: number = -1;
|
|
|
+ get curIndex(): number {
|
|
|
+ return this._curIndex;
|
|
|
+ } // get curIndex
|
|
|
+ set curIndex(v: number) {
|
|
|
+ if (v === this._curIndex) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this._curIndex = v;
|
|
|
+ this.update();
|
|
|
+ } // set curIndex
|
|
|
/** 当前点索引 */
|
|
|
private curPoint: SPoint | undefined;
|
|
|
|
|
@@ -723,6 +733,7 @@ export class SGraphSelectContainer extends SGraphItem {
|
|
|
*/
|
|
|
getNearestPoint(p: SPoint): void {
|
|
|
let len = this.sceneDis;
|
|
|
+ this.curIndex = -1;
|
|
|
for (let i = 0; i < this.pointList.length; i++) {
|
|
|
let dis = SMathUtil.pointDistance(
|
|
|
p.x,
|
|
@@ -774,7 +785,6 @@ export class SGraphSelectContainer extends SGraphItem {
|
|
|
* @return boolean
|
|
|
*/
|
|
|
onMouseDown(event: SMouseEvent): boolean {
|
|
|
- this.curIndex = -1;
|
|
|
if (event.buttons == 1) {
|
|
|
this.getNearestPoint(new SPoint(event.x, event.y));
|
|
|
if (this.curIndex < 0) {
|