summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2014-07-23 17:02:51 +0200
committerjmoenig <jens@moenig.org>2014-07-23 17:02:51 +0200
commit2fbdf855c25b92d5d5508e2c89546a95812f7a5a (patch)
tree68ab1444d18f6e8525de1de9d184e82808ab5196
parent1c2eea6872ac1535175f5b67eb2cc17ade5d8239 (diff)
downloadsnap-2fbdf855c25b92d5d5508e2c89546a95812f7a5a.tar.gz
snap-2fbdf855c25b92d5d5508e2c89546a95812f7a5a.zip
Scale down oversized images to current stage dimensions
rather than to 480 * 360 Thanks, Dan, for reporting this!
-rwxr-xr-xhistory.txt4
-rw-r--r--objects.js12
2 files changed, 11 insertions, 5 deletions
diff --git a/history.txt b/history.txt
index 573786d..af11d16 100755
--- a/history.txt
+++ b/history.txt
@@ -2218,3 +2218,7 @@ ______
140722
------
* Objects, Threads: fixed #521 (deleting variable watchers by dropping them on the palette results in wrong ones to be created when showing them again)
+
+140723
+------
+* Objects: Scale down oversized images to current stage dimensions. Thanks, Dan, for reporting this!
diff --git a/objects.js b/objects.js
index af68ceb..a1059a5 100644
--- a/objects.js
+++ b/objects.js
@@ -125,7 +125,7 @@ PrototypeHatBlockMorph*/
// Global stuff ////////////////////////////////////////////////////////
-modules.objects = '2014-July-22';
+modules.objects = '2014-July-23';
var SpriteMorph;
var StageMorph;
@@ -5667,14 +5667,16 @@ SpriteBubbleMorph.prototype.fixLayout = function () {
function Costume(canvas, name, rotationCenter) {
this.contents = canvas || newCanvas();
- this.shrinkToFit(this.maxExtent);
+ this.shrinkToFit(this.maxExtent());
this.name = name || null;
this.rotationCenter = rotationCenter || this.center();
this.version = Date.now(); // for observer optimization
this.loaded = null; // for de-serialization only
}
-Costume.prototype.maxExtent = StageMorph.prototype.dimensions;
+Costume.prototype.maxExtent = function () {
+ return StageMorph.prototype.dimensions;
+};
Costume.prototype.toString = function () {
return 'a Costume(' + this.name + ')';
@@ -5959,7 +5961,7 @@ SVG_Costume.uber = Costume.prototype;
function SVG_Costume(svgImage, name, rotationCenter) {
this.contents = svgImage;
- this.shrinkToFit(this.maxExtent);
+ this.shrinkToFit(this.maxExtent());
this.name = name || null;
this.rotationCenter = rotationCenter || this.center();
this.version = Date.now(); // for observer optimization
@@ -6007,7 +6009,7 @@ CostumeEditorMorph.prototype.constructor = CostumeEditorMorph;
CostumeEditorMorph.uber = Morph.prototype;
// CostumeEditorMorph preferences settings:
-CostumeEditorMorph.prototype.size = Costume.prototype.maxExtent;
+CostumeEditorMorph.prototype.size = Costume.prototype.maxExtent();
// CostumeEditorMorph instance creation