diff options
| author | Code WvS <code-wvs@quantentunnel.de> | 2015-02-07 12:19:01 +0100 |
|---|---|---|
| committer | Code WvS <code-wvs@quantentunnel.de> | 2015-02-07 12:19:01 +0100 |
| commit | 79437a6ab81112438373a6010030ef504ffd5deb (patch) | |
| tree | 8610b74c101511d2ddbd57179a40595152029d16 /objects.js | |
| parent | 9796a36568022b0e59d76de9a5a13b5aefbd8a09 (diff) | |
| download | snap-yow-79437a6ab81112438373a6010030ef504ffd5deb.tar.gz snap-yow-79437a6ab81112438373a6010030ef504ffd5deb.zip | |
make the redraw code shorter
Diffstat (limited to 'objects.js')
| -rw-r--r-- | objects.js | 28 |
1 files changed, 6 insertions, 22 deletions
@@ -4437,30 +4437,14 @@ StageMorph.prototype.drawNew = function () { StageMorph.prototype.drawOn = function (aCanvas, aRect) { var map = document.getElementById('map'); - var rectangle, area, delta, src, w, h, sl, st; - if (!this.isVisible) { - return null; - } + var rectangle, area; rectangle = aRect || this.bounds; area = rectangle.intersect(this.bounds).round(); - if (area.extent().gt(new Point(0, 0))) { - delta = this.position().neg(); - src = area.copy().translateBy(delta).round(); - - sl = src.left(); - st = src.top(); - w = Math.min(src.width(), this.image.width - sl); - h = Math.min(src.height(), this.image.height - st); - - if (w < 1 || h < 1) { - return null; - } - map.style.width = this.dimensions.x * this.scale + 'px'; - map.style.height = this.dimensions.y * this.scale + 'px'; - map.style.left = area.left() + 'px'; - map.style.top = area.top() + 'px'; - window.map.invalidateSize(); - } + map.style.width = this.dimensions.x * this.scale + 'px'; + map.style.height = this.dimensions.y * this.scale + 'px'; + map.style.left = area.left() + 'px'; + map.style.top = area.top() + 'px'; + window.map.invalidateSize(); }; StageMorph.prototype.clearPenTrails = function () { |
