Showing
1 changed file
with
9 additions
and
3 deletions
| @@ -189,21 +189,26 @@ export struct CardSourceInfo { | @@ -189,21 +189,26 @@ export struct CardSourceInfo { | ||
| 189 | } | 189 | } |
| 190 | 190 | ||
| 191 | calcContentSpace() { | 191 | calcContentSpace() { |
| 192 | + | ||
| 193 | + console.log('display-text ,', this.displayText) | ||
| 192 | if (this.isLimited()) return; | 194 | if (this.isLimited()) return; |
| 193 | 195 | ||
| 194 | - const screenWidth = px2vp(display.getDefaultDisplaySync().width) | 196 | + const screenWidth = display.getDefaultDisplaySync().width |
| 195 | let leftSpace = screenWidth; | 197 | let leftSpace = screenWidth; |
| 198 | + console.log('display-leftSpace ', leftSpace) | ||
| 196 | const souceSize = this.getContentSize(this.displayText, 12); | 199 | const souceSize = this.getContentSize(this.displayText, 12); |
| 197 | const dotSize = 11; | 200 | const dotSize = 11; |
| 198 | 201 | ||
| 199 | if (this.contentDTO.cornerMark || this.contentDTO.corner) { | 202 | if (this.contentDTO.cornerMark || this.contentDTO.corner) { |
| 200 | const cornerSize = this.getContentSize(this.contentDTO.cornerMark || this.contentDTO.corner, 12); | 203 | const cornerSize = this.getContentSize(this.contentDTO.cornerMark || this.contentDTO.corner, 12); |
| 201 | leftSpace = leftSpace - cornerSize | 204 | leftSpace = leftSpace - cornerSize |
| 205 | + console.log('display-cornerMark ', cornerSize) | ||
| 202 | } | 206 | } |
| 203 | 207 | ||
| 204 | if (this.showTime()) { | 208 | if (this.showTime()) { |
| 205 | const timeSize = this.getContentSize(this.handleTimeStr(), 12); | 209 | const timeSize = this.getContentSize(this.handleTimeStr(), 12); |
| 206 | leftSpace = leftSpace - dotSize - timeSize | 210 | leftSpace = leftSpace - dotSize - timeSize |
| 211 | + console.log('display-showtime') | ||
| 207 | } | 212 | } |
| 208 | 213 | ||
| 209 | if (!this.isEllipsisActive) { | 214 | if (!this.isEllipsisActive) { |
| @@ -213,12 +218,14 @@ export struct CardSourceInfo { | @@ -213,12 +218,14 @@ export struct CardSourceInfo { | ||
| 213 | commentSize = this.getContentSize(`${this.handlerNum(commentNum.toString())}评`, 12); | 218 | commentSize = this.getContentSize(`${this.handlerNum(commentNum.toString())}评`, 12); |
| 214 | } | 219 | } |
| 215 | leftSpace = leftSpace - dotSize - commentSize | 220 | leftSpace = leftSpace - dotSize - commentSize |
| 221 | + console.log('display-commentSize ', commentSize) | ||
| 216 | } | 222 | } |
| 217 | 223 | ||
| 218 | if (leftSpace < souceSize) { | 224 | if (leftSpace < souceSize) { |
| 219 | this.onlyShowCornerAndSource = true; | 225 | this.onlyShowCornerAndSource = true; |
| 226 | + console.log('display-size 1') | ||
| 220 | } | 227 | } |
| 221 | - | 228 | + console.log('display-size 2,', leftSpace, souceSize, this.onlyShowCornerAndSource) |
| 222 | } | 229 | } |
| 223 | 230 | ||
| 224 | build() { | 231 | build() { |
| @@ -313,7 +320,6 @@ export struct CardSourceInfo { | @@ -313,7 +320,6 @@ export struct CardSourceInfo { | ||
| 313 | } | 320 | } |
| 314 | .width(CommonConstants.FULL_WIDTH) | 321 | .width(CommonConstants.FULL_WIDTH) |
| 315 | .margin({ top: this.viewShowData ? 8 : 0 }) | 322 | .margin({ top: this.viewShowData ? 8 : 0 }) |
| 316 | - .clip(true) | ||
| 317 | 323 | ||
| 318 | } | 324 | } |
| 319 | 325 |
-
Please register or login to post a comment