Skip to content

Commit

Permalink
Fixed multiselect box visual bug
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlesGameDev committed Apr 11, 2024
1 parent cfcfaa3 commit f67dcfd
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion Fushigi/ui/widgets/LevelViewport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1430,7 +1430,21 @@ Vector2[] GetPoints()
}

if (mMultiSelecting && mMultiSelectStartPos != null && mMultiSelectCurrentPos != null)
mDrawList.AddRect(mMultiSelectStartPos.Value, mMultiSelectCurrentPos.Value, MultiSelectBoxColor, 2f, ImDrawFlags.RoundCornersAll, MultiSelectBoxThickness);
{
Vector2 pMin = mMultiSelectStartPos.Value;
Vector2 pMax = mMultiSelectCurrentPos.Value;
if (mMultiSelectCurrentPos.Value.X < mMultiSelectStartPos.Value.X)
{
pMax.X = mMultiSelectStartPos.Value.X;
pMin.X = mMultiSelectCurrentPos.Value.X;
}
if (mMultiSelectCurrentPos.Value.Y < mMultiSelectStartPos.Value.Y)
{
pMax.Y = mMultiSelectStartPos.Value.Y;
pMin.Y = mMultiSelectCurrentPos.Value.Y;
}
mDrawList.AddRect(pMin, pMax, MultiSelectBoxColor, 2f, ImDrawFlags.RoundCornersAll, MultiSelectBoxThickness);
}

mHoveredObject = newHoveredObject;
}
Expand Down

0 comments on commit f67dcfd

Please sign in to comment.