View previous topic :: View next topic |
Author |
Message |
dibya Newbie
Joined: 04 Jul 2006 Posts: 2
|
Posted: Tue Jul 04, 2006 5:59 am Post subject: CropMinSize on each CropSizeList? |
|
|
hi everybody..
is there a way to make each of the CropSizeList have MinimumSize, so there are several CropMinSize on each of the CropSizeList.. |
|
Back to top |
|
 |
amnuts Site Admin

Joined: 01 Sep 2002 Posts: 662 Location: East Sussex, England
|
Posted: Tue Jul 04, 2006 7:23 am Post subject: |
|
|
Just to clarify what you want to do for anyone else reading this:
The requirement is to have the minimum width and height be set to the same dimensions as set by the drop-down list, giving the user the ability to scale up but never below the set size.
This can be done with a quick tweak in the cc_setCropDimensions javascript function as found in the inc.cropinterface.php file. By default the function looks like:
Code: | function cc_setCropDimensions(w, h)
{
dd.elements.theCrop.moveTo(dd.elements.theImage.x, dd.elements.theImage.y);
dd.elements.theCrop.resizeTo(w, h);
dd.elements.theCrop.defw = w;
dd.elements.theCrop.defh = h;
cc_reposBackground();
} |
You want to update it to look something like the following:
Code: | function cc_setCropDimensions(w, h)
{
dd.elements.theCrop.moveTo(dd.elements.theImage.x, dd.elements.theImage.y);
dd.elements.theCrop.resizeTo(w, h);
dd.elements.theCrop.defw = w;
dd.elements.theCrop.defh = h;
dd.elements.theCrop.minw = w;
dd.elements.theCrop.minh = h;
cc_reposBackground();
} |
You may choose to wrap this up in a PHP if conditional so that you can turn on or off that feature, but essentially the two extra lines should be all you need to make it work.
Andy |
|
Back to top |
|
 |
dibya Newbie
Joined: 04 Jul 2006 Posts: 2
|
Posted: Tue Jul 04, 2006 7:59 am Post subject: |
|
|
wow...
fast response, simple tweak.. and WORKS!
tq.. |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|