summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCode WvS <code-wvs@quantentunnel.de>2015-02-07 12:19:01 +0100
committerCode WvS <code-wvs@quantentunnel.de>2015-02-07 12:19:01 +0100
commit79437a6ab81112438373a6010030ef504ffd5deb (patch)
tree8610b74c101511d2ddbd57179a40595152029d16
parent9796a36568022b0e59d76de9a5a13b5aefbd8a09 (diff)
downloadsnap-yow-79437a6ab81112438373a6010030ef504ffd5deb.tar.gz
snap-yow-79437a6ab81112438373a6010030ef504ffd5deb.zip
make the redraw code shorter
-rw-r--r--objects.js28
1 files changed, 6 insertions, 22 deletions
diff --git a/objects.js b/objects.js
index c0e4dfc..af21b6d 100644
--- a/objects.js
+++ b/objects.js
@@ -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 () {