Commit ba04a86e authored by 范雪寒's avatar 范雪寒

feat:

parent 7769b402
...@@ -255,7 +255,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -255,7 +255,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.setNodeSpirteFrameByUrl(pageUrl, partImg, () => { this.setNodeSpirteFrameByUrl(pageUrl, partImg, () => {
const rect = pageData.hotZoneItemArr[this.currentPartIdx].rect; const rect = pageData.hotZoneItemArr[this.currentPartIdx].rect;
const x = ((rect.x + rect.width / 2) - bgRect.width / 2) * partImg.width / bgRect.width; const x = ((rect.x + rect.width / 2) - bgRect.width / 2) * partImg.width / bgRect.width;
const y = (bgRect.height / 2 - (rect.y + rect.height / 2)) * partImg.height / bgRect.height; const y = ((rect.y + rect.height / 2) - bgRect.height / 2) * partImg.height / bgRect.height;
partImg.scale = Math.min( partImg.scale = Math.min(
(partImg.parent.width / partImg.width) * (bgRect.width / rect.width), (partImg.parent.width / partImg.width) * (bgRect.width / rect.width),
......
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