private void panel1_MouseUp(object sender, MouseEventArgs e)
 {
     if (dragshape != null)
     {
         dragshape = null;
     }
 }
        private void panel1_MouseClick(object sender, MouseEventArgs e)
        {
            drawable near    = null;
            double   mindist = double.MaxValue;

            foreach (var item in shapes)
            {
                item.isselect = false;
                var dist = item.distanceto(e.X, e.Y);
                if (dist < mindist)
                {
                    near    = item;
                    mindist = dist;
                }
            }
            near.isselect = true;
            propertyGrid1.SelectedObject = near;

            Refresh();
        }
        private void button6_MouseDown(object sender, MouseEventArgs e)
        {
            drawable near = null;

            double mindist = double.MaxValue;

            foreach (var item in shapes)
            {
                var dist = item.distanceto(e.X, e.Y);
                if (dist < mindist)
                {
                    near    = item;
                    mindist = dist;
                }
            }
            if (near != null)
            {
                dragshape  = near;
                xshapedrag = dragshape.x;
                yshapedrag = dragshape.y;
                xmousedrag = e.X;
                ymousedrag = e.Y;
            }
        }
Beispiel #4
0
 ? new ImageSourceServiceResult(drawable, dispose)
 : default;