Repository: unoplatform/uno
File: src/Uno.UI/UI/Xaml/Controls/TextBlock/TextBlock.skia.cs (C#)

Code before:
			LostFocus += (_, _) => UpdateSelectionRendering();
		}

		internal TextBox? OwningTextBox { private get; init; }

#if DEBUG
		private protected override void OnLoaded()
		{
			base.OnLoaded();
			Visual.Comment = $"{Visual.Comment}#text";
		}
#endif

		protected override Size MeasureOverride(Size availableSize)
		{
			var padding = Padding;
			var availableSizeWithoutPadding = availableSize.Subtract(padding).AtLeastZero();
			ParsedText = new UnicodeText(
				availableSizeWithoutPadding,
				Inlines.TraversedTree.leafTree,
				GetDefaultFontDetails(),
				MaxLines,
				(float)LineHeight,
				LineStackingStrategy,
				FlowDirection,
				(OwningTextBox as IDependencyObjectStoreProvider)?.Store.GetCurrentHighestValuePrecedence(TextBox.TextAlignmentProperty) is DependencyPropertyValuePrecedences.DefaultValue ? null : TextAlignment,
				TextWrapping,
				out var desiredSize);

			desiredSize = desiredSize.Add(padding);

			if (GetUseLayoutRounding())
			{
				// In order to prevent text clipping as a result of layout rounding at
				// scales other than 1.0x, the ceiling of the rescaled size is used.
				var plateauScale = RootScale.GetRasterizationScaleForElement(this);
				Size pageNodeSize = desiredSize;
				desiredSize.Width = ((int)Math.Ceiling(pageNodeSize.Width * plateauScale)) / plateauScale;
				desiredSize.Height = ((int)Math.Ceiling(pageNodeSize.Height * plateauScale)) / plateauScale;

				// LsTextLine is not aware of layoutround and uses baseline height to place the rendered text.
				// However, because the height of the *block is potentionally layoutround-ed up, we should adjust the
				// placement of text by the difference.  Horizontal adjustment is not of concern since
				// LsTextLine uses arranged size which is already layoutround-ed.
				//_layoutRoundingHeightAdjustment = desiredSize.Height - pageNodeSize.Height;
			}

			return desiredSize;
		}

		// the entire body of the text block is considered hit-testable

Review comment (suggestion):
```suggestion
				(OwningTextBox as IDependencyObjectStoreProvider)
					?.Store.GetCurrentHighestValuePrecedence(TextBox.TextAlignmentProperty)
					is DependencyPropertyValuePrecedences.DefaultValue
					? null : TextAlignment,
```

Code after:
			LostFocus += (_, _) => UpdateSelectionRendering();
		}

		internal TextBox? OwningTextBox { private get; init; }

#if DEBUG
		private protected override void OnLoaded()
		{
			base.OnLoaded();
			Visual.Comment = $"{Visual.Comment}#text";
		}
#endif

		protected override Size MeasureOverride(Size availableSize)
		{
			var padding = Padding;
			var availableSizeWithoutPadding = availableSize.Subtract(padding).AtLeastZero();
			ParsedText = ParseText(availableSizeWithoutPadding, out var desiredSize);

			desiredSize = desiredSize.Add(padding);

			if (GetUseLayoutRounding())
			{
				// In order to prevent text clipping as a result of layout rounding at
				// scales other than 1.0x, the ceiling of the rescaled size is used.
				var plateauScale = RootScale.GetRasterizationScaleForElement(this);
				Size pageNodeSize = desiredSize;
				desiredSize.Width = ((int)Math.Ceiling(pageNodeSize.Width * plateauScale)) / plateauScale;
				desiredSize.Height = ((int)Math.Ceiling(pageNodeSize.Height * plateauScale)) / plateauScale;

				// LsTextLine is not aware of layoutround and uses baseline height to place the rendered text.
				// However, because the height of the *block is potentionally layoutround-ed up, we should adjust the
				// placement of text by the difference.  Horizontal adjustment is not of concern since
				// LsTextLine uses arranged size which is already layoutround-ed.
				//_layoutRoundingHeightAdjustment = desiredSize.Height - pageNodeSize.Height;
			}

			return desiredSize;
		}

		private UnicodeText ParseText(Size availableSizeWithoutPadding, out Size size) =>
			new UnicodeText(
				availableSizeWithoutPadding,
				Inlines.TraversedTree.leafTree,
				GetDefaultFontDetails(),
				MaxLines,
				(float)LineHeight,
				LineStackingStrategy,
				FlowDirection,
				(OwningTextBox as IDependencyObjectStoreProvider)?.Store
					.GetCurrentHighestValuePrecedence(TextBox.TextAlignmentProperty) is DependencyPropertyValuePrecedences.DefaultValue