public DragRectangleInputLock(IUndoRedoService undoRedo, IRectangleComponent nodeRectAspect, IPlacementSurface space, Vector2 anchorPointOnRect)
 {
     this.undoRedo          = undoRedo;
     this.nodeRectAspect    = nodeRectAspect;
     this.space             = space;
     this.anchorPointOnRect = anchorPointOnRect;
     originalRect           = nodeRectAspect.Rectangle;
 }
 public ResizeRectangleInputLock(IRectangleComponent nodeRectAspect, IUndoRedoService undoRedo, IPlacementSurface space, ResizeRectangleGizmoPlace place)
 {
     this.nodeRectAspect = nodeRectAspect;
     this.undoRedo       = undoRedo;
     this.space          = space;
     this.place          = place;
     originalRect        = nodeRectAspect.Rectangle;
 }
Exemple #3
0
 public DrawBorderCurveTool(ISceneNode entity, IUndoRedoService undoRedo)
 {
     this.undoRedo   = undoRedo;
     this.entity     = entity;
     richTextAspect  = entity.GetComponent <IRichTextComponent>();
     rectangleAspect = entity.GetComponent <IRectangleComponent>();
     richTextAspect.BorderComplete    = false;
     richTextAspect.VisualBorderCurve = new List <Vector2>();
     curve = richTextAspect.VisualBorderCurve;
     state = State.Ready;
 }
        public AddRectangleTool(IToolService toolService, IUndoRedoService undoRedo,
                                ICommonNodeFactory commonNodeFactory, IAmDiBasedObjectFactory objectFactory, IImage image, IMovie movie, bool text)
        {
            this.toolService = toolService;
            this.undoRedo    = undoRedo;
            if (text)
            {
                entity = commonNodeFactory.RichTextRectangle(objectFactory.Create <RichText>());
            }
            else if (movie != null)
            {
                entity = commonNodeFactory.MovieRectangleNode(movie);
            }
            else if (image != null)
            {
                entity = commonNodeFactory.ImageRectangleNode(image);
            }
            else
            {
                entity = commonNodeFactory.ColorRectangleNode(GetRandomSaturatedColor());
            }
            rectangleComponent = entity.GetComponent <IRectangleComponent>();

            if (movie != null)
            {
                aspectRatio         = (float)movie.Width / Math.Max(movie.Height, 1);
                preserveAspectRatio = true;
            }
            else if (image != null)
            {
                aspectRatio         = (float)image.Size.Width / Math.Max(image.Size.Height, 1);
                preserveAspectRatio = true;
            }

            state = State.Ready;
        }