void SetSamplePoint(Gdk.Point p) { region.X = p.X; region.Y = p.Y; region.Width = 2 * radius; region.Height = 2 * radius; if (view.Pixbuf != null) { region.Offset(-Math.Min(region.X, Math.Max(region.Right - view.Pixbuf.Width, radius)), -Math.Min(region.Y, Math.Max(region.Bottom - view.Pixbuf.Height, radius))); region.Intersect(new Gdk.Rectangle(0, 0, view.Pixbuf.Width, view.Pixbuf.Height)); } UpdateSample(); }