From: Jean-Philippe Bruyère Date: Thu, 15 Feb 2018 17:55:30 +0000 (+0100) Subject: code clean X-Git-Tag: 0.7.0~18 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=e71e23b46e138a5bcd0bbb8f246a910e03893c8e;p=jp%2Fcrow.git code clean --- diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs index ad9392b0..dd7efbe2 100644 --- a/src/GraphicObjects/GraphicObject.cs +++ b/src/GraphicObjects/GraphicObject.cs @@ -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) { diff --git a/src/GraphicObjects/Popper.cs b/src/GraphicObjects/Popper.cs index be4a19b8..ea7b635a 100644 --- a/src/GraphicObjects/Popper.cs +++ b/src/GraphicObjects/Popper.cs @@ -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) { diff --git a/src/GraphicObjects/Scroller.cs b/src/GraphicObjects/Scroller.cs index a4e1b816..397d7de0 100644 --- a/src/GraphicObjects/Scroller.cs +++ b/src/GraphicObjects/Scroller.cs @@ -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);