aboutsummaryrefslogtreecommitdiffstatsci
path: root/src
diff options
context:
space:
mode:
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>2018-02-15 18:55:30 +0100
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>2018-02-15 18:55:30 +0100
commit09b6b33cfd7716e7235a925bff87b6fd0c91f260 (patch)
tree0c8ca455463a92cf7bec94704c973c1974f589d6 /src
parentc1b29a565bdbf37fd88d268588710ce8f4f84d5b (diff)
code clean
Diffstat (limited to 'src')
-rw-r--r--src/GraphicObjects/GraphicObject.cs33
-rw-r--r--src/GraphicObjects/Popper.cs18
-rw-r--r--src/GraphicObjects/Scroller.cs12
3 files changed, 8 insertions, 55 deletions
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);