* test(grid): reproduce shared size groups ignoring assigned definitions
Definitions supplied through the ColumnDefinitions or RowDefinitions
setter are already in the collection when the grid claims it, so they
never pass through the collection-changed handler that joins them to the
parent tree. They never register with their shared size group, and the
definitions they replace never unregister from it.
* fix(grid): join assigned definition collections to the parent tree
DefinitionList.SetParent assigned each definition's Parent but never
called OnEnterParentTree, which only ran from the collection-changed
handler. Assigning Parent is not sufficient: OnEnterParentTree also sets
InheritanceParent, and a definition cannot read the inherited
PrivateSharedSizeScope that registers it with its group until that link
exists. Definitions supplied through the ColumnDefinitions setter - an
object initializer, a shared resource, or ColumnDefinitions="Auto,*" -
were therefore silently absent from their shared size group.
Enter and exit the parent tree from SetParent, and release the outgoing
collection when Grid swaps one in. Without that release the replaced
definitions stay registered with the group; nothing resets their measured
minimum any more, so they pin it at whatever they last contributed.
* test(grid): cover the definition ownership contract
Removing a definition leaves it holding its old Parent and its property
inheritance link, so it still reads the grid's shared size scope and can
re-register itself into a scope it has left. Also covers moving a
definition between grids, reassigning the same collection, and row
definitions, which the assignment fix reached but nothing exercised.
* refactor(grid): centralise definition parent-tree transitions
Definition ownership was implemented twice, and the two paths disagreed:
SetParent exited a definition and cleared its Parent, while removing one
from the collection called OnExitParentTree but left Parent set. Detach
was incomplete either way, since OnEnterParentTree establishes
InheritanceParent but OnExitParentTree never cleared it - so a removed
definition kept reading the grid's inherited PrivateSharedSizeScope, and
the grid kept it alive as an inheritance child.
Route every owner change through one transition that exits the old tree,
assigns Parent, and enters the new one, and clear InheritanceParent on
exit so detach mirrors attach.
---------
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* test(grid): reproduce shared size group shrink failure
Shared auto columns expand when grouped content becomes visible but keep the expanded width after that content is hidden. Cover the full zero, expanded, and shrunk layout sequence so the stale shared minimum cannot regress unnoticed.
* fix(grid): allow shared size groups to shrink
Shared auto definitions reused the previous group minimum while recomputing the next group minimum, so an expanded width became self-sustaining after content shrank. Aggregate each definition's intrinsic measured minimum instead, preserving the shared-size invariant and matching the canonical WPF algorithm.
* test(grid): reproduce shared size group stuck on cyclic measure path
A grid mixing an auto-column/star-row cell with a star-column/auto-row
cell measures through Grid's cyclic dependency path, which saves and
restores definition min sizes around the repeated measure. The saved
value is the effective min size, so the group minimum is folded into the
definition's own contribution and the group can never shrink below it.
* fix(grid): restore raw min sizes on the cyclic measure path
Grid.CacheMinSizes read DefinitionBase.MinSize, which already includes
the shared group's minimum, but ApplyCachedMinSizes writes it back
through SetMinSize, which assigns the definition's own _minSize. A
short-pole definition therefore adopted the group minimum as its own
intrinsic minimum, which reclassified it as a long pole on the next
validation. Long poles with a valid measure are never remeasured, so the
fabricated minimum became unreachable and pinned the group open.
Add DefinitionBase.RawMinSize, the read counterpart of SetMinSize, and
cache that instead so the save/restore pair round-trips the definition's
own contribution. Matches the WPF fix in dotnet/wpf#2270.
* Introduce a universal IGlyphTypeface implementation that does not rely on any platform implementation
* Revert changes
* Fix Android
* Make the test happy
* Fix build
* Update baseline
* Fix naming
* Fix headless
* Move interfaces to dedicated files
Make GlyphTypeface.GlyphCount an integer
* Fix GlyphCount
* Make IGlyphTypeface NotClientImplementable
* Make sure we cache platform typefaces by their desired name, style, weight and stretch
* Update baseline
* Only use IGlyphTypeface
* Fix Android
* Try to clear the buffer before we encode somethimg
* Add needed test font
* Add more unit tests
* Reduce allocations
* Remove Direct2D1 test files
* More tests
* More complete table implementations
* More adjustments
* Use batch APIs
* Handle invalid timestamps
* Update baseline
* Introduce a CharacterToGlyphMap struct for faster access
* Remove AggressiveInlining
* Remove AggressiveInlining
* Make the head table optional for legacy fonts
* Remove Load method. Fix TextBlockTests
* Fix nullables
* Remove redundant folder
* Update Api baseline
* revert diff helper changes
* revert changes
* Use bare minimum font for Headless platform and introduce a test font manager that uses the Inter font for testing.
* Add missing font file for Headless platform
---------
Co-authored-by: Gillibald <stebner@avaloniaui.net>
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* Update to xunit.v3
* Little more progress
* More fixes
* Keep VSTest supported
* Adjust Nuke
* Few fixes
* Fix for xunit 2
* Fix GetData override
* Adjust
* Use MTP for xunit 2
* Fix test
* Better fix
* --no-progress
* Few more fixes
* no progress
* Fix test
* Better fix
* TRX
* Move to Directory.Build.props
* Unify on MTP v2
* Update
* Update to stable
* 1.0.1
* 1.0.2
* Fix some warnings
* Fix more warnings
* Fix more warnings
* Add spacing properties
* Add spacing while computing final offsets
* Add spacing while calculating desired size
* Add unit tests
* fix missing spacing arrangement
* draw grid line
* Add property changed handler
* add new unit test
* Resolve star spacing
* fix AffectsMeasure
* overflow unit test
* Clean up
---------
Co-authored-by: Poker <poker_sang@outlook.com>
- animation/layout/render cycle is now managed from a central location
- animations are now throttled if animation/layout/render pass takes longer than a frame which previously caused a soft-freeze with input not being processed
- the public API is trimmed to make sure that we can make other planned changes during the 11.x support cycle
"Changelog":
- IClock is hidden and is planned to be replaced later
- Animator classes are hidden and are planned to be refactored later
- IAnimation members are hidden, it's supposed to be a marker interface for Style.Animations collection now, to start animations manually use Animation.RunAsync
- Sealed several classes in Avalonia.Animation namespace
- Spring class is removed from the public API (it wasn't possible to use it directly in a meaningful way anyway)
- Sealed brushes, transforms, effects and drawings
- Removed separate dispatcher priorities for Layout and Composition, everything now happens from a central place with Render priority (same as WPF)
- - some private "hook" priorities are added for now, those will be removed later
- IRenderLoop is hidden and removed from locator
- IRenderer is hidden (the plan is to remove that concept later)
- - Renderer.Start/Stop exposed as StartRendering/StopRendering on the toplevel (will be on a CompositionTarget/PresentationSource-like type later)
- - Renderer.Diagnistics exposed as RendererDiagnostics (same)
- - Renderer is no longer created by the platform code and is created by TopLevel itself
- - From the user-code hit-testing should be done by VisualExtensions.GetVisual(s)At, which has the same features
- - For unit tests a separate IHitTester interface is added which can be changed for a particular toplevel
- ILayoutManager is hidden
- - LayoutManager.ExecuteLayoutPass() exposed as TopLevel.UpdateLayout()
- Custom animators now have a separate base class that only deals with interpolation
Minor improvements:
- Compositor has a mode that doesn't use DispatcherTimers, useful for unit tests
- Introduced ScopedTestBase that auto-resets the locator when test is finished