Esempio n. 1
0
 public override void OnMouseLeftUp(Point location)
 {
     if (moving)
     {
         resizeAction = null;
         moving = false;
     }
 }
Esempio n. 2
0
        public override void OnMouseMove(Point location)
        {
            if (moving)
            {
                Point move = new Point(location.X - mouseStart.X, location.Y - mouseStart.Y);
                if (!Util.Ctrl)
                    move = LayerEditor.Layer.Definition.SnapToGrid(move);

                move = new Point(move.X - moved.X, move.Y - moved.Y);
                if (move.X != 0 || move.Y != 0)
                {
                    if (resizeAction == null)
                        LevelEditor.Perform(resizeAction = new EntityResizeAction(LayerEditor.Layer, Ogmo.EntitySelectionWindow.Selected, new Size(move.X, move.Y)));
                    else
                        resizeAction.DoAgain(new Size(move.X, move.Y));

                    moved = new Point(move.X + moved.X, move.Y + moved.Y);
                    Ogmo.EntitySelectionWindow.RefreshContents();
                }
            }
        }