Commit af4211de authored by wangxuelai's avatar wangxuelai

'点评bug修改'

parent 54ae486a
......@@ -244,6 +244,8 @@ Page({
let url = imagify(imgArr[AcSubIndex]);
const paintBoxRate = this.data.paintBoxWidth / this.data.paintBoxHeight;
const currentImgRate = imgInfoList[AcSubIndex].imageWidth / imgInfoList[AcSubIndex].imageHeight;
console.log(paintBoxRate, 'paintBoxRate');
console.log(currentImgRate, 'currentImgRate');
if (currentImgRate > paintBoxRate) {
imgInfoList[AcSubIndex].width = this.data.paintBoxWidth;
imgInfoList[AcSubIndex].height = imgInfoList[AcSubIndex].width / currentImgRate;
......@@ -252,8 +254,8 @@ Page({
[`imgInfoList[${AcSubIndex}].height`]: imgInfoList[AcSubIndex].height,
})
} else {
imgInfoList[AcSubIndex].width = this.data.paintBoxWidth;
imgInfoList[AcSubIndex].height = imgInfoList[AcSubIndex].width / currentImgRate;
imgInfoList[AcSubIndex].height = this.data.paintBoxHeight;
imgInfoList[AcSubIndex].width = imgInfoList[AcSubIndex].height * currentImgRate;
this.setData({
[`imgInfoList[${AcSubIndex}].width`]: imgInfoList[AcSubIndex].width,
[`imgInfoList[${AcSubIndex}].height`]: imgInfoList[AcSubIndex].height,
......
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