|
@@ -1490,16 +1490,9 @@ export class EditScence extends SGraphScene {
|
|
this.Nodes.forEach(image => {
|
|
this.Nodes.forEach(image => {
|
|
// image.showAnchor = false;
|
|
// image.showAnchor = false;
|
|
if (image.anchorList && image.anchorList.length) {
|
|
if (image.anchorList && image.anchorList.length) {
|
|
- let scenePoint = image.mapFromScene(event.x, event.y);
|
|
|
|
- if (image.contains(scenePoint.x, scenePoint.y)) {
|
|
|
|
- // image.anchorList.forEach(anchor => {
|
|
|
|
- // let anchorPoint = anchor.mapToScene(0, 0);
|
|
|
|
- // let dis = SMathUtil.pointDistance(
|
|
|
|
- // event.x,
|
|
|
|
- // event.y,
|
|
|
|
- // anchorPoint.x,
|
|
|
|
- // anchorPoint.y
|
|
|
|
- // );
|
|
|
|
|
|
+ if(image.img && image.img instanceof SImageItem) {
|
|
|
|
+ let scenePoint = image.img.mapFromScene(event.x, event.y);
|
|
|
|
+ if (image.img.contains(scenePoint.x, scenePoint.y)) {
|
|
let anchor = image.anchorList[0]
|
|
let anchor = image.anchorList[0]
|
|
let anchorPoint = anchor.mapToScene(0, 0);
|
|
let anchorPoint = anchor.mapToScene(0, 0);
|
|
let dis = SMathUtil.pointDistance(
|
|
let dis = SMathUtil.pointDistance(
|
|
@@ -1517,6 +1510,17 @@ export class EditScence extends SGraphScene {
|
|
minAnchor = anchor;
|
|
minAnchor = anchor;
|
|
len = dis;
|
|
len = dis;
|
|
}
|
|
}
|
|
|
|
+ }
|
|
|
|
+ // let scenePoint = image.mapFromScene(event.x, event.y);
|
|
|
|
+ // if (image.contains(scenePoint.x, scenePoint.y)) {
|
|
|
|
+ // image.anchorList.forEach(anchor => {
|
|
|
|
+ // let anchorPoint = anchor.mapToScene(0, 0);
|
|
|
|
+ // let dis = SMathUtil.pointDistance(
|
|
|
|
+ // event.x,
|
|
|
|
+ // event.y,
|
|
|
|
+ // anchorPoint.x,
|
|
|
|
+ // anchorPoint.y
|
|
|
|
+ // );
|
|
// if (len < 0) {
|
|
// if (len < 0) {
|
|
// len = anchor.sceneDis;
|
|
// len = anchor.sceneDis;
|
|
// }
|
|
// }
|