Пример #1
0
 public void OnMouseDown(Point mousePosition, EditorOperationHitTest hitTest, IEditorOperationalContext context)
 {
     initialMousePosition = mousePosition;
     element = new PositionalComponent(context.PlaceType.Type, context.PlaceType.Configuration, initialMousePosition.ToCdPoint());
     SizeComponent(element, initialMousePosition.ToCdPoint(), initialMousePosition.ToCdPoint(), context.GridSize);
     SetDefaultProperties(element);
     SetConfigurationProperties(element);
     context.AddElement(element);
 }
Пример #2
0
        public bool OnMouseMove(Point mousePosition, EditorOperationHitTest hitTest, IEditorOperationalContext context)
        {
            if (element == null)
            {
                return(false);
            }

            SizeComponent(element, initialMousePosition.ToCdPoint(), mousePosition.ToCdPoint(), context.GridSize);

            context.UpdateElementPosition(element);
            context.ReRenderElement(element);

            return(true);
        }