예제 #1
0
        public void MuisDrag(SchetsControl s, Point p)
        {
            int xDiff = huidigPunt.X - p.X;
            int yDiff = huidigPunt.Y - p.Y;

            if (geselecteerdObject is PenObject)
            {
                PenObject po = geselecteerdObject as PenObject;

                Stack <Point> newPunten = new Stack <Point>();
                foreach (Point oldP in po.Punten)
                {
                    newPunten.Push(new Point(oldP.X - xDiff, oldP.Y - yDiff));
                }
                po.Punten = newPunten;
            }
            else if (geselecteerdObject is TweePuntObject)
            {
                TweePuntObject tpo = geselecteerdObject as TweePuntObject;
                tpo.begin = new Point(tpo.begin.X - xDiff, tpo.begin.Y - yDiff);
                tpo.einde = new Point(tpo.einde.X - xDiff, tpo.einde.Y - yDiff);
            }
            else if (geselecteerdObject is TekstObject)
            {
                TekstObject to = geselecteerdObject as TekstObject;
                to.locatie = new Point(to.locatie.X - xDiff, to.locatie.Y - yDiff);
            }
            huidigPunt = p;
            s.Invalidate();
        }
예제 #2
0
        public override void MuisVast(SchetsControl s, Point p)
        {
            base.MuisVast(s, p);
            Stack <Point> st = new Stack <Point>();

            st.Push(p);
            huidigPenObject = new PenObject(s.PenKleur, s.PenDikte, st);
            s.Schets.Historie.Push(huidigPenObject);
        }
예제 #3
0
 public override void Compleet(Graphics g, Point p1, Point p2)
 {
     this.Bezig(g, p1, p2);
     huidigPenObject = null;
 }