Adjusting snap-to-grid?


#1

Hi!

How can I achieve the following:

  1. Adjust object resizing to snap to grid. With activated snap-to-grid
    the user should not be allowed to resize to anything other than the
    grid.

  2. Make the grid actually snap to the drawn borders of my node without
    it’s ports. Currently it snaps to the node’s bounding rectangle which
    leads to the visual effect that nodes and grid lines always seem to be
    out of sync (which they are aamof).


#2
  1. Call JGoView.setSnapResize(JGoView.SnapJump)
  2. Override JGoObject.redirectSelection to return the Icon or whatever part of your node that you want the user to resize. But note that your code dealing with the JGoView.getSelection() will now get those Icons (or whatever), rather than the actual whole nodes.