Commit 50064f04 authored by limingzhe's avatar limingzhe

fix: 滚动条背景尺寸调节

parent ca9d44f4
...@@ -898,19 +898,19 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -898,19 +898,19 @@ export class PlayComponent implements OnInit, OnDestroy {
submitBtn; submitBtn;
btnArr = []; btnArr = [];
btnDisH = 120;
initBtn() { initBtn() {
this.topArr = []; this.topArr = [];
const btnArr = []; const btnArr = [];
let arr = JSON.parse(JSON.stringify(this.sentenceArr)) ; let arr = JSON.parse(JSON.stringify(this.sentenceArr)) ;
// arr = arr.concat(arr[0]);
arr = randomSortByArr(arr); arr = randomSortByArr(arr);
if (!arr) { if (!arr) {
return; return;
} }
const disW = 400 * this.mapScale; const disW = 400 * this.mapScale;
const disH = 120 * this.mapScale; const disH = this.btnDisH * this.mapScale;
const tmpLen = arr.length > 5 ? 5 : arr.length; const tmpLen = arr.length > 5 ? 5 : arr.length;
let baseX = this.canvasWidth / 2 - (tmpLen - 1) * disW / 2 let baseX = this.canvasWidth / 2 - (tmpLen - 1) * disW / 2
let baseY = this.canvasHeight / 2 - 380 * this.mapScale; let baseY = this.canvasHeight / 2 - 380 * this.mapScale;
...@@ -1067,12 +1067,13 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1067,12 +1067,13 @@ export class PlayComponent implements OnInit, OnDestroy {
sentenceEmptyArr; sentenceEmptyArr;
initSentence() { initSentence() {
const tmpY = this.btnArr[this.btnArr.length - 1].y; const row = Math.floor( (this.btnArr.length - 1) / 5 ) + 1;
const subH = row * this.btnDisH ;
const sv = new ScrollView(); const sv = new ScrollView();
sv.setShowSize(this.panel.width, 1250 - tmpY); sv.setShowSize(this.panel.width, 900 - subH);
sv.x = -this.panel.width / 2; sv.x = -this.panel.width / 2;
sv.y = tmpY - 720; sv.y = -395 + subH;
sv.setBgColor('#faf7ee') sv.setBgColor('#faf7ee')
// sv.setMapScale(this.mapScale); // sv.setMapScale(this.mapScale);
// sv.content.setScaleXY(1/this.mapScale); // sv.content.setScaleXY(1/this.mapScale);
......
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