diff --git a/readme.md b/readme.md
index 6a04c7e31e..19a9a8420d 100644
--- a/readme.md
+++ b/readme.md
@@ -16,7 +16,7 @@ To see the status of some of our features, please see our [Roadmap](https://gith
## 🚀 Getting Started
-The Avalonia [Visual Studio Extension](https://marketplace.visualstudio.com/items?itemName=AvaloniaTeam.AvaloniaforVisualStudio) contains project and control templates that will help you get started, or you can use the .NET Core CLI. For a starer guide see our [documentation](http://avaloniaui.net/docs/quickstart/create-new-project).
+The Avalonia [Visual Studio Extension](https://marketplace.visualstudio.com/items?itemName=AvaloniaTeam.AvaloniaforVisualStudio) contains project and control templates that will help you get started, or you can use the .NET Core CLI. For a starter guide see our [documentation](http://avaloniaui.net/docs/quickstart/create-new-project).
Avalonia is delivered via NuGet package manager. You can find the packages here: https://www.nuget.org/packages/Avalonia/
diff --git a/samples/ControlCatalog/MainView.xaml b/samples/ControlCatalog/MainView.xaml
index d812818ed8..fa4fd7dd07 100644
--- a/samples/ControlCatalog/MainView.xaml
+++ b/samples/ControlCatalog/MainView.xaml
@@ -56,6 +56,7 @@
+
diff --git a/samples/ControlCatalog/Pages/RelativePanelPage.axaml b/samples/ControlCatalog/Pages/RelativePanelPage.axaml
new file mode 100644
index 0000000000..3657d52bd9
--- /dev/null
+++ b/samples/ControlCatalog/Pages/RelativePanelPage.axaml
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/samples/ControlCatalog/Pages/RelativePanelPage.axaml.cs b/samples/ControlCatalog/Pages/RelativePanelPage.axaml.cs
new file mode 100644
index 0000000000..11d0a5152e
--- /dev/null
+++ b/samples/ControlCatalog/Pages/RelativePanelPage.axaml.cs
@@ -0,0 +1,19 @@
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Markup.Xaml;
+
+namespace ControlCatalog.Pages
+{
+ public class RelativePanelPage : UserControl
+ {
+ public RelativePanelPage()
+ {
+ this.InitializeComponent();
+ }
+
+ private void InitializeComponent()
+ {
+ AvaloniaXamlLoader.Load(this);
+ }
+ }
+}
diff --git a/src/Avalonia.Controls/Presenters/TextPresenter.cs b/src/Avalonia.Controls/Presenters/TextPresenter.cs
index 09f86f462c..6e534bbb2a 100644
--- a/src/Avalonia.Controls/Presenters/TextPresenter.cs
+++ b/src/Avalonia.Controls/Presenters/TextPresenter.cs
@@ -273,7 +273,7 @@ namespace Avalonia.Controls.Presenters
return new FormattedText
{
Constraint = constraint,
- Typeface = FontManager.Current?.GetOrAddTypeface(FontFamily, FontWeight, FontStyle),
+ Typeface = FontManager.Current?.GetOrAddTypeface(FontFamily, FontStyle, FontWeight),
FontSize = FontSize,
Text = text ?? string.Empty,
TextAlignment = TextAlignment,
@@ -490,7 +490,7 @@ namespace Avalonia.Controls.Presenters
return new FormattedText
{
Text = "X",
- Typeface = FontManager.Current?.GetOrAddTypeface(FontFamily, FontWeight, FontStyle),
+ Typeface = FontManager.Current?.GetOrAddTypeface(FontFamily, FontStyle, FontWeight),
FontSize = FontSize,
TextAlignment = TextAlignment,
Constraint = availableSize,
diff --git a/src/Avalonia.Controls/Primitives/AccessText.cs b/src/Avalonia.Controls/Primitives/AccessText.cs
index dd33023e38..89f672deaa 100644
--- a/src/Avalonia.Controls/Primitives/AccessText.cs
+++ b/src/Avalonia.Controls/Primitives/AccessText.cs
@@ -97,9 +97,7 @@ namespace Avalonia.Controls.Primitives
{
var lastLine = TextLayout.TextLines[TextLayout.TextLines.Count - 1];
- var offsetX = lastLine.LineMetrics.BaselineOrigin.X;
-
- var lineX = offsetX + lastLine.LineMetrics.Size.Width;
+ var lineX = lastLine.LineMetrics.Size.Width;
var lineY = Bounds.Height - lastLine.LineMetrics.Size.Height;
@@ -117,7 +115,7 @@ namespace Avalonia.Controls.Primitives
continue;
}
- var currentX = textLine.LineMetrics.BaselineOrigin.X;
+ var currentX = 0.0;
foreach (var textRun in textLine.TextRuns)
{
diff --git a/src/Avalonia.Controls/RelativePanel.AttachedProperties.cs b/src/Avalonia.Controls/RelativePanel.AttachedProperties.cs
new file mode 100644
index 0000000000..f93de5ca15
--- /dev/null
+++ b/src/Avalonia.Controls/RelativePanel.AttachedProperties.cs
@@ -0,0 +1,546 @@
+using Avalonia.Layout;
+
+#nullable enable
+
+namespace Avalonia.Controls
+{
+ public partial class RelativePanel
+ {
+ private static void OnAlignPropertiesChanged(AvaloniaObject d, AvaloniaPropertyChangedEventArgs e)
+ {
+ if (d is Layoutable layoutable && layoutable.Parent is Layoutable layoutableParent)
+ {
+ layoutableParent.InvalidateArrange();
+ }
+ }
+
+ static RelativePanel()
+ {
+ ClipToBoundsProperty.OverrideDefaultValue(true);
+
+ AboveProperty.Changed.AddClassHandler(OnAlignPropertiesChanged);
+ AlignBottomWithPanelProperty.Changed.AddClassHandler(OnAlignPropertiesChanged);
+ AlignBottomWithProperty.Changed.AddClassHandler(OnAlignPropertiesChanged);
+ AlignHorizontalCenterWithPanelProperty.Changed.AddClassHandler(OnAlignPropertiesChanged);
+ AlignHorizontalCenterWithProperty.Changed.AddClassHandler(OnAlignPropertiesChanged);
+ AlignLeftWithPanelProperty.Changed.AddClassHandler(OnAlignPropertiesChanged);
+ AlignLeftWithProperty.Changed.AddClassHandler(OnAlignPropertiesChanged);
+ AlignRightWithPanelProperty.Changed.AddClassHandler(OnAlignPropertiesChanged);
+ AlignRightWithProperty.Changed.AddClassHandler(OnAlignPropertiesChanged);
+ AlignTopWithPanelProperty.Changed.AddClassHandler(OnAlignPropertiesChanged);
+ AlignTopWithProperty.Changed.AddClassHandler(OnAlignPropertiesChanged);
+ AlignVerticalCenterWithPanelProperty.Changed.AddClassHandler(OnAlignPropertiesChanged);
+ AlignVerticalCenterWithProperty.Changed.AddClassHandler(OnAlignPropertiesChanged);
+ BelowProperty.Changed.AddClassHandler(OnAlignPropertiesChanged);
+ LeftOfProperty.Changed.AddClassHandler(OnAlignPropertiesChanged);
+ LeftOfProperty.Changed.AddClassHandler(OnAlignPropertiesChanged);
+ }
+
+ ///
+ /// Gets the value of the RelativePanel.Above XAML attached property for the target element.
+ ///
+ /// The object from which the property value is read.
+ ///
+ /// The RelativePanel.Above XAML attached property value of the specified object.
+ /// (The element to position this element above.)
+ ///
+ [ResolveByName]
+ public static object GetAbove(AvaloniaObject obj)
+ {
+ return (object)obj.GetValue(AboveProperty);
+ }
+
+ ///
+ /// Sets the value of the RelativePanel.Above XAML attached property for a target element.
+ ///
+ /// The object to which the property value is written.
+ /// The value to set. (The element to position this element above.)
+ public static void SetAbove(AvaloniaObject obj, object value)
+ {
+ obj.SetValue(AboveProperty, value);
+ }
+
+
+ ///
+ /// Identifies the XAML attached property.
+ ///
+
+ public static readonly AttachedProperty