Custom Component Attribute,The Wires is inner the Component

I am using C# to Custom Grasshopper Component Attribute. My Custom Component Attribute is Name as Hu_Attribute and it is inheired from ComponentAttribute Class, In Hu_Attribute, I change the size of Bounds using Code:
Bounds = new RectangleF(Bounds.X, Bounds.Y, Bounds.Width + 10, Bounds.Height);
But When I Applay Hu_Attribute to my Component and Connect the component I find the output Wire Started Point is not in the Output Grid. Is Anyone know what happen it is. Thank you for your advise.

demo

GH calculates the parameter bounds for you, and if you change the capsule bound, you need to update the parameters bounds as well. However, if I remember correctly, you can specify the position of the grips when rendering the GH_Capsule using AddOutputGrip() method.

However, I would traverse all outputs and do the following in the layout method:
RectangleF b = Params[i].Attributes.Bounds;
Params[i].Attributes.Bounds = new RectangleF(b.X, b.Y, b.Width + 10, b.Height);

2 Likes

Thanks @Dani_Abalde, It Work.
Just Using

RectangleF b = Params[i].Attributes.Bounds;
Params[i].Attributes.Bounds = new RectangleF(b.X, b.Y, b.Width + 10, b.Height);

Can Work Well and do not have to using AddOutputGrip() Method.