示例#1
0
        void DrawMeasure(DirectX.DirectXCanvas canvas)
        {
            if (Input.MeasureInterval.Start != Input.MeasureInterval.Finish)
            {
                Durable  activeInterval = Input.MeasureInterval.Normalize();
                Interval pixelInterval  = scroll.TimeToPixel(activeInterval);
                MeasureMesh.AddRect(new Rect(pixelInterval.Left, 0, pixelInterval.Width, scroll.Height), MeasureBackground);
                canvas.Text.Draw(new Point(pixelInterval.Left, scroll.Height * 0.5), activeInterval.DurationF3, Colors.White, TextAlignment.Center, pixelInterval.Width);

                MeasureMesh.Update(canvas.RenderDevice);
                canvas.Draw(MeasureMesh);
            }
        }
示例#2
0
        void DrawHover(DirectXCanvas canvas)
        {
            if (!String.IsNullOrWhiteSpace(ToolTip.Text))
            {
                Size size = surface.Text.Measure(ToolTip.Text);

                Rect textArea = new Rect(Input.MousePosition.X - size.Width * 0.5 + ToolTipOffset.X, ToolTip.Rect.Top - size.Height + ToolTipOffset.Y, size.Width, size.Height);
                surface.Text.Draw(textArea.TopLeft, ToolTip.Text, Colors.White, TextAlignment.Left);

                textArea.Inflate(ToolTipMargin);
                HoverMesh.AddRect(textArea, HoverBackground);
            }

            if (!ToolTip.Rect.IsEmpty)
            {
                HoverLines.AddRect(ToolTip.Rect, FrameHover.Color);
            }

            HoverLines.Update(canvas.RenderDevice);
            canvas.Draw(HoverLines);

            HoverMesh.Update(canvas.RenderDevice);
            canvas.Draw(HoverMesh);
        }
示例#3
0
        void DrawSelection(DirectX.DirectXCanvas canvas)
        {
            foreach (Selection selection in SelectionList)
            {
                if (selection.Frame != null)
                {
                    ThreadRow row = id2row[selection.Frame.Header.ThreadIndex];

                    Durable  intervalTime = selection.Node == null ? (Durable)selection.Frame.Header : (Durable)selection.Node.Entry;
                    Interval intervalPx   = scroll.TimeToPixel(intervalTime);

                    Rect rect = new Rect(intervalPx.Left, row.Offset + 2.0 * RenderParams.BaseMargin, intervalPx.Width, row.Height - 4.0 * RenderParams.BaseMargin);

                    for (int i = 0; i < SelectionBorderCount; ++i)
                    {
                        rect.Inflate(SelectionBorderStep, SelectionBorderStep);
                        SelectionMesh.AddRect(rect, FrameSelection.Color);
                    }
                }
            }

            SelectionMesh.Update(canvas.RenderDevice);
            canvas.Draw(SelectionMesh);
        }
示例#4
0
 void DrawHover(DirectXCanvas canvas)
 {
     HoverMesh.Update(canvas.RenderDevice);
     canvas.Draw(HoverMesh);
 }