private void HandleDrawingMotionNotifyEvent(object o, Gtk.MotionNotifyEventArgs args)
{
int x, y;
Gdk.ModifierType mask;
drawing.GdkWindow.GetPointer (out x, out y, out mask);
if (x < 0 || x >= size || y < 0 || y >=size)
return;
if (args.Event.State == Gdk.ModifierType.Button1Mask) {
// first and last control point cannot be removed
if (last_cpx != 0 && last_cpx != size - 1) {
foreach (var controlPoints in GetActiveControlPoints ()) {
if (controlPoints.ContainsKey (last_cpx))
controlPoints.Remove (last_cpx);
}
}
AddControlPoint (x, y);
}
InvalidateDrawing ();
}