Skip to content

Commit

Permalink
fix(android_textalign): Fix text alignment problem on Android.
Browse files Browse the repository at this point in the history
  • Loading branch information
carldebilly committed Feb 1, 2021
1 parent cd51e0c commit 8ceed71
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Uno.UI/UI/Xaml/Controls/TextBlock/TextBlock.Android.cs
Expand Up @@ -336,7 +336,7 @@ protected override Size ArrangeOverride(Size finalSize)
var isSameWidth = _measureLayout.AvailableSize.Width == arrangeSize.Width;

// If the requested height is the same
var isSameHeight = _measureLayout.AvailableSize.Height == arrangeSize.Width;
var isSameHeight = _measureLayout.AvailableSize.Height == arrangeSize.Height;

// If the measured height is exactly the same
var isSameMeasuredHeight = _measureLayout.MeasuredSize.Height == arrangeSize.Height;
Expand Down Expand Up @@ -582,7 +582,8 @@ private Size UpdateLayout(Size availableSize, bool exactWidth = false)

var shouldRemoveUnfitLines = _ellipsize != null;

if (shouldRemoveUnfitLines && maxHeight != null && measuredHeight >= maxHeight)
//if (shouldRemoveUnfitLines && maxHeight != null && measuredHeight > maxHeight)
if (shouldRemoveUnfitLines && maxHeight != null && measuredHeight > maxHeight)
{
var lineAtHeight = Layout.GetLineForOffset(maxHeight.Value) + 1;
measuredHeight = Layout.GetLineTop(lineAtHeight);
Expand Down

0 comments on commit 8ceed71

Please sign in to comment.