# HG changeset patch # User Ivo Smits # Date 1392559356 -3600 # Node ID 4e4c600031e27f5027375dda560235958c46fbac # Parent 1a10ca0f662e6a373bfc9b349fa59be3120536ad# Parent 8f31b164ce7e6b3e653d819889b703667299a464 Merge FBGUI updates diff -r 1a10ca0f662e -r 4e4c600031e2 FBGUI/FBGUI.cs --- a/FBGUI/FBGUI.cs Sun Feb 16 14:59:52 2014 +0100 +++ b/FBGUI/FBGUI.cs Sun Feb 16 15:02:36 2014 +0100 @@ -581,10 +581,11 @@ public FBGCursor(Image image, Point hotspot) { this.Image = image; this.Hotspot = hotspot; - this.Size = image.Size; + this.Size = image == null ? Size.Empty : image.Size; } public Rectangle Area { get { return new Rectangle(-Hotspot.X, -Hotspot.Y, Size.Width, Size.Height); } } public FBGCursor RotateFlip(RotateFlipType type) { + if (Image == null) return this; Image img = new Bitmap(Image); img.RotateFlip(type); Point hs = Hotspot; @@ -609,6 +610,7 @@ } } + public static readonly FBGCursor None = new FBGCursor(null, Point.Empty); public static readonly FBGCursor Arrow = LoadFromResource("cursor_arrow", 0, 0); public static readonly FBGCursor Move = LoadFromResource("cursor_move", 8, 8); public static readonly FBGCursor SizeLeft = LoadFromResource("cursor_left", 1, 10); @@ -747,7 +749,7 @@ } public virtual new void Paint(Graphics g) { HandleEvent(new FBGPaintEvent(g)); - if (cursor != null) { + if (cursor != null && cursor.Image != null) { Rectangle r = cursor.Area; r.Offset(cursorposition); g.DrawImage(cursor.Image, r);