Skip to content

Commit eb46de1

Browse files
committed
Use the full frame for small images.
1 parent 919a360 commit eb46de1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

js/demo/demo.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,15 +207,16 @@ $(function () {
207207
var imgNode = result.find('img, canvas')
208208
var img = imgNode[0]
209209
var pixelRatio = window.devicePixelRatio || 1
210+
var margin = img.width / pixelRatio >= 140 ? 40 : 0
210211
imgNode
211212
// eslint-disable-next-line new-cap
212213
.Jcrop(
213214
{
214215
setSelect: [
215-
40,
216-
40,
217-
img.width / pixelRatio - 40,
218-
img.height / pixelRatio - 40
216+
margin,
217+
margin,
218+
img.width / pixelRatio - margin,
219+
img.height / pixelRatio - margin
219220
],
220221
onSelect: function (coords) {
221222
coordinates = coords

0 commit comments

Comments
 (0)