Skip to content

Commit

Permalink
Remove references to unused relative option
Browse files Browse the repository at this point in the history
  • Loading branch information
theodorejb committed Nov 5, 2023
1 parent adcf152 commit 3e54e97
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
15 changes: 0 additions & 15 deletions croppie.js
Original file line number Diff line number Diff line change
Expand Up @@ -1017,14 +1017,6 @@
var y1 = y0 + height;
self.data.points = [x0, y0, x1, y1];
}
else if (self.options.relative) {
points = [
points[0] * img.naturalWidth / 100,
points[1] * img.naturalHeight / 100,
points[2] * img.naturalWidth / 100,
points[3] * img.naturalHeight / 100
];
}

self.data.points = points.map(function (p) {
return parseFloat(p);
Expand Down Expand Up @@ -1197,13 +1189,6 @@
},
get: function () {
var data = _get.call(this);
var points = data.points;
if (this.options.relative) {
points[0] /= this.elements.img.naturalWidth / 100;
points[1] /= this.elements.img.naturalHeight / 100;
points[2] /= this.elements.img.naturalWidth / 100;
points[3] /= this.elements.img.naturalHeight / 100;
}
return data;
},
result: function (type) {
Expand Down
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ <h3>Options</h3>
type: 'square'
}</code>
<br /><br />
<span class="default">Valid type values:</span><code class="language-javascript">'square' 'circle'</code>
<span class="default">Valid type values:</span><code class="language-javascript">'square' | 'circle'</code>
</li>
</ul>
</section>
Expand Down Expand Up @@ -201,7 +201,7 @@ <h3>Methods</h3>
<span class="default">Default:</span><code class="language-javascript">'png'</code>
</li>
<li class="values">
<span class="default">Valid values:</span><code class="language-javascript">'jpeg'|'png'|'webp'</code>
<span class="default">Valid values:</span><code class="language-javascript">'jpeg' | 'png' | 'webp'</code>
</li>
<li>
<code class="language-javascript">quality</code> Number between 0 and 1 indicating image quality.
Expand All @@ -213,7 +213,7 @@ <h3>Methods</h3>
<code class=" language-javascript">circle</code> force the result to be cropped into a circle
</li>
<li class="values">
<span class="default">Valid Values:</span><code class="language-javascript">true</code><code class="language-javascript">false</code>
<span class="default">Valid Values:</span><code class="language-javascript">true | false</code>
</li>
</ul>
</li>
Expand Down

0 comments on commit 3e54e97

Please sign in to comment.