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

🐛 Fix stamps on high dpi screens #537

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions dist/packery.pkgd.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Packery PACKAGED v2.1.2
* Packery PACKAGED v2.1.3
* Gapless, draggable grid layouts
*
* Licensed GPLv3 for open source use
Expand Down Expand Up @@ -3008,15 +3008,17 @@ proto._manageStamp = function( elem ) {
} else {
var offset = this._getElementOffset( elem );
rect = new Rect({
x: this._getOption('originLeft') ? offset.left : offset.right,
y: this._getOption('originTop') ? offset.top : offset.bottom
x: Math.round( this._getOption('originLeft') ? offset.left : offset.right ),
y: Math.round( this._getOption('originTop') ? offset.top : offset.bottom )
});
}

this._setRectSize( elem, rect );
// save its space in the packer
this.packer.placed( rect );
this._setMaxXY( rect );

// ignore stamps in overall layout height
//this._setMaxXY( rect );
};

// -------------------------- methods -------------------------- //
Expand Down
4 changes: 2 additions & 2 deletions dist/packery.pkgd.min.js

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions js/packery.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Packery v2.1.2
* Packery v2.1.3
* Gapless, draggable grid layouts
*
* Licensed GPLv3 for open source use
Expand Down Expand Up @@ -256,15 +256,17 @@ proto._manageStamp = function( elem ) {
} else {
var offset = this._getElementOffset( elem );
rect = new Rect({
x: this._getOption('originLeft') ? offset.left : offset.right,
y: this._getOption('originTop') ? offset.top : offset.bottom
x: Math.round( this._getOption('originLeft') ? offset.left : offset.right ),
y: Math.round( this._getOption('originTop') ? offset.top : offset.bottom )
});
}

this._setRectSize( elem, rect );
// save its space in the packer
this.packer.placed( rect );
this._setMaxXY( rect );

// ignore stamps in overall layout height
//this._setMaxXY( rect );
};

// -------------------------- methods -------------------------- //
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "packery",
"version": "2.1.2",
"version": "2.1.4",
"description": "Gapless, draggable grid layouts",
"main": "js/packery.js",
"dependencies": {
Expand Down