Commit dfc9857d authored by Li MingZhe's avatar Li MingZhe

fix: 居中bug

parent bdcef3a7
......@@ -924,16 +924,16 @@ cc.Class({
const line1 = lineArr[0];
const line1LastItem = line1[line1.length - 1];
const totalLine1 = line1LastItem.x + line1LastItem.width / 2;
const offX1 = (maxW - totalLine1) / 2
const offX1 = (answerNode.width - totalLine1) / 2
for (let i=0; i<line1.length; i++) {
line1[i].x += offX1;
}
const line2 = lineArr[1];
if (line2) {
const line2LastItem = line2[line2.length - 1];
if (line2LastItem) {
const totalLine2 = line2LastItem.x + line2LastItem.width / 2;
const offX2 = (maxW - totalLine2) / 2
const offX2 = (answerNode.width - totalLine2) / 2
for (let i=0; i<line2.length; i++) {
line2[i].x += offX2;
}
......
No preview for this file type
{"ios":{"sceneName":"dfzx_cocos_pinjuzi","version":"a38bb"},"android":{"sceneName":"dfzx_cocos_pinjuzi","version":"a38bb"}}
\ No newline at end of file
{"ios":{"sceneName":"dfzx_cocos_pinjuzi","version":"7387b"},"android":{"sceneName":"dfzx_cocos_pinjuzi","version":"7387b"}}
\ No newline at end of file
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