Example #1
0
            protected override void Render(GH_Canvas canvas, Graphics graphics, GH_CanvasChannel channel)
            {
                this.Bounds = baseRect;

                base.Render(canvas, graphics, channel);

                if (channel == GH_CanvasChannel.First && Owner.showGraphics != null)
                {
                    if (Owner.showGraphics.OnPingDocument() == Owner.OnPingDocument())
                    {
                        RenderCanvas.HighLightCom(graphics, Owner.showGraphics, 2);
                    }
                }


                if (channel == GH_CanvasChannel.Objects && Frame.Component != null && Owner.Params.Input[0].SourceCount > 0)
                {
                    finalDict = new List <RectangleF>();

                    if (Owner.GetValue("ShowGraphOnThis", @default: true) && Frame.Component.ShowGraphOnEvent)
                    {
                        float X = Owner.Attributes.Bounds.X + Owner.Attributes.Bounds.Width / 2 - Frame.Component.SliderWidth / 2 + 10;
                        float Y = Owner.Attributes.Bounds.Y - 20;

                        RenderCanvas.DrawGraph(graphics, Owner.keyPoints, X, Y, Owner.GraphHeight, Owner.eventThing, out finalDict, out maxRect);


                        PointF txtLoc = new PointF(X, Y - Owner.GraphHeight - 25);
                        graphics.DrawString(Owner.NickName, GH_FontServer.NewFont(GH_FontServer.Script, 9, FontStyle.Bold), new SolidBrush(ShareData.ThemeColor), txtLoc);
                    }
                    else
                    {
                        PointF txtLoc = new PointF(Owner.Attributes.Bounds.X, Owner.Attributes.Bounds.Y - 15);
                        graphics.DrawString(Owner.NickName, GH_FontServer.NewFont(GH_FontServer.Script, 9, FontStyle.Bold), new SolidBrush(ShareData.ThemeColor), txtLoc);
                    }
                }
                if (maxRect != new RectangleF())
                {
                    thisRect = RectangleF.Union(baseRect, maxRect);
                }
                else
                {
                    thisRect = baseRect;
                }
                this.Bounds = thisRect;
            }