Skip to content

Commit

Permalink
chore: Adjust comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban authored Oct 9, 2024
1 parent 7e3285f commit adf5b49
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/Uno.UI/UI/Xaml/DependencyObjectStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1331,6 +1331,11 @@ private void CleanupInheritedProperties()
&& property.IsInherited

#if __ANDROID__
// This is a workaround related to property inheritance and
// https://github.com/unoplatform/uno/pull/18261.
// Removing this line can randomly produce elements not rendering
// properly, such as TextBlock not measure/arrange properly
// even when invalidated.
&& _properties.FindPropertyDetails(property) is { }
#endif
)
Expand Down
8 changes: 7 additions & 1 deletion src/Uno.UI/UI/Xaml/ILayouterElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ internal static bool DoMeasure(this ILayouterElement element, Size availableSize
if (isDirty || frameworkElement is null)
{
// We must reset the flag **BEFORE** doing the actual measure, so the elements are able to re-invalidate themselves
// TODO: We are not controlling measure dirty path on Android. If we did in future, we must clear it here as well.
frameworkElement?.ClearLayoutFlags(UIElement.LayoutFlag.MeasureDirty);

// The dirty flag is explicitly set on this element
Expand All @@ -91,7 +92,10 @@ internal static bool DoMeasure(this ILayouterElement element, Size availableSize
LayoutInformation.SetAvailableSize(element, availableSize);
}

return true; // end of isDirty processing
// TODO: This is NOT correct.
// We shouldn't return here. Skipping children measure is incorrect but fixing it on Android isn't trivial.
return true;

}

// The measure dirty flag is set on one of the descendents:
Expand All @@ -110,6 +114,8 @@ internal static bool DoMeasure(this ILayouterElement element, Size availableSize
{
var previousDesiredSize = childAsUIElement.m_desiredSize;
childAsUIElement.EnsureLayoutStorage();

// TODO: This is NOT correct. This should call DoMeasure (the same method we are in currently!)
element.Layouter.MeasureChild(child, childAsUIElement.m_previousAvailableSize);
var newDesiredSize = childAsUIElement.m_desiredSize;
if (newDesiredSize != previousDesiredSize)
Expand Down

0 comments on commit adf5b49

Please sign in to comment.