Esempio n. 1
0
        private void Canvas_OnDraw(DXCanvas canvas, DXCanvas.Layer layer)
        {
            Vector scale      = new Vector(1.0 / Scroll.Area.Width, 1.0 / Scroll.Area.Height);
            Matrix cameraView = new Matrix(scale.X, 0, 0, scale.Y, -scale.X * Scroll.Area.Location.X, -scale.Y * Scroll.Area.Location.Y);

            canvas.CameraView = cameraView;

            Scroll.Size = new Size(canvas.RenderCanvas.ClientSize.Width / RenderSettings.DpiScale.X, canvas.RenderCanvas.ClientSize.Height / RenderSettings.DpiScale.Y);

            OnDraw?.Invoke(canvas, layer, Scroll);
        }
Esempio n. 2
0
 private void Surface_OnDraw(DXCanvas canvas, DXCanvas.Layer layer, ZoomCanvas.ZoomScroll scroll)
 {
     switch (layer)
     {
     case DXCanvas.Layer.Normal:
         foreach (Track track in Tracks)
         {
             track.Draw(canvas, layer, Board, scroll);
         }
         break;
     }
 }
Esempio n. 3
0
            public override void Draw(DXCanvas canvas, DXCanvas.Layer layer, IBoard board, ZoomCanvas.ZoomScroll scroll, Vector offset)
            {
                canvas.Draw(Mesh);
                canvas.Draw(Lines);

                Segment unitBox = NormalizeTime(DataContext, board);

                double unitThreashold = scroll.ToUnitLength(TextDrawLimit);

                foreach (TextEntry block in TextBlocks)
                {
                    double blockWidth = scroll.ToPixelLength(unitBox.Length * block.Width);

                    if (blockWidth < TextDrawLimit)
                    {
                        break;
                    }

                    Point pixelPos = new Point(scroll.ToPixel(unitBox.Start + unitBox.Length * block.Position.X) + TextOffset, offset.Y + block.Position.Y * MaxHeight);
                    canvas.Text.Draw(pixelPos, block.Text, Colors.Black, TextAlignment.Left, blockWidth);
                }
            }
Esempio n. 4
0
 internal void Draw(DXCanvas canvas, DXCanvas.Layer layer, IBoard board, ZoomCanvas.ZoomScroll scroll)
 {
     Children.ForEach(item => item.Draw(canvas, layer, board, scroll, Offset));
 }
Esempio n. 5
0
 public override void Draw(DXCanvas canvas, DXCanvas.Layer layer, IBoard board, ZoomCanvas.ZoomScroll scroll, Vector offset)
 {
     canvas.Draw(Mesh);
     canvas.Draw(Lines);
 }
Esempio n. 6
0
 public abstract void Draw(DXCanvas canvas, DXCanvas.Layer layer, IBoard board, ZoomCanvas.ZoomScroll scroll, Vector offset);