Advertisement
Guest User

Untitled

a guest
May 22nd, 2012
67
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         void i_rendered_Paint(object sender, PaintEventArgs e)
  2.         {
  3.             System.Diagnostics.Debug.WriteLine("Derp");
  4.             using (Graphics g = e.Graphics)
  5.             {
  6.                 if (!_drag_isDragging)
  7.                     return;
  8.                 System.Diagnostics.Debug.WriteLine("UpdateView");
  9.                 int px = (_drag_start.X > _drag_current.X) ? _drag_current.X : _drag_start.X;
  10.                 int py = (_drag_start.Y > _drag_current.Y) ? _drag_current.Y : _drag_start.Y;
  11.                 if (px < 0)
  12.                     px = 0;
  13.                 if (py < 0)
  14.                     py = 0;
  15.                 int wx = Math.Abs(_drag_current.X - _drag_start.X);
  16.                 int wy = Math.Abs(_drag_current.Y - _drag_start.Y);
  17.                 g.DrawRectangle(Pens.LightBlue, px, py, wx, wy);
  18.             }
  19.         }
Advertisement
RAW Paste Data Copied
Advertisement