Closed YuuukiA closed 3 weeks ago
I have avoided it by modifying BorderForMouseOver.cs
as the following.
public class BorderForMouseOver : AdornerProvider
{
readonly AdornerPanel adornerPanel;
private readonly Border _border = new Border();
public BorderForMouseOver()
{
adornerPanel = new AdornerPanel();
adornerPanel.Order = AdornerOrder.Background;
this.Adorners.Add(adornerPanel);
_border.BorderThickness = new Thickness(1);
_border.BorderBrush = Brushes.DodgerBlue;
_border.Margin = new Thickness(-2);
AdornerPanel.SetPlacement(_border, AdornerPlacement.FillContent);
adornerPanel.Children.Add(_border);
}
protected override void OnInitialized()
{
base.OnInitialized();
if (ExtendedItem.Component is Line line)
{
// To display border of Line in correct position.
_border.Margin = new Thickness
{
Left = line.X2 < 0 ? line.X2 : 0,
Top = line.Y2 < 0 ? line.Y2 : 0
};
}
}
}
Could you create a pull req?
For Line control, BorderForMouseOver is not displayed at correct position. Would you please tell me how to fix it?
When I draw Line control from the top left to the bottom right, the border is displayed at correct position.
When I draw Line control from the top right to the bottom left, the border is not displayed at correct position.