]> O.S.I.I.S - jp/crow.git/commitdiff
code clean
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Thu, 15 Feb 2018 17:55:30 +0000 (18:55 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Thu, 15 Feb 2018 17:55:30 +0000 (18:55 +0100)
src/GraphicObjects/GraphicObject.cs
src/GraphicObjects/Popper.cs
src/GraphicObjects/Scroller.cs

index ad9392b0cf410b97133eb7df943246e19ec66172..dd7efbe25526106a099fef00742acaccb98e31fe 100644 (file)
@@ -1516,42 +1516,15 @@ namespace Crow
                public virtual bool PointIsIn(ref Point m)
                {                       
                        if (!(Visible & isEnabled)||IsDragged)
-                               return false;                           
-                       ILayoutable tmp = Parent;
-                       //while (tmp != null){
+                               return false;
                        if (!parent.PointIsIn(ref m))
                                return false;
                        m -= (parent.getSlot().Position + parent.ClientRectangle.Position) ;
-
                        return Slot.ContainsOrIsEqual (m);                                      
                }
                public virtual bool MouseIsIn(Point m)
-               {
-                       Point p = m;
-                       return PointIsIn (ref m);
-//                     try {
-//                             if (!(Visible & isEnabled)||IsDragged)
-//                                     return false;                           
-//                             ILayoutable tmp = Parent;
-//                             //while (tmp != null){
-//                             if (!parent.MouseIsIn(m))
-//                                     return false;
-//                             m -= (parent.getSlot().Position + parent.ClientRectangle.Position) ;
-//
-//                             return slot.ContainsOrIsEqual (m);
-////                                   Scroller scr = tmp as Scroller;                                         
-////                                   if (scr != null) {
-////                                           m.Y += scr.ScrollY;
-////                                           m.X += scr.ScrollX;
-////                                   }                                       
-////                                   tmp = tmp.Parent;
-//                             //}
-//
-//                             //}
-//                     } catch (Exception ex) {
-//                             return false;
-//                     }
-                       //return false;
+               {                       
+                       return (!(Visible & isEnabled)||IsDragged) ? false : PointIsIn (ref m);
                }
                public virtual void checkHoverWidget(MouseMoveEventArgs e)
                {
index be4a19b88c6a4865cbb6078c071cbdc8880ef3e7..ea7b635a967efab2eb94c0a78705bad406a2b35c 100644 (file)
@@ -192,20 +192,12 @@ namespace Crow
                        base.onMouseLeave (this, e);
                        IsPopped = false;
                }
-//             public override bool PointIsIn (ref Point m)
-//             {
-//                     if (!base.PointIsIn (ref m))
-//                             return false;
-//                     
-//             }
                public override bool MouseIsIn (Point m)
-               {
-                       bool isInContent = false;
-                       if (Content != null) {
-                               if (Content.Parent != null)
-                                       isInContent = Content.MouseIsIn (m);
-                       }
-                       return base.MouseIsIn (m) || isInContent;
+               {                       
+                       if (Content?.Parent != null)
+                               if (Content.MouseIsIn (m))
+                                       return true;
+                       return base.MouseIsIn (m);
                }
                public override void checkHoverWidget (MouseMoveEventArgs e)
                {
index a4e1b8164380467540da080c0919a68eb0281548..397d7de03a9d27d9e20d9ada30fdb8c6deb9afed 100644 (file)
@@ -223,20 +223,8 @@ namespace Crow
 
                public override bool PointIsIn (ref Point m)
                {
-//                     if (!(Visible & IsEnabled)||IsDragged)
-//                             return false;                           
-//                     ILayoutable tmp = Parent;
-//                     //while (tmp != null){
-//                     if (!Parent.PointIsIn(ref m))
-//                             return false;
-//                     m -= (Parent.getSlot().Position + Parent.ClientRectangle.Position);
-//                     if (!Slot.ContainsOrIsEqual (m) || child==null)
-//                             return false;
-//                     m += new Point (ScrollX, ScrollY);
-//                     return true;
                        if (!base.PointIsIn(ref m))
                                return false;
-                       //m -= (Parent.getSlot().Position + Parent.ClientRectangle.Position);
                        if (!Slot.ContainsOrIsEqual (m) || child==null)
                                return false;
                        m += new Point (ScrollX, ScrollY);