Skip to content

Commit

Permalink
feat(nipple): remove position offset
Browse files Browse the repository at this point in the history
  • Loading branch information
yoannmoinet committed Sep 29, 2015
1 parent 261fb59 commit be59bc4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,8 @@ Manager.prototype.processOnMove = function (evt) {
}

nipple.frontPosition = {
x: pos.x - nipple.position.x + nipple.options.size / 4,
y: pos.y - nipple.position.y + nipple.options.size / 4
x: pos.x - nipple.position.x,
y: pos.y - nipple.position.y
};

if (!this.nippleOptions.dataOnly) {
Expand Down
4 changes: 4 additions & 0 deletions src/nipple.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ Nipple.prototype.stylize = function () {
display: 'block',
width: '100%',
height: '100%',
marginLeft: -this.options.size / 2 + 'px',
marginTop: -this.options.size / 2 + 'px',
background: this.options.color,
'borderRadius': '50%',
'webkitBorderRadius': '50%',
Expand All @@ -119,6 +121,8 @@ Nipple.prototype.stylize = function () {
height: '50%',
position: 'absolute',
display: 'block',
marginLeft: -this.options.size / 4 + 'px',
marginTop: -this.options.size / 4 + 'px',
background: this.options.color,
'borderRadius': '50%',
'webkitBorderRadius': '50%',
Expand Down

0 comments on commit be59bc4

Please sign in to comment.