Commit 4c4991fe authored by liujiaxin's avatar liujiaxin

fix: url regex

parent f26c09c2
...@@ -273,7 +273,7 @@ export default class Cartoon { ...@@ -273,7 +273,7 @@ export default class Cartoon {
// 挂载精灵帧到节点 // 挂载精灵帧到节点
mountRemoteImageToNode(url, node, width, height, fillType) { mountRemoteImageToNode(url, node, width, height, fillType) {
// console.log(`Get remote image from [${url}]`) // console.log(`Get remote image from [${url}]`)
return new Promise((resovle, reject) => { return new Promise((resolve, reject) => {
this.getSpriteFrimeByUrl(url).then((fr)=>{ this.getSpriteFrimeByUrl(url).then((fr)=>{
let relWidth = fr.getRect().width; let relWidth = fr.getRect().width;
let relHeight = fr.getRect().height; let relHeight = fr.getRect().height;
...@@ -289,7 +289,7 @@ export default class Cartoon { ...@@ -289,7 +289,7 @@ export default class Cartoon {
// fr.width = s * fr.getRect().width; // fr.width = s * fr.getRect().width;
// fr.height = s * fr.getRect().height; // fr.height = s * fr.getRect().height;
node.getComponent(cc.Sprite).spriteFrame = fr; node.getComponent(cc.Sprite).spriteFrame = fr;
resovle([relWidth, relHeight]) resolve([relWidth, relHeight])
}) })
}) })
} }
...@@ -316,7 +316,7 @@ export default class Cartoon { ...@@ -316,7 +316,7 @@ export default class Cartoon {
} }
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
resovle([relWidth, relHeight]) resolve([relWidth, relHeight])
}); });
} }
......
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