trueSize option + setSelect option = inconsistent behavior

203 views
Skip to first unread message

Guido Scalise

unread,
Nov 16, 2011, 8:15:49 AM11/16/11
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.

Kelly Hallman

unread,
Nov 16, 2011, 10:47:56 PM11/16/11
to jcro...@googlegroups.com
Hi - have you checked the most recent github master branch? I just updated this yesterday from a bug fix someone else submitted... the commit was approximately around the time you posted this... let me know if that fixed the problem!

-Kelly



--
You received this message because you are subscribed to the Google Groups "Jcrop Development Discussion" group.
To post to this group, send email to jcro...@googlegroups.com.
To unsubscribe from this group, send email to jcrop-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jcrop-dev?hl=en.


Reply all
Reply to author
Forward
0 new messages