summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
Diffstat (limited to 'starmath')
-rw-r--r--starmath/source/ElementsDockingWindow.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/starmath/source/ElementsDockingWindow.cxx b/starmath/source/ElementsDockingWindow.cxx
index 6e54effa832b..d3e59583a19c 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -441,7 +441,14 @@ void SmElementsControl::RequestHelp(const HelpEvent& rHEvt)
void SmElementsControl::MouseMove( const MouseEvent& rMouseEvent )
{
+ SmElement* pPrevElement = mpCurrentElement;
mpCurrentElement = nullptr;
+ if (rMouseEvent.IsLeaveWindow())
+ {
+ LayoutOrPaintContents();
+ Invalidate();
+ return;
+ }
if (Rectangle(Point(0, 0), GetOutputSizePixel()).IsInside(rMouseEvent.GetPosPixel()))
{
for (std::unique_ptr<SmElement> & i : maElementList)
@@ -450,11 +457,12 @@ void SmElementsControl::MouseMove( const MouseEvent& rMouseEvent )
Rectangle rect(element->mBoxLocation, element->mBoxSize);
if (rect.IsInside(rMouseEvent.GetPosPixel()))
{
- if (mpCurrentElement != element)
+ if (pPrevElement != element)
{
mpCurrentElement = element;
LayoutOrPaintContents();
Invalidate();
+ return;
}
}
}