summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2013-07-02 13:50:14 +0200
committerjmoenig <jens@moenig.org>2013-07-02 13:50:14 +0200
commit78f416be9a4d42517a4b6a5bb801394c6c3e30c1 (patch)
treeaedffb7a3fff62fb7de871ffb4b668792281a6e8
parent09e3a296c25a73b4b4a21e1d0a2d9f6ce673f01f (diff)
downloadsnap-yow-78f416be9a4d42517a4b6a5bb801394c6c3e30c1.tar.gz
snap-yow-78f416be9a4d42517a4b6a5bb801394c6c3e30c1.zip
removed tolerance margin in Costume's shrinkWrap()
Chrome no longer needs this kludge. Removing it also fixes an "empty costume" bug when drawing over the edges of the paint editor
-rwxr-xr-xhistory.txt4
-rw-r--r--objects.js14
2 files changed, 9 insertions, 9 deletions
diff --git a/history.txt b/history.txt
index 633db8d..52ecaa9 100755
--- a/history.txt
+++ b/history.txt
@@ -1773,3 +1773,7 @@ ______
130628
------
* Morphic, GUI: improved importing costumes by dragging in pictures from other web pages
+
+130702
+------
+* Objects: took out "security margin" in Costume's shrinkWrap() method b/c Chrome no longer needs it -> fixed empty costume bug when drawing over the paint editor's bounds \ No newline at end of file
diff --git a/objects.js b/objects.js
index 98602e4..3d014cd 100644
--- a/objects.js
+++ b/objects.js
@@ -123,7 +123,7 @@ PrototypeHatBlockMorph*/
// Global stuff ////////////////////////////////////////////////////////
-modules.objects = '2013-June-27';
+modules.objects = '2013-July-02';
var SpriteMorph;
var StageMorph;
@@ -4595,19 +4595,15 @@ Costume.prototype.bounds = function () {
Costume.prototype.shrinkWrap = function () {
// adjust my contents' bounds to my visible bounding box
- // add a tolerance margin for Chrome's anti-aliasing issue
var bb = this.boundingBox(),
- space = new Point(480, 360).subtract(bb.extent()).floorDivideBy(2),
- margin = new Point(3, 3).min(space.max(new Point(0, 0))),
- area = bb.expandBy(margin),
- ext = area.extent(),
+ ext = bb.extent(),
pic = newCanvas(ext),
ctx = pic.getContext('2d');
ctx.drawImage(
this.contents,
- area.origin.x,
- area.origin.y,
+ bb.origin.x,
+ bb.origin.y,
ext.x,
ext.y,
0,
@@ -4615,7 +4611,7 @@ Costume.prototype.shrinkWrap = function () {
ext.x,
ext.y
);
- this.rotationCenter = this.rotationCenter.subtract(area.origin);
+ this.rotationCenter = this.rotationCenter.subtract(bb.origin);
this.contents = pic;
this.version = Date.now();
};