ToolRubberBanding and diagonal links

Hello,

I’d like to have a GoPickInRectangleStyle for my GoToolRubberBanding that behaves slightly like SelectableOnlyIntersectsBounds, ie that only partially selecting an object should select it.

The main difference is that I don’t care much about the object boundind box, especially in case of links: In the case of a 45° link, it is quite easy to intersect the bounding box without ever knowing it…

Is there any way to make this tool for link use the link stroke (I currently only use straight links) instead of the link bounding box?

Regards,

There’s no easy way to do this.
But you could implement a replacement for GoView.SelectInRectangle to do exactly what you want. You can either override that method on GoView, or you can replace the call to that method in GoToolRubberBanding.DoRubberBand:
public virtual void DoRubberBand(Rectangle box) {
if (!IsBeyondDragSize()) {
DoSelect(this.LastInput);
// whether or not we found and/or selected anything, call DoClick
DoClick(this.LastInput);
} else {
RectangleF docRect = this.View.ConvertViewToDoc(box);
this.View.SelectInRectangle(docRect);
}
}

Thank you. I’ve overridden GoView.SelectInRectangle to do the required calculations (simple to do on our straight links), and it works fine.

I believe this would be a nice feature to have for a future version of GoDiagram…

Best regards,

Hi Gathar,

I'm having a similiar problem with my application. Can you provide a hint as to how you implemented your solution?
Thanks,
Mark