Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

serializeArea.js #13

Open
jnbdz opened this issue Nov 9, 2015 · 0 comments
Open

serializeArea.js #13

jnbdz opened this issue Nov 9, 2015 · 0 comments
Labels

Comments

@jnbdz
Copy link
Member

jnbdz commented Nov 9, 2015

/*

---
description: Serialization of areas that a element or elements are taking in another element.

authors:
  - Jean-Nicolas Boulay (http://jean-nicolas.name/)

license:
  - MIT-style license

requires:
 - core/1.4:   '*'

provides:
  - Element.serializeArea
...
*/

Element.implement({
serializeArea: function(relative){
    var coors = this.getCoordinates(relative);
    return {
            el: this,
            leftY: coors.top.toInt(),
            leftX: coors.left.toInt(),
            rightY: coors.height.toInt() + coors.top.toInt(),
            rightX: coors.width.toInt() + coors.left.toInt()
        };
}
});
@jnbdz jnbdz added the Proposal label Nov 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant