Commit 515acfb2 authored by limingzhe's avatar limingzhe

fix: debug

parent 144ca130
...@@ -96,9 +96,15 @@ export default class NewClass extends cc.Component { ...@@ -96,9 +96,15 @@ export default class NewClass extends cc.Component {
jc_arr: userInfo.jc_arr, jc_arr: userInfo.jc_arr,
}); });
const canvas = cc.find("Canvas");
this.SvContent.opacity = 0; this.SvContent.opacity = 0;
if (!this.SvContent['baseH']) {
this.SvContent['baseH'] = this.SvContent.height;
this.SvContent.height *= canvas.height / 1080;
this.SvContent.parent.height = this.SvContent.height;
}
let loadEndCount = 0; let loadEndCount = 0;
// rows.length = 2;
for(let i=0; i<rows.length; i++) { for(let i=0; i<rows.length; i++) {
const row = rows[i]; const row = rows[i];
...@@ -142,7 +148,6 @@ export default class NewClass extends cc.Component { ...@@ -142,7 +148,6 @@ export default class NewClass extends cc.Component {
this.SvContent.opacity = 255; this.SvContent.opacity = 255;
const contentW = this.SvContent.getContentSize().width; const contentW = this.SvContent.getContentSize().width;
const canvas = cc.find("Canvas");
if (contentW < canvas.width) { if (contentW < canvas.width) {
// this.SvContent.x = 0; // this.SvContent.x = 0;
this.SvContent.x = -contentW / 2; this.SvContent.x = -contentW / 2;
...@@ -153,6 +158,11 @@ export default class NewClass extends cc.Component { ...@@ -153,6 +158,11 @@ export default class NewClass extends cc.Component {
this.loading.active = false; this.loading.active = false;
} }
}); });
const scale = canvas.height / 1080;
ci.width *= scale;
ci.height *= scale;
ci.scale = scale;
this.SvContent.addChild(ci); this.SvContent.addChild(ci);
console.log("this.canvas.width: ", cc.find("Canvas").width) console.log("this.canvas.width: ", cc.find("Canvas").width)
......
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