@@ -201,7 +201,7 @@ export default class Painter {
201
201
const linesArray = [ ] ;
202
202
for ( let i = 0 ; i < textArray . length ; ++ i ) {
203
203
const textLength = this . ctx . measureText ( textArray [ i ] ) . width ;
204
- const partWidth = view . css . width ? view . css . width . toPx ( ) : textLength ;
204
+ const partWidth = view . css . width ? view . css . width . toPx ( false , this . style . width ) : textLength ;
205
205
const calLines = Math . ceil ( textLength / partWidth ) ;
206
206
width = partWidth > width ? partWidth : width ;
207
207
lines += calLines ;
@@ -234,14 +234,14 @@ export default class Painter {
234
234
width = Math . round ( view . sWidth / ratio ) ;
235
235
height = Math . round ( view . sHeight / ratio ) ;
236
236
} else if ( view . css . width === 'auto' ) {
237
- height = view . css . height . toPx ( ) ;
237
+ height = view . css . height . toPx ( false , this . style . height ) ;
238
238
width = view . sWidth / view . sHeight * height ;
239
239
} else if ( view . css . height === 'auto' ) {
240
- width = view . css . width . toPx ( ) ;
240
+ width = view . css . width . toPx ( false , this . style . width ) ;
241
241
height = view . sHeight / view . sWidth * width ;
242
242
} else {
243
- width = view . css . width . toPx ( ) ;
244
- height = view . css . height . toPx ( ) ;
243
+ width = view . css . width . toPx ( false , this . style . width ) ;
244
+ height = view . css . height . toPx ( false , this . style . height ) ;
245
245
}
246
246
break ;
247
247
}
@@ -250,8 +250,8 @@ export default class Painter {
250
250
console . error ( 'You should set width and height' ) ;
251
251
return ;
252
252
}
253
- width = view . css . width . toPx ( ) ;
254
- height = view . css . height . toPx ( ) ;
253
+ width = view . css . width . toPx ( false , this . style . width ) ;
254
+ height = view . css . height . toPx ( false , this . style . height ) ;
255
255
break ;
256
256
}
257
257
let x ;
0 commit comments