[Libreoffice-commits] core.git: starmath/source

Takeshi Abe tabe at fixedpoint.jp
Wed Nov 16 12:55:46 UTC 2016


 starmath/source/ElementsDockingWindow.cxx |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 5c49c13b7b963b8e05d68f6a050c8f8184b825fd
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Wed Nov 16 17:16:48 2016 +0900

    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 at fixedpoint.jp>
    Tested-by: Takeshi Abe <tabe at fixedpoint.jp>

diff --git a/starmath/source/ElementsDockingWindow.cxx b/starmath/source/ElementsDockingWindow.cxx
index 6e54eff..d3e5958 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;
                 }
             }
         }


More information about the Libreoffice-commits mailing list