Commit ae3a0358 by linjinhong

fix:设置图片位置在顶部居中

parent f698952b
...@@ -88,7 +88,7 @@ export default { ...@@ -88,7 +88,7 @@ export default {
"position_before_px", "position_before_px",
JSON.parse(JSON.stringify(this.item)), JSON.parse(JSON.stringify(this.item)),
); );
// console.log("setting", setting); console.log("this.item", this.item);
let x_mm, w_mm, h_mm, y_mm; let x_mm, w_mm, h_mm, y_mm;
x_mm = this.pxToUnit(this.item.x); x_mm = this.pxToUnit(this.item.x);
......
...@@ -825,8 +825,6 @@ export default { ...@@ -825,8 +825,6 @@ export default {
let h = bh / 2; let h = bh / 2;
let width_px, height_px, rate, x, y; let width_px, height_px, rate, x, y;
let data = await that.getImageSize(files[i].url); let data = await that.getImageSize(files[i].url);
console.log("data", data);
console.log("that.WHproportion", that.WHproportion);
if (size && !files[i].isCut) { if (size && !files[i].isCut) {
console.log("size", size); console.log("size", size);
...@@ -860,7 +858,7 @@ export default { ...@@ -860,7 +858,7 @@ export default {
// height_px = width_px * rate > bh ? bh : width_px * rate; // height_px = width_px * rate > bh ? bh : width_px * rate;
height_px = width_px * rate; height_px = width_px * rate;
x = width_px / 2; x = width_px / 2;
y = h; y = height_px / 2;
} }
} }
this.currentImgData = { ...data }; this.currentImgData = { ...data };
...@@ -885,7 +883,7 @@ export default { ...@@ -885,7 +883,7 @@ export default {
if (size && !files[i].isCut) { if (size && !files[i].isCut) {
that.ev("cover"); that.ev("cover");
} else { } else {
that.ev("center"); that.ev("x_center");
} }
} }
......
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