summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2016-11-16 17:16:48 +0900
committerTakeshi Abe <tabe@fixedpoint.jp>2016-11-16 12:55:05 +0000
commit5c49c13b7b963b8e05d68f6a050c8f8184b825fd (patch)
tree33f8ab2a017a6c34ea1752c170ea5112aa0e7000 /starmath
parent6e3ff896e7422b4a438cbe5c1c9d97027c468c5c (diff)
tdf#101472 Prompt repaint of Elements window when mouse leaves
This also reduces some cycles in SmElementsControl::MouseMove(). Change-Id: I1dd5f9cd37e4a78010ebb719b4726f9b061d8ff2 Reviewed-on: https://gerrit.libreoffice.org/30897 Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp> Tested-by: Takeshi Abe <tabe@fixedpoint.jp>
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;
}
}
}