// Resize them to the same size.
$('.dropzones .droppreview').css('padding', '0');
- var numGroups = $('select.draggroup').first().find('option').length;
+ var numGroups = $('.draggroup select').first().find('option').length;
for (var group = 1; group <= numGroups; group++) {
dragDropToImageForm.resizeAllDragsAndDropsInGroup(group);
}
top = Math.round(dropPosition.top - backgroundPosition.top);
// Constrain coordinates to be inside the background.
- // The -10 here matches the +10 in resizeAllDragsAndDropsInGroup().
- left = Math.max(0, Math.min(left, backgroundImage.width() - drop.width() - 10));
- top = Math.max(0, Math.min(top, backgroundImage.height() - drop.height() - 10));
+ left = Math.round(Math.max(0, Math.min(left, backgroundImage.outerWidth() - drop.outerWidth())));
+ top = Math.round(Math.max(0, Math.min(top, backgroundImage.outerHeight() - drop.outerHeight())));
// Update the form.
dragDropToImageForm.form.setFormValue('drops', [dropNo, 'xleft'], left);