Guido Scalise
unread,Nov 16, 2011, 8:15:49 AM11/16/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Jcrop Development Discussion
I'm integrating JCrop in my project, and I've found that there's an
inconsistent behavior when combining the trueSize option with the
setSelect option, due to the setSelect parameter being processed
before the trueSize parameter is processed (and, thus, before scale
parameters are set). What happens, basically is that even when you
specify trueSize, you are forced to pass scaled parameters to
setSelect (when you should be able to pass the real size values).
By inverting the option processing order, the problem is solved, and
both the setSelect option and the setSelect method work as expected.
My modification is as follows:
Check line 1397:
if (options.hasOwnProperty('setSelect')) {
setSelect(options.setSelect);
Selection.done();
delete(options.setSelect);
}
if (options.hasOwnProperty('trueSize')) {
xscale = options.trueSize[0] / boundx;
yscale = options.trueSize[1] / boundy;
}
I've changed it to:
if (options.hasOwnProperty('trueSize')) {
xscale = options.trueSize[0] / boundx;
yscale = options.trueSize[1] / boundy;
}
if (options.hasOwnProperty('setSelect')) {
setSelect(options.setSelect);
Selection.done();
delete(options.setSelect);
}
and the problem is gone.