diff --git a/src/components/Common/Typesetting/typesetting.js b/src/components/Common/Typesetting/typesetting.js index d222529..7a2aed4 100644 --- a/src/components/Common/Typesetting/typesetting.js +++ b/src/components/Common/Typesetting/typesetting.js @@ -224,10 +224,11 @@ const Typesetting = props => { : Math.max(jInnerHeight + dFWidthOffset, jInnerHeight + dSWidthOffset) + dXBJJ; // 计算内层盒子高度 从上向下排列 取首盒加偏移量和次盒加偏移量最大的值 从左往右排列 盒子尺寸 * 2 加上首盒偏移量和次盒偏移量 // 计算内层盒子宽度 从上向下排列 取首盒加偏移量和次盒加偏移量最大的值 从左往右排列 盒子尺寸 * 2 加上首盒偏移量和次盒偏移量 const innerWidthCombined = isVertical - ? Math.max(jInnerWidth + dFLengthOffset, jInnerWidth + dSLengthOffset) + dYBJJ +? Math.max(jInnerWidth + dFLengthOffset, jInnerWidth + dSLengthOffset) + dYBJJ : jInnerWidth * 2 + dSLengthOffset + dFLengthOffset + dYBJJ; - console.log(innerWidthCombined,innerHeightCombined,jInnerWidth,jInnerHeight,'innerHeightCombined'); + console.log(innerWidthCombined,dFLengthOffset,dSLengthOffset,jInnerWidth,'innerHeightCombined'); + console.log(innerHeightCombined,dFWidthOffset,dSWidthOffset,innerHeightCombined,'innerHeightCombined'); const style = { width: `${outerWidth}px`, @@ -517,14 +518,14 @@ const Typesetting = props => { if (cols === 0 || rows === 0) { if (cols > 0) { for (let col = 0; col < cols; col++) { - const leftPosition = col * (innerWidthCombined + dYBJJ); + const leftPosition = col * (innerWidthCombined); const topPosition = 0 * (innerHeightCombined + dXBJJ); innerDivs.push(createBoxOne(col, 0, 3, leftPosition, topPosition, iFAngle, DisableMateriallIcon)); } } if (rows > 0) { for (let row = 0; row < rows; row++) { - const leftPosition = 0 * (innerWidthCombined + dYBJJ); + const leftPosition = 0 * (innerWidthCombined); const topPosition = row * (innerHeightCombined + dXBJJ); innerDivs.push(createBoxOne(0, row, 3, leftPosition, topPosition, iFAngle, DisableMateriallIcon)); } @@ -532,8 +533,8 @@ const Typesetting = props => { } else { for (let col = 0; col < cols; col++) { for (let row = 0; row < rows; row++) { - const leftPosition = col * (innerWidthCombined + dYBJJ); - const topPosition = row * (innerHeightCombined + dXBJJ); + const leftPosition = col * (innerWidthCombined); + const topPosition = row * (innerHeightCombined + dXBJJ) ; innerDivs.push(createBox(col, row, 1, leftPosition, topPosition, iFAngle, DisableMateriallIcon)); } // 如果可以放下首盒 @@ -544,10 +545,10 @@ const Typesetting = props => { if (reference) { // 是否首盒 // 首盒的上边距下边距 末尾盒子的上下边距 添加那一行的上边距 - leftPosition = col * (innerWidthCombined + dYBJJ) + dFLengthOffset; + leftPosition = col * (innerWidthCombined) + dFLengthOffset; topPosition = rows * (innerHeightCombined + dXBJJ) + dFWidthOffset; } else { - leftPosition = col * (innerWidthCombined + dYBJJ); + leftPosition = col * (innerWidthCombined); topPosition = rows * (innerHeightCombined + dXBJJ); } innerDivs.push(createBoxOne(col, rows, 3, leftPosition, topPosition, iFAngle, DisableMateriallIcon)); @@ -558,9 +559,9 @@ const Typesetting = props => { let leftPosition = 0; if (reference) { topPosition = index * (innerHeightCombined + boxWidthOffset); - leftPosition = cols * (innerWidthCombined + boxLengthOffset); + leftPosition = cols * (innerWidthCombined + boxLengthOffset + dXBJJ); } else { - topPosition = index * (innerHeightCombined + boxWidthOffset + dSWidthOffset); + topPosition = index * (innerHeightCombined + boxWidthOffset + dSWidthOffset + dXBJJ); leftPosition = cols * (innerWidthCombined + boxLengthOffset + dSLengthOffset); } innerDivs.push(createDiv(col, index, 3, leftPosition + col * dYBJJ, topPosition + index * dXBJJ, iFAngle, DisableMateriallIcon));