In my application, I scale pep.js elements via CSS transforms. After scaling an element, it is possible to drag it slightly outside of it's constraints because it's width property is technically still the same.
This pull request adds an option (useBoundingClientRect) to use Element.getBoundingClientRect() instead of jQuery's .outerWidth() & .outerHeight() for element dimension retrieval in Pep.prototype.handleConstraint.
The option is set to false by default to preserve current functionality, but you should maybe consider making this default to true since it has very good browser support.
In my application, I scale pep.js elements via CSS transforms. After scaling an element, it is possible to drag it slightly outside of it's constraints because it's
width
property is technically still the same.This pull request adds an option (
useBoundingClientRect
) to use Element.getBoundingClientRect() instead of jQuery's .outerWidth() & .outerHeight() for element dimension retrieval inPep.prototype.handleConstraint
.The option is set to false by default to preserve current functionality, but you should maybe consider making this default to true since it has very good browser support.