xushiting 1 year ago
parent
commit
c5d969db0a
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/view/case/draw/board/editCAD/Geometry/CustomImage.js

+ 2 - 1
src/view/case/draw/board/editCAD/Geometry/CustomImage.js

@@ -2,6 +2,7 @@ import VectorType from '../enum/VectorType.js'
 import Geometry from './Geometry'
 import { mathUtil } from '../MathUtil.js'
 import SelectState from '../enum/SelectState.js'
+import { coordinate } from '../Coordinate'
 
 export default class CustomImage extends Geometry {
     constructor(url,center,vectorId) {
@@ -18,7 +19,7 @@ export default class CustomImage extends Geometry {
     }
 
     isContain(position) {
-        if(Math.abs(position.x - this.center.x)<this.width/2 && Math.abs(position.y - this.center.y)<this.height/2)
+        if(Math.abs(position.x - this.center.x)* coordinate.res * coordinate.zoom/ 100 <this.width/2 && Math.abs(position.y - this.center.y)* coordinate.res * coordinate.zoom/ 100<this.height/2)
         {
             return SelectState.Select
         } else {