private void OnLButtonDown() { movingFilter = null; connectingPin = null; Filter filter = graph.FilterInPoint(mousepos); if (filter != null) { Pin pin = filter.PinInPoint(mousepos); if (pin != null && pin.Connection == null) //pin clicked { movingStart = mousepos; connectingPin = pin; } else { //filter clicked movingStart = mousepos; movingFilter = filter; movingFilter.movingStartCoords = movingFilter.Coords; graph.PlaceFilter(movingFilter, false); //clear if (ModifierKeys != Keys.Shift) { graph.ClearFiltersSelection(); Program.mainform.propform.SetObject(movingFilter.filterProps); } graph.SelectFilter(movingFilter, true); Invalidate(); } } else //no filter clicked { int con_id = HoveredConnectionID();// graph.ownersmap[mousepos.X / graph.cellsize, mousepos.Y / graph.cellsize]; graph.ClearFiltersSelection(); if (con_id > 0) graph.SelectConnection(con_id); else //click on empty place { movingStart = mousepos; selecting = true; } Invalidate(); } }