@@ -227,7 +227,7 @@ export class Label extends LabelBase {
227
227
updateVerticalAlignment ( ) {
228
228
const tv = this . nativeTextViewProtected ;
229
229
const inset = this . nativeViewProtected . textContainerInset ;
230
- const top = inset . top ;
230
+ const top = layout . toDeviceIndependentPixels ( this . effectivePaddingTop + this . effectiveBorderTopWidth ) ;
231
231
switch ( this . verticalTextAlignment ) {
232
232
case 'initial' : // not supported
233
233
case 'top' :
@@ -242,9 +242,9 @@ export class Label extends LabelBase {
242
242
case 'middle' :
243
243
case 'center' : {
244
244
const height = this . computeTextHeight ( CGSizeMake ( tv . bounds . size . width , 10000 ) ) ;
245
- let topCorrect = ( tv . bounds . size . height + inset . top - inset . bottom - height * tv . zoomScale ) / 2.0 ;
245
+ const bottom = layout . toDeviceIndependentPixels ( this . effectivePaddingBottom + this . effectiveBorderBottomWidth ) ;
246
+ let topCorrect = ( tv . bounds . size . height - bottom - height * tv . zoomScale ) / 2.0 ;
246
247
topCorrect = topCorrect < 0.0 ? 0.0 : topCorrect ;
247
- // tv.contentOffset = CGPointMake(0, -topCorrect);
248
248
this . nativeViewProtected . textContainerInset = {
249
249
top : top + topCorrect ,
250
250
left : inset . left ,
@@ -256,9 +256,9 @@ export class Label extends LabelBase {
256
256
257
257
case 'bottom' : {
258
258
const height = this . computeTextHeight ( CGSizeMake ( tv . bounds . size . width , 10000 ) ) ;
259
- let bottomCorrect = tv . bounds . size . height - inset . bottom - height * tv . zoomScale ;
259
+ const bottom = layout . toDeviceIndependentPixels ( this . effectivePaddingBottom + this . effectiveBorderBottomWidth ) ;
260
+ let bottomCorrect = tv . bounds . size . height - bottom - height * tv . zoomScale ;
260
261
bottomCorrect = bottomCorrect < 0.0 ? 0.0 : bottomCorrect ;
261
- // tv.contentOffset = CGPointMake(0, -bottomCorrect);
262
262
this . nativeViewProtected . textContainerInset = {
263
263
top : top + bottomCorrect ,
264
264
left : inset . left ,
0 commit comments