Commit 3f1d87e0 authored by liujiangnan's avatar liujiangnan

debug

parent e30b4fbc
...@@ -103,8 +103,15 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -103,8 +103,15 @@ export default class SceneComponent extends MyCocosSceneComponent {
return true; return true;
} }
const rect = this.data.pageArr[this.currentPageIdx].hotZoneItemArr[this.currentPartIdx].rect; const hotRect = this.data.pageArr[this.currentPageIdx].hotZoneItemArr[this.currentPartIdx].rect;
const {width, height} = this.data.pageArr[this.currentPageIdx].bgItem.rect;
const checkInRegion = (p) => { const checkInRegion = (p) => {
const rect = {
x: hotRect.x / width,
y: hotRect.y / height,
width: hotRect.width / width,
height: hotRect.height / height,
}
this.showTips(`p===${p.x}||${p.y}====rect===${rect.x}||${rect.y}||${rect.width}||${rect.height}`); this.showTips(`p===${p.x}||${p.y}====rect===${rect.x}||${rect.y}||${rect.width}||${rect.height}`);
const w = p.x > rect.x && p.x < (rect.x + rect.width); const w = p.x > rect.x && p.x < (rect.x + rect.width);
const h = p.y > rect.y && p.y < (rect.y + rect.height); const h = p.y > rect.y && p.y < (rect.y + rect.height);
...@@ -113,7 +120,6 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -113,7 +120,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
const pageId = this.data.pageArr[this.currentPageIdx].pageIdx; const pageId = this.data.pageArr[this.currentPageIdx].pageIdx;
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
window["air"].osmoFingerReadCallback = (result) => { window["air"].osmoFingerReadCallback = (result) => {
this.showTips(result);
const resultObj = JSON.parse(result); const resultObj = JSON.parse(result);
const p = resultObj.finger_pos_in_page; const p = resultObj.finger_pos_in_page;
if (p.x == -1 || p.y == -1) { if (p.x == -1 || p.y == -1) {
......
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