odyniec/imgareaselect — Issue #13: 'no-go' area, border around but within total image area
Author: ifass
Created: 2011-10-30 12:27:27+00:00
State: open

For an application I need to have an adjustable outer-border within the croparea where you which you can not pass using the selection and resizing. In fact exactly like the fysical borders around the crop-area right now (usualla x1:0, x2:imgWidth, y1:0, y2: imgHeight);

I've made an attempt to add this feature to the plugin, so far I have:
- Added 'noSelBorderWidth' to the options list and changed the init code accordingly to load these settings.
- Changed the doMove() function to respect this border width, this works fine!
- Attempted to change the doResize() function to respect this border. This works only partially.

Problems:
- Resizing doesn't work correctly on all sides, it doesn't always respect the (noSel)border
- Moving the mouse in/out area while resizing makes the selection go beyond the (noSel)border and to the fysical cropborder.

I've pasted the modified jquery.imgareaselect.js version here: http://pastebin.com/V3Vk67RK

To test:
- Replace your original .js file by the pasted one
- Should work immediatly, as default option for noSelBorderWidth is set to 20px, if not, add this option in your init.
- Move your selection area to any of the borders, you'll see you run up to this noSelBorder, this is what I want to see also when resizing.
- Try to resize, you'll see you can go past this noSelBorderWidth..

Any ideas/suggestions on how to fix/improve this?