menpo / landmarker.io

Image and mesh annotation web application
https://www.landmarker.io
BSD 3-Clause "New" or "Revised" License
114 stars 21 forks source link

(WIP) Advanced selection box #133

Closed gabrielcowley closed 7 years ago

gabrielcowley commented 7 years ago

_This PR has a staging branch, which means a production build of this branch exists and can be launched. Click here to preview this PR._

This feature involves a persistent selection box which appears whenever more than one landmark is selected.

The selection box allows the user to click and drag inside it in order to translate all selected landmarks. Clicking any landmarks inside the box results in the default behaviour, however.

The selection box has 'handles' in each corner which can be used to scale the selected landmark positions. It also has a circular 'handle' which can be used to rotate selected landmarks around the centre of the selection box.

There are currently problems with the current selection box implementation. Dragging a scaling handle off the mesh and further can cause the selection box to visibly flicker. Also, the selection box persists even when the selected landmarks are occluded by the mesh. If you transform these selected, occluded landmarks in any way, they will 'teleport' to the near side of the mesh.

patricksnape commented 7 years ago

Looks really good - confirmed to work for me on OSX in Chrome. 😄

gabrielcowley commented 7 years ago

@jabooth I've added the one-pixel padding to all selection box handles.

jabooth commented 7 years ago

@gabrielcowley great! Feels much less finicky. Could we have the same on the rotation handle? Then LGTM.

gabrielcowley commented 7 years ago

@jabooth I added the padding to the rotation handle as well. See line 232 in mouse.ts.

jabooth commented 7 years ago

Ah so you did, apologies. it still feels a little too easy to miss this handle though, perhaps feels different due to the circular hit test rather than the box one.

I've suggested a little refinement above to clean up the intersection testing a little, and have a more generous (2px) padding for the rotation handle. Agree?

gabrielcowley commented 7 years ago

Agreed - changes have been made.