修复图片更新刷新长宽问题
This commit is contained in:
parent
6657c1c05e
commit
0ca93907d2
16
painter.js
16
painter.js
@ -269,16 +269,22 @@ Component({
|
|||||||
}
|
}
|
||||||
if (newVal && newVal.url && doView.url && newVal.url !== doView.url) {
|
if (newVal && newVal.url && doView.url && newVal.url !== doView.url) {
|
||||||
downloader.download(newVal.url, this.properties.LRU).then((path) => {
|
downloader.download(newVal.url, this.properties.LRU).then((path) => {
|
||||||
|
doView.originUrl = newVal.url
|
||||||
|
doView.url = path;
|
||||||
wx.getImageInfo({
|
wx.getImageInfo({
|
||||||
src: path,
|
src: path,
|
||||||
success: () => {
|
success: (res) => {
|
||||||
doView.originUrl = newVal.url
|
doView.sHeight = res.height
|
||||||
doView.url = path;
|
doView.sWidth = res.width
|
||||||
newVal.sHeight && (doView.sHeight = newVal.sHeight);
|
|
||||||
newVal.sWidth && (doView.sWidth = newVal.sWidth);
|
|
||||||
this.reDraw(doView, callback, isMoving)
|
this.reDraw(doView, callback, isMoving)
|
||||||
},
|
},
|
||||||
|
fail: () => {
|
||||||
|
this.reDraw(doView, callback, isMoving)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
}).catch(() => {
|
||||||
|
// 未下载成功,直接绘制
|
||||||
|
this.reDraw(doView, callback, isMoving)
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
(newVal && newVal.text && doView.text && newVal.text !== doView.text) && (doView.text = newVal.text);
|
(newVal && newVal.text && doView.text && newVal.text !== doView.text) && (doView.text = newVal.text);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user