diff options
| author | Jules Laplace <jules@okfoc.us> | 2014-10-20 16:42:08 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2014-10-20 16:42:08 -0400 |
| commit | b21cb665e3ca296b56d389d3a2f83434f4646f26 (patch) | |
| tree | 28702570de220b1a8a7b715607ffe9be86de330e /public/assets/javascripts/rectangles/models | |
| parent | e2de422ece0c98c2dbea41e7156455dcf91b9db4 (diff) | |
logarithmic wallpaper scale
Diffstat (limited to 'public/assets/javascripts/rectangles/models')
| -rw-r--r-- | public/assets/javascripts/rectangles/models/floor.js | 5 | ||||
| -rw-r--r-- | public/assets/javascripts/rectangles/models/wall.js | 7 |
2 files changed, 7 insertions, 5 deletions
diff --git a/public/assets/javascripts/rectangles/models/floor.js b/public/assets/javascripts/rectangles/models/floor.js index 2fb870f..ac1f8c9 100644 --- a/public/assets/javascripts/rectangles/models/floor.js +++ b/public/assets/javascripts/rectangles/models/floor.js @@ -146,8 +146,9 @@ Floor.prototype.wallpaperPosition = function(background){ if (this.background.src == "none") { return } - this.background.x = background.x || this.background.x - this.background.y = background.y || this.background.y + + this.background.x = background.x || this.background.x || 0 + this.background.y = background.y || this.background.y || 0 this.background.scale = background.scale || this.background.scale || 1 var mx, dx, dy diff --git a/public/assets/javascripts/rectangles/models/wall.js b/public/assets/javascripts/rectangles/models/wall.js index 75814dc..8590de7 100644 --- a/public/assets/javascripts/rectangles/models/wall.js +++ b/public/assets/javascripts/rectangles/models/wall.js @@ -288,10 +288,11 @@ Wall.prototype.wallpaperPosition = function(background){ if (this.background.src == "none") { return } - this.background.x = background.x || this.background.x - this.background.y = background.y || this.background.y + + this.background.x = background.x || this.background.x || 0 + this.background.y = background.y || this.background.y || 0 this.background.scale = background.scale || this.background.scale || 1 - + var mx, dx, dy var w = Math.round( this.backgroundImage.naturalWidth * this.background.scale ) var h = Math.round( this.backgroundImage.naturalHeight * this.background.scale ) |
