Ejemplo n.º 1
0
        /// <summary>
        /// Initialize new instance of displaying engine
        /// </summary>
        /// <param name="output">Output where drawings will be displayed</param>
        internal DisplayEngine(DiagramCanvas output)
        {
            Output = output;

            ContentShiftable.Attach(Output);
            ContentZoomable.Attach(Output);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Get global position computed to local coordinates.
        /// </summary>
        /// <param name="globalPosition">The global position.</param>
        /// <returns>Local position.</returns>
        internal Point AsLocalPosition(Point globalPosition)
        {
            var diff = GlobalPosition - globalPosition;

            var localPos = DiagramCanvas.GetPosition(this);
            localPos.X -= diff.X;
            localPos.Y -= diff.Y;

            return localPos;
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Initialize new instance of <see cref="DrawingProvider"/>
 /// </summary>
 /// <param name="output">Output that is used by current provider</param>
 /// <param name="diagramFactory">Factory that is used for creating diagrams</param>
 public DrawingProvider(DiagramCanvas output, AbstractDiagramFactory diagramFactory)
 {
     Engine          = new DisplayEngine(output);
     _diagramFactory = diagramFactory;
 }