Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Commit

Permalink
ensure sibling has boundingrect
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Higgins committed Sep 4, 2020
1 parent 105413f commit 9830a48
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CenterTaskbar/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -439,13 +439,13 @@ private static int SideBoundary(bool left, bool horizontal, AutomationElement el
var prevSibling = TreeWalker.ControlViewWalker.GetPreviousSibling(element);
var nextSibling = TreeWalker.ControlViewWalker.GetNextSibling(element);
var parent = TreeWalker.ControlViewWalker.GetParent(element);
if (left && prevSibling != null)
if (left && prevSibling != null && !prevSibling.Current.BoundingRectangle.IsEmpty)
{
adjustment = horizontal
? prevSibling.Current.BoundingRectangle.Right
: prevSibling.Current.BoundingRectangle.Bottom;
}
else if (!left && nextSibling != null)
else if (!left && nextSibling != null && !nextSibling.Current.BoundingRectangle.IsEmpty)
{
adjustment = horizontal
? nextSibling.Current.BoundingRectangle.Left
Expand Down

0 comments on commit 9830a48

Please sign in to comment.