chenjun

title两行情况下summary微调

... ... @@ -148,6 +148,7 @@ export struct PlayerTitleView {
private updateSummaryLines() {
this.summaryLines = Math.max(1, 4 - this.titleLines)
// console.info(`cj2024 titleLines = ${this.titleLines}`)
this.isOverLines = this.summary.length > this.clipText(this.summary, 14, this.summaryLines, this.windowWidth - 150 - vp2px(50)).length
}
... ... @@ -306,7 +307,9 @@ export struct PlayerTitleView {
}
}
.onAreaChange((oldArea: Area, newArea: Area) => {
this.titleLines = Math.ceil((newArea.height as number) / 20) // 20是行高
//console.info(`cj2024 titleLines = ${newArea.height as number} line = ${(newArea.height as number) / 20}`)
this.titleLines = Math.floor((newArea.height as number) / 20)// 20是行高
//console.info(`cj2024 titleLines = ${this.titleLines}`)
this.updateSummaryLines()
})
.padding({
... ...