fix:update getHitResult api
This commit is contained in:
@ -207,14 +207,14 @@
|
|||||||
|
|
||||||
// create hotpoint...
|
// create hotpoint...
|
||||||
if (addingHotpoint && target instanceof HTMLCanvasElement) {
|
if (addingHotpoint && target instanceof HTMLCanvasElement) {
|
||||||
const result = viewer.getHitResult(event);
|
const location = viewer.getHitResult(event);
|
||||||
if (!result || !result.location) {
|
if (!location) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const hotpointId = `hotpoint_${hotpointCount}`;
|
const hotpointId = `hotpoint_${hotpointCount}`;
|
||||||
const hotpoint = {
|
const hotpoint = {
|
||||||
hotpointId,
|
hotpointId,
|
||||||
anchorPosition: [result.location[0], result.location[1]],
|
anchorPosition: [location.x, location.y],
|
||||||
visible: true,
|
visible: true,
|
||||||
html: `<div class="hotpoint" id="hotpoint_${hotpointId}">
|
html: `<div class="hotpoint" id="hotpoint_${hotpointId}">
|
||||||
<div class="hotpoint-dot" id="hotpoint-dot_${hotpointId}"></div>
|
<div class="hotpoint-dot" id="hotpoint-dot_${hotpointId}"></div>
|
||||||
|
Reference in New Issue
Block a user