diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2015-03-30 12:48:56 +0200 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2015-03-30 12:48:56 +0200 |
| commit | 30baf7a73449a5a0b5c6ea7f3952d4d614ec741f (patch) | |
| tree | 65f8c22ad3d6c65fac0e657754b4870fcbfa29bc /src/GraphicObjects/GraphicObject.cs | |
| parent | 4338402e29d2c448c24f4efe6a788adb84f81785 (diff) | |
- svg image support
- bug fixes
Diffstat (limited to 'src/GraphicObjects/GraphicObject.cs')
| -rwxr-xr-x | src/GraphicObjects/GraphicObject.cs | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs index ec3b7fef..935729f2 100755 --- a/src/GraphicObjects/GraphicObject.cs +++ b/src/GraphicObjects/GraphicObject.cs @@ -114,7 +114,9 @@ namespace go return cb;
}
}
-
+ [XmlIgnore]public virtual OpenTKGameWindow TopContainer {
+ get { return Parent.TopContainer; }
+ }
public virtual void InvalidateLayout ()
{
bmp = null;
@@ -134,6 +136,10 @@ namespace go {
return Slot;
}
+ public virtual Rectangle getBounds()
+ {
+ return Bounds;
+ }
#endregion
#region EVENT HANDLERS
@@ -279,8 +285,15 @@ namespace go return;
_isVisible = value;
- if (Parent != null)
- Parent.InvalidateLayout ();
+
+ //add slot to clipping to redraw
+ OpenTKGameWindow.gobjsToRedraw.Add (this);
+
+ //ensure main win doesn't keep hidden childrens ref
+ if (this.Contains (OpenTKGameWindow.currentWindow.hoverWidget))
+ OpenTKGameWindow.currentWindow.hoverWidget = null;
+// if (Parent != null)
+// Parent.InvalidateLayout ();
//else
// registerForRedraw();
}
@@ -347,6 +360,9 @@ namespace go public virtual GraphicObject FindByName(string nameToFind){
return nameToFind == _name ? this : null;
}
+ public virtual bool Contains(GraphicObject goToFind){
+ return false;
+ }
/// <summary>
@@ -429,7 +445,7 @@ namespace go Slot.X = Parent.ClientRectangle.Width / 2 - Slot.Width / 2;
break;
}
- } else
+ } else// if (Parent.getBounds().Width>=0)
xIsValid = false;
}
@@ -451,7 +467,7 @@ namespace go Slot.Y = Parent.ClientRectangle.Height / 2 - Slot.Height / 2;
break;
}
- } else
+ } else// if (Parent.getBounds().Height>=0)
yIsValid = false;
}
}
|