Merge pull request #579 from PSeitz/piskelcopy

Copy between piskels
This commit is contained in:
Julian Descottes 2016-12-09 07:18:45 -10:00 committed by GitHub
commit 16cfffa898

View File

@ -93,8 +93,12 @@
ns.SelectionManager.prototype.paste = function() {
if (!this.currentSelection || !this.currentSelection.hasPastedContent) {
if (window.localStorage.getItem('piskel.clipboard')) {
this.currentSelection = JSON.parse(window.localStorage.getItem('piskel.clipboard'));
} else {
return;
}
}
var pixels = this.currentSelection.pixels;
var frame = this.piskelController.getCurrentFrame();
@ -146,6 +150,7 @@
ns.SelectionManager.prototype.copy = function() {
if (this.currentSelection && this.piskelController.getCurrentFrame()) {
this.currentSelection.fillSelectionFromFrame(this.piskelController.getCurrentFrame());
window.localStorage.setItem('piskel.clipboard', JSON.stringify(this.currentSelection));
}
};