Code covered by the BSD License  

Highlights from
draggableRect

Be the first to rate this file! 9 Downloads (last 30 days) File Size: 5.56 KB File ID: #35895
image thumbnail

draggableRect

by

 

Create a draggable rectangle in normalized units.

| Watch this File

File Information
Description

Like MATLAB's dragrect function, this function allows you to interactively define a draggable rectangle. However, UNLIKE MATLAB's function, this version works in normalized units, and it includes SNAP-TO behavior to constrain the rectangle to a user-specified grid.

Syntactically, the function is implemented to use Parameter-Value pairs, and allows the user to specify a non-interactive starting point, arrays of x- and y- points for snap-to behavior, and the axis you want to draw in. Outputs variables can contain a handle to the created rectangle, as well as an array of handles to the draggable perimeter points. (Output points are in the order: [BL,BR,TL,TR,BM,TM,RM,LM]).

Thanks to Francois Bouffard for his excellent implementation of "draggable," which greatly facilitated this entry.

Acknowledgements

Draggable inspired this file.

Required Products MATLAB
MATLAB release MATLAB 7.13 (R2011b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.

Contact us