Note that there are some explanatory texts on larger screens.

plurals
  1. POA Bug in Jcrop, minSize + aspectRatio
    primarykey
    data
    text
    <p>I am trying to use Jcrop for my application, though I have run into a bug with it. I went to the demo page, and the bug exists there too. Here is how to create it.</p> <p>Go to this demo page <a href="http://deepliquid.com/projects/Jcrop/demos.php?demo=advanced" rel="nofollow">http://deepliquid.com/projects/Jcrop/demos.php?demo=advanced</a></p> <p>Make sure the following options are checked "Selection can be moved"<br> "Resizable selection" "Aspect ratio" "minSize/maxSize setting"</p> <p>Create a selected area, drag it to the upper left corner, grab the lower right corner of the selection(as if you were going to resize it) and drag it to the upper left corner of the image.</p> <p>Once you pass the upper left corner of the image the select area collapses down to a 0x0 pixel selection.</p> <p>This bug only happens when an aspect ratio is set. Otherwise it works fine.</p> <p>I'm wondering if anyone has any experience hacking around with this plugin to where they might be able to fix this bug. I've been going through it all day and haven't been able to figure it out yet.</p> <p>--Edit-- After spending a few more hours with it I was able to get the bug mostly fixed. I changed the following code.</p> <pre><code> // Magic %-) if(xx &gt;= x1) { // right side &lt;-- Changed &gt; to &gt;= if(xx - x1 &lt; min_x) { xx = x1 + min_x; } else if (xx - x1 &gt; max_x) { xx = x1 + max_x; } if(yy &gt; y1) { yy = y1 + (xx - x1)/aspect; } else { yy = y1 - (xx - x1)/aspect; } } else if (xx &lt;= x1) { // left side &lt;-- Changed &lt; to &lt;= if(x1 - xx &lt; min_x) { xx = x1 - min_x } else if (x1 - xx &gt; max_x) { xx = x1 - max_x; } if(yy &gt; y1) { yy = y1 + (x1 - xx)/aspect; } else { yy = y1 - (x1 - xx)/aspect; } } </code></pre> <p>This stopped it from collapsing, its still acts a little buggy though.</p> <p>--End Edit--</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload