Improved magnets for nodes

- finding the correct magnet depending on angle of approach.
- fixed order of handling mouse presses. First are items that can
clicked (buttons), second draggables and third selectables (nodes and
edges).