|
@@ -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 {
|