mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-03 02:36:50 +13:00
fixed #7422: Fixed image editor toolbar position
This commit is contained in:
parent
c442fad787
commit
f04cf8ae6a
1 changed files with 31 additions and 28 deletions
|
@ -1310,42 +1310,45 @@ internal void UpdateMenuMaxWidth(int width)
|
|||
|
||||
private void CheckMenuPosition()
|
||||
{
|
||||
Rectangle rectMenu = menuForm.Bounds;
|
||||
Rectangle rectScreen = CaptureHelpers.GetScreenBounds();
|
||||
Point pos = rectMenu.Location;
|
||||
|
||||
if (rectMenu.Width < rectScreen.Width)
|
||||
if (!Form.IsEditorMode)
|
||||
{
|
||||
if (rectMenu.X < rectScreen.X)
|
||||
{
|
||||
pos.X = rectScreen.X;
|
||||
}
|
||||
else if (rectMenu.Right > rectScreen.Right)
|
||||
{
|
||||
pos.X = rectScreen.Right - rectMenu.Width;
|
||||
}
|
||||
}
|
||||
Rectangle rectMenu = menuForm.Bounds;
|
||||
Rectangle rectScreen = CaptureHelpers.GetScreenBounds();
|
||||
Point pos = rectMenu.Location;
|
||||
|
||||
if (rectMenu.Height < rectScreen.Height)
|
||||
{
|
||||
if (rectMenu.Y < rectScreen.Y)
|
||||
if (rectMenu.Width < rectScreen.Width)
|
||||
{
|
||||
pos.Y = rectScreen.Y;
|
||||
if (rectMenu.X < rectScreen.X)
|
||||
{
|
||||
pos.X = rectScreen.X;
|
||||
}
|
||||
else if (rectMenu.Right > rectScreen.Right)
|
||||
{
|
||||
pos.X = rectScreen.Right - rectMenu.Width;
|
||||
}
|
||||
}
|
||||
else if (rectMenu.Bottom > rectScreen.Bottom)
|
||||
|
||||
if (rectMenu.Height < rectScreen.Height)
|
||||
{
|
||||
pos.Y = rectScreen.Bottom - rectMenu.Height;
|
||||
if (rectMenu.Y < rectScreen.Y)
|
||||
{
|
||||
pos.Y = rectScreen.Y;
|
||||
}
|
||||
else if (rectMenu.Bottom > rectScreen.Bottom)
|
||||
{
|
||||
pos.Y = rectScreen.Bottom - rectMenu.Height;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (pos != rectMenu.Location)
|
||||
{
|
||||
menuForm.Location = pos;
|
||||
}
|
||||
if (pos != rectMenu.Location)
|
||||
{
|
||||
menuForm.Location = pos;
|
||||
}
|
||||
|
||||
if (!Form.IsEditorMode && Options.RememberMenuState)
|
||||
{
|
||||
Options.MenuPosition = pos;
|
||||
if (Options.RememberMenuState)
|
||||
{
|
||||
Options.MenuPosition = pos;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue