Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 7069

How to tweak drag selection behavior to require overlap with main part?

$
0
0

@cfarmerga wrote:

Here's a fiddle that shows more or less what I'm trying to accomplish: https://jsfiddle.net/cfarmerga/65sapt4b/2/

I have a panel with three objects laid out vertically. The middle objects (the green rectangles) are the primary objects, and so I want the user to have to click on these to select them. I don't want clicks on the text blocks to cause selection of the parts. Setting pickable to false for the text blocks seems to address that issue well.

My problem now is that I want the drag selection tool to select my nodes with the same rules. I want to allow partial inclusion, but only for the green rectangles. I don't want the text blocks to be considered at all in the drag selection behavior. If the drag box encompasses any part of a green box, then I want to select that node. If the box touches any text blocks, I don't care about those.

In the current fiddle, when I drag the selection box as shown in the screenshot, I see both nodes Two and Three get selected, but I really want only node Three to become selected.

How can I ignore certain graphobjects in my panels in the drag selection behavior?

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles