@@ -204,19 +204,10 @@ void LayoutButton(UIButton platformButton, Button button, Rect size)
204204 // Which makes the later math easier to follow
205205 if ( layout . Position == ButtonContentLayout . ImagePosition . Left || layout . Position == ButtonContentLayout . ImagePosition . Right )
206206 {
207- // In RTL mode, physical Left/Right offsets must be reversed.
208- // Use EffectiveFlowDirection to handle both explicit and inherited RTL.
209- nfloat dir = ( ( IVisualElementController ) button ) . EffectiveFlowDirection . IsRightToLeft ( ) ? - 1 : 1 ;
210-
211- imageInsets . Left += dir * ( titleWidth / 2 ) ;
212- imageInsets . Right -= dir * ( titleWidth / 2 ) ;
213- titleInsets . Left -= dir * ( imageWidth / 2 ) ;
214- titleInsets . Right += dir * ( imageWidth / 2 ) ;
215-
216- imageInsets . Left -= dir * ( ( titleWidth / 2 ) + sharedSpacing ) ;
217- imageInsets . Right += dir * ( ( titleWidth / 2 ) + sharedSpacing ) ;
218- titleInsets . Left += dir * ( ( imageWidth / 2 ) + sharedSpacing ) ;
219- titleInsets . Right -= dir * ( ( imageWidth / 2 ) + sharedSpacing ) ;
207+ imageInsets . Left += titleWidth / 2 ;
208+ imageInsets . Right -= titleWidth / 2 ;
209+ titleInsets . Left -= imageWidth / 2 ;
210+ titleInsets . Right += imageWidth / 2 ;
220211 }
221212
222213 if ( layout . Position == ButtonContentLayout . ImagePosition . Top )
@@ -245,6 +236,23 @@ void LayoutButton(UIButton platformButton, Button button, Rect size)
245236 titleInsets . Right += ( nfloat ) padding . Right ;
246237
247238 }
239+ else if ( layout . Position == ButtonContentLayout . ImagePosition . Left )
240+ {
241+ imageInsets . Left -= ( titleWidth / 2 ) + sharedSpacing ;
242+ imageInsets . Right += ( titleWidth / 2 ) + sharedSpacing ;
243+
244+ titleInsets . Left += ( imageWidth / 2 ) + sharedSpacing ;
245+ titleInsets . Right -= ( imageWidth / 2 ) + sharedSpacing ;
246+
247+ }
248+ else if ( layout . Position == ButtonContentLayout . ImagePosition . Right )
249+ {
250+ imageInsets . Left += ( titleWidth / 2 ) + sharedSpacing ;
251+ imageInsets . Right -= ( titleWidth / 2 ) + sharedSpacing ;
252+
253+ titleInsets . Left -= ( imageWidth / 2 ) + sharedSpacing ;
254+ titleInsets . Right += ( imageWidth / 2 ) + sharedSpacing ;
255+ }
248256 }
249257
250258#pragma warning disable CA1416 , CA1422
0 commit comments