File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -222,8 +222,11 @@ export default class Painter {
222
222
const linesArray = [ ] ;
223
223
for ( let i = 0 ; i < textArray . length ; ++ i ) {
224
224
const textLength = this . ctx . measureText ( textArray [ i ] ) . width ;
225
+ const minWidth = view . css . fontSize . toPx ( ) + paddings [ 1 ] + paddings [ 3 ] ;
225
226
let partWidth = view . css . width ? view . css . width . toPx ( false , this . style . width ) - paddings [ 1 ] - paddings [ 3 ] : textLength ;
226
- // partWidth = partWidth > fontSize ? partWidth - partWidth % fontSize + fontSize : fontSize
227
+ if ( partWidth < minWidth ) {
228
+ partWidth = minWidth ;
229
+ }
227
230
const calLines = Math . ceil ( textLength / partWidth ) ;
228
231
// 取最长的作为 width
229
232
width = partWidth > width ? partWidth : width ;
Original file line number Diff line number Diff line change @@ -314,7 +314,8 @@ Component({
314
314
} , true , this . movingCache ) ;
315
315
} else {
316
316
// 某些机型(华为 P20)非移动场景下,只绘制一遍会偶然性图片绘制失败,目前采用再绘一遍的方法
317
- if ( ! isMoving && doView . type === 'image' ) {
317
+ // 文字也会出现
318
+ if ( ! isMoving && ( doView . type === 'image' || doView . type === 'text' ) ) {
318
319
pen . paint ( )
319
320
}
320
321
pen . paint ( ( callbackInfo ) => {
You can’t perform that action at this time.
0 commit comments