summaryrefslogtreecommitdiff
path: root/objects.js
diff options
context:
space:
mode:
authorCode WvS <code-wvs@quantentunnel.de>2015-02-06 19:37:51 +0100
committerCode WvS <code-wvs@quantentunnel.de>2015-02-06 19:37:51 +0100
commit2f9d77be645e90fc58779141ecf5a8c906736ec9 (patch)
treec7ef383ef3d42c7499b0fca633093f2e4872e0d9 /objects.js
parent2ca378c50bf67b6af5e16ba72af81f4f84db308c (diff)
downloadsnap-yow-2f9d77be645e90fc58779141ecf5a8c906736ec9.tar.gz
snap-yow-2f9d77be645e90fc58779141ecf5a8c906736ec9.zip
first changes
Diffstat (limited to 'objects.js')
-rw-r--r--objects.js55
1 files changed, 7 insertions, 48 deletions
diff --git a/objects.js b/objects.js
index 981fb20..22419d8 100644
--- a/objects.js
+++ b/objects.js
@@ -4411,8 +4411,10 @@ StageMorph.prototype.drawNew = function () {
};
StageMorph.prototype.drawOn = function (aCanvas, aRect) {
+ var map = document.getElementById('map');
+
// make sure to draw the pen trails canvas as well
- var rectangle, area, delta, src, context, w, h, sl, st, ws, hs;
+ var rectangle, area, delta, src, w, h, sl, st;
if (!this.isVisible) {
return null;
}
@@ -4421,8 +4423,6 @@ StageMorph.prototype.drawOn = function (aCanvas, aRect) {
if (area.extent().gt(new Point(0, 0))) {
delta = this.position().neg();
src = area.copy().translateBy(delta).round();
- context = aCanvas.getContext('2d');
- context.globalAlpha = this.alpha;
sl = src.left();
st = src.top();
@@ -4432,51 +4432,10 @@ StageMorph.prototype.drawOn = function (aCanvas, aRect) {
if (w < 1 || h < 1) {
return null;
}
- context.drawImage(
- this.image,
- src.left(),
- src.top(),
- w,
- h,
- area.left(),
- area.top(),
- w,
- h
- );
-
- // pen trails
- ws = w / this.scale;
- hs = h / this.scale;
- context.save();
- context.scale(this.scale, this.scale);
- try {
- context.drawImage(
- this.penTrails(),
- src.left() / this.scale,
- src.top() / this.scale,
- ws,
- hs,
- area.left() / this.scale,
- area.top() / this.scale,
- ws,
- hs
- );
- } catch (err) { // sometimes triggered only by Firefox
- // console.log(err);
- context.restore();
- context.drawImage(
- this.penTrails(),
- 0,
- 0,
- this.dimensions.x,
- this.dimensions.y,
- this.left(),
- this.top(),
- this.dimensions.x * this.scale,
- this.dimensions.y * this.scale
- );
- }
- context.restore();
+ map.style.width = w + 'px';
+ map.style.height = h + 'px';
+ map.style.left = area.left() + 'px';
+ map.style.top = area.top() + 'px';
}
};