Commit 0eaa6ef6 authored by Chen Jiping's avatar Chen Jiping

perf:增加选中范围

parent ad15e80c
...@@ -375,7 +375,18 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -375,7 +375,18 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
checkClickHotZoneTarget(target){
const rect = target.getBoundingBox();
rect.width += 60 * this.mapScale;
rect.height += 60 * this.mapScale;
if (this.checkPointInRect(this.mx, this.my, rect)) {
return true;
}
return false;
}
checkClickTarget(target) { checkClickTarget(target) {
...@@ -730,7 +741,6 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -730,7 +741,6 @@ export class PlayComponent implements OnInit, OnDestroy {
this.hotZoneArr.push(hotZone); this.hotZoneArr.push(hotZone);
} }
} }
getHotZoneItem(data, rate) { getHotZoneItem(data, rate) {
...@@ -838,7 +848,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -838,7 +848,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this.magnifier['wrong'].visible = false; this.magnifier['wrong'].visible = false;
let hotZoneItem; let hotZoneItem;
this.hotZoneArr.forEach((item) => { this.hotZoneArr.forEach((item) => {
if (this.checkClickTarget(item)) { if (this.checkClickHotZoneTarget(item)) {
hotZoneItem = item; hotZoneItem = item;
return; return;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment