diff options
| -rw-r--r-- | Backgrounds/atom-playground.jpg | bin | 0 -> 77018 bytes | |||
| -rw-r--r-- | Backgrounds/bedroom1.gif | bin | 0 -> 27694 bytes | |||
| -rw-r--r-- | Backgrounds/bedroom2.gif | bin | 0 -> 23267 bytes | |||
| -rw-r--r-- | Backgrounds/berkeley-mural.jpg | bin | 0 -> 98720 bytes | |||
| -rw-r--r-- | Backgrounds/brick-wall-and-stairs.jpg | bin | 0 -> 110521 bytes | |||
| -rw-r--r-- | Backgrounds/brick-wall1.jpg | bin | 0 -> 41872 bytes | |||
| -rw-r--r-- | Backgrounds/brick-wall2.jpg | bin | 0 -> 109096 bytes | |||
| -rw-r--r-- | Backgrounds/desert.gif | bin | 0 -> 34344 bytes | |||
| -rw-r--r-- | Backgrounds/night-city-with-street.gif | bin | 0 -> 20496 bytes | |||
| -rw-r--r-- | Backgrounds/party-room.jpg | bin | 0 -> 31708 bytes | |||
| -rw-r--r-- | Backgrounds/pathway.jpg | bin | 0 -> 113122 bytes | |||
| -rw-r--r-- | Backgrounds/xy-grid.gif | bin | 0 -> 4135 bytes | |||
| -rw-r--r-- | Costumes/alonzo.gif | bin | 0 -> 1587 bytes | |||
| -rw-r--r-- | Costumes/bat1-a.png | bin | 0 -> 4907 bytes | |||
| -rw-r--r-- | Costumes/bat1-b.png | bin | 0 -> 4572 bytes | |||
| -rw-r--r-- | Costumes/bat2-a.png | bin | 0 -> 2171 bytes | |||
| -rw-r--r-- | Costumes/bat2-b.png | bin | 0 -> 2237 bytes | |||
| -rw-r--r-- | Costumes/boy1-standing.gif | bin | 0 -> 6041 bytes | |||
| -rw-r--r-- | Costumes/boy1-walking.gif | bin | 0 -> 4925 bytes | |||
| -rw-r--r-- | Costumes/boy2.gif | bin | 0 -> 4764 bytes | |||
| -rw-r--r-- | Costumes/boy3.gif | bin | 0 -> 4410 bytes | |||
| -rw-r--r-- | Costumes/cat2.gif | bin | 0 -> 1681 bytes | |||
| -rw-r--r-- | Costumes/cat3.png | bin | 0 -> 4253 bytes | |||
| -rw-r--r-- | Costumes/cat4.png | bin | 0 -> 4607 bytes | |||
| -rw-r--r-- | Costumes/cat5.gif | bin | 0 -> 5761 bytes | |||
| -rw-r--r-- | Costumes/dog1-a.png | bin | 0 -> 2709 bytes | |||
| -rw-r--r-- | Costumes/dog1-b.png | bin | 0 -> 2849 bytes | |||
| -rw-r--r-- | Costumes/dog2-a.png | bin | 0 -> 3173 bytes | |||
| -rw-r--r-- | Costumes/dog2-b.png | bin | 0 -> 2952 bytes | |||
| -rw-r--r-- | Costumes/dog2-c.png | bin | 0 -> 3002 bytes | |||
| -rw-r--r-- | Costumes/dragon1-a.png | bin | 0 -> 3078 bytes | |||
| -rw-r--r-- | Costumes/dragon1-b.png | bin | 0 -> 3421 bytes | |||
| -rw-r--r-- | Costumes/dragon2.gif | bin | 0 -> 2591 bytes | |||
| -rw-r--r-- | Costumes/girl1-standing.gif | bin | 0 -> 1364 bytes | |||
| -rw-r--r-- | Costumes/girl1-walking.gif | bin | 0 -> 1569 bytes | |||
| -rw-r--r-- | Costumes/girl2-shouting.gif | bin | 0 -> 1584 bytes | |||
| -rw-r--r-- | Costumes/girl2-standing.gif | bin | 0 -> 1475 bytes | |||
| -rw-r--r-- | Costumes/girl3-basketball.gif | bin | 0 -> 6585 bytes | |||
| -rw-r--r-- | Costumes/girl3-running.gif | bin | 0 -> 5837 bytes | |||
| -rw-r--r-- | Costumes/girl3-standing.gif | bin | 0 -> 1514 bytes | |||
| -rw-r--r-- | Costumes/marissa-crouching.gif | bin | 0 -> 9955 bytes | |||
| -rw-r--r-- | Costumes/marissa-sitting.gif | bin | 0 -> 7855 bytes | |||
| -rw-r--r-- | Costumes/marissa.gif | bin | 0 -> 9210 bytes | |||
| -rw-r--r-- | Costumes/unicorn1.png | bin | 0 -> 4648 bytes | |||
| -rw-r--r-- | Sounds/Cat.mp3 | bin | 0 -> 8194 bytes | |||
| -rw-r--r-- | Sounds/Chord.wav | bin | 0 -> 41260 bytes | |||
| -rw-r--r-- | Sounds/Dog1.wav | bin | 0 -> 7388 bytes | |||
| -rw-r--r-- | Sounds/Dog2.wav | bin | 0 -> 6380 bytes | |||
| -rw-r--r-- | Sounds/FingerSnap.wav | bin | 0 -> 4014 bytes | |||
| -rw-r--r-- | Sounds/Kitten.wav | bin | 0 -> 37420 bytes | |||
| -rw-r--r-- | Sounds/Laugh-female.wav | bin | 0 -> 27138 bytes | |||
| -rw-r--r-- | Sounds/Laugh-male1.wav | bin | 0 -> 29368 bytes | |||
| -rw-r--r-- | Sounds/Laugh-male2.wav | bin | 0 -> 64174 bytes | |||
| -rw-r--r-- | Sounds/Laugh-male3.mp3 | bin | 0 -> 30137 bytes | |||
| -rw-r--r-- | Sounds/Meow.wav | bin | 0 -> 13068 bytes | |||
| -rw-r--r-- | Sounds/Pop.wav | bin | 0 -> 1076 bytes | |||
| -rw-r--r-- | gui.js | 100 | ||||
| -rwxr-xr-x | history.txt | 9 | ||||
| -rw-r--r-- | objects.js | 6 | ||||
| -rw-r--r-- | paint.js | 19 | ||||
| -rw-r--r-- | store.js | 16 |
61 files changed, 136 insertions, 14 deletions
diff --git a/Backgrounds/atom-playground.jpg b/Backgrounds/atom-playground.jpg Binary files differnew file mode 100644 index 0000000..94b953e --- /dev/null +++ b/Backgrounds/atom-playground.jpg diff --git a/Backgrounds/bedroom1.gif b/Backgrounds/bedroom1.gif Binary files differnew file mode 100644 index 0000000..17b23a3 --- /dev/null +++ b/Backgrounds/bedroom1.gif diff --git a/Backgrounds/bedroom2.gif b/Backgrounds/bedroom2.gif Binary files differnew file mode 100644 index 0000000..9e14bab --- /dev/null +++ b/Backgrounds/bedroom2.gif diff --git a/Backgrounds/berkeley-mural.jpg b/Backgrounds/berkeley-mural.jpg Binary files differnew file mode 100644 index 0000000..2df7a43 --- /dev/null +++ b/Backgrounds/berkeley-mural.jpg diff --git a/Backgrounds/brick-wall-and-stairs.jpg b/Backgrounds/brick-wall-and-stairs.jpg Binary files differnew file mode 100644 index 0000000..78e412d --- /dev/null +++ b/Backgrounds/brick-wall-and-stairs.jpg diff --git a/Backgrounds/brick-wall1.jpg b/Backgrounds/brick-wall1.jpg Binary files differnew file mode 100644 index 0000000..e3e76ef --- /dev/null +++ b/Backgrounds/brick-wall1.jpg diff --git a/Backgrounds/brick-wall2.jpg b/Backgrounds/brick-wall2.jpg Binary files differnew file mode 100644 index 0000000..da4d56b --- /dev/null +++ b/Backgrounds/brick-wall2.jpg diff --git a/Backgrounds/desert.gif b/Backgrounds/desert.gif Binary files differnew file mode 100644 index 0000000..16769b3 --- /dev/null +++ b/Backgrounds/desert.gif diff --git a/Backgrounds/night-city-with-street.gif b/Backgrounds/night-city-with-street.gif Binary files differnew file mode 100644 index 0000000..91e6185 --- /dev/null +++ b/Backgrounds/night-city-with-street.gif diff --git a/Backgrounds/party-room.jpg b/Backgrounds/party-room.jpg Binary files differnew file mode 100644 index 0000000..f253c9f --- /dev/null +++ b/Backgrounds/party-room.jpg diff --git a/Backgrounds/pathway.jpg b/Backgrounds/pathway.jpg Binary files differnew file mode 100644 index 0000000..03d5235 --- /dev/null +++ b/Backgrounds/pathway.jpg diff --git a/Backgrounds/xy-grid.gif b/Backgrounds/xy-grid.gif Binary files differnew file mode 100644 index 0000000..9e46216 --- /dev/null +++ b/Backgrounds/xy-grid.gif diff --git a/Costumes/alonzo.gif b/Costumes/alonzo.gif Binary files differnew file mode 100644 index 0000000..ce53a4f --- /dev/null +++ b/Costumes/alonzo.gif diff --git a/Costumes/bat1-a.png b/Costumes/bat1-a.png Binary files differnew file mode 100644 index 0000000..8d3af1e --- /dev/null +++ b/Costumes/bat1-a.png diff --git a/Costumes/bat1-b.png b/Costumes/bat1-b.png Binary files differnew file mode 100644 index 0000000..bb309df --- /dev/null +++ b/Costumes/bat1-b.png diff --git a/Costumes/bat2-a.png b/Costumes/bat2-a.png Binary files differnew file mode 100644 index 0000000..c97a6be --- /dev/null +++ b/Costumes/bat2-a.png diff --git a/Costumes/bat2-b.png b/Costumes/bat2-b.png Binary files differnew file mode 100644 index 0000000..c5cb521 --- /dev/null +++ b/Costumes/bat2-b.png diff --git a/Costumes/boy1-standing.gif b/Costumes/boy1-standing.gif Binary files differnew file mode 100644 index 0000000..a560af4 --- /dev/null +++ b/Costumes/boy1-standing.gif diff --git a/Costumes/boy1-walking.gif b/Costumes/boy1-walking.gif Binary files differnew file mode 100644 index 0000000..3772b00 --- /dev/null +++ b/Costumes/boy1-walking.gif diff --git a/Costumes/boy2.gif b/Costumes/boy2.gif Binary files differnew file mode 100644 index 0000000..58d9221 --- /dev/null +++ b/Costumes/boy2.gif diff --git a/Costumes/boy3.gif b/Costumes/boy3.gif Binary files differnew file mode 100644 index 0000000..ee076e8 --- /dev/null +++ b/Costumes/boy3.gif diff --git a/Costumes/cat2.gif b/Costumes/cat2.gif Binary files differnew file mode 100644 index 0000000..e9c0785 --- /dev/null +++ b/Costumes/cat2.gif diff --git a/Costumes/cat3.png b/Costumes/cat3.png Binary files differnew file mode 100644 index 0000000..d03b3f4 --- /dev/null +++ b/Costumes/cat3.png diff --git a/Costumes/cat4.png b/Costumes/cat4.png Binary files differnew file mode 100644 index 0000000..02f379a --- /dev/null +++ b/Costumes/cat4.png diff --git a/Costumes/cat5.gif b/Costumes/cat5.gif Binary files differnew file mode 100644 index 0000000..6ebd3af --- /dev/null +++ b/Costumes/cat5.gif diff --git a/Costumes/dog1-a.png b/Costumes/dog1-a.png Binary files differnew file mode 100644 index 0000000..69f8ef3 --- /dev/null +++ b/Costumes/dog1-a.png diff --git a/Costumes/dog1-b.png b/Costumes/dog1-b.png Binary files differnew file mode 100644 index 0000000..fd592e3 --- /dev/null +++ b/Costumes/dog1-b.png diff --git a/Costumes/dog2-a.png b/Costumes/dog2-a.png Binary files differnew file mode 100644 index 0000000..bbb29eb --- /dev/null +++ b/Costumes/dog2-a.png diff --git a/Costumes/dog2-b.png b/Costumes/dog2-b.png Binary files differnew file mode 100644 index 0000000..9279cdc --- /dev/null +++ b/Costumes/dog2-b.png diff --git a/Costumes/dog2-c.png b/Costumes/dog2-c.png Binary files differnew file mode 100644 index 0000000..6b314d2 --- /dev/null +++ b/Costumes/dog2-c.png diff --git a/Costumes/dragon1-a.png b/Costumes/dragon1-a.png Binary files differnew file mode 100644 index 0000000..c216eea --- /dev/null +++ b/Costumes/dragon1-a.png diff --git a/Costumes/dragon1-b.png b/Costumes/dragon1-b.png Binary files differnew file mode 100644 index 0000000..83261c5 --- /dev/null +++ b/Costumes/dragon1-b.png diff --git a/Costumes/dragon2.gif b/Costumes/dragon2.gif Binary files differnew file mode 100644 index 0000000..d63305d --- /dev/null +++ b/Costumes/dragon2.gif diff --git a/Costumes/girl1-standing.gif b/Costumes/girl1-standing.gif Binary files differnew file mode 100644 index 0000000..60369d0 --- /dev/null +++ b/Costumes/girl1-standing.gif diff --git a/Costumes/girl1-walking.gif b/Costumes/girl1-walking.gif Binary files differnew file mode 100644 index 0000000..e7bad2b --- /dev/null +++ b/Costumes/girl1-walking.gif diff --git a/Costumes/girl2-shouting.gif b/Costumes/girl2-shouting.gif Binary files differnew file mode 100644 index 0000000..783b636 --- /dev/null +++ b/Costumes/girl2-shouting.gif diff --git a/Costumes/girl2-standing.gif b/Costumes/girl2-standing.gif Binary files differnew file mode 100644 index 0000000..6550406 --- /dev/null +++ b/Costumes/girl2-standing.gif diff --git a/Costumes/girl3-basketball.gif b/Costumes/girl3-basketball.gif Binary files differnew file mode 100644 index 0000000..1a7f330 --- /dev/null +++ b/Costumes/girl3-basketball.gif diff --git a/Costumes/girl3-running.gif b/Costumes/girl3-running.gif Binary files differnew file mode 100644 index 0000000..abdc510 --- /dev/null +++ b/Costumes/girl3-running.gif diff --git a/Costumes/girl3-standing.gif b/Costumes/girl3-standing.gif Binary files differnew file mode 100644 index 0000000..fec700b --- /dev/null +++ b/Costumes/girl3-standing.gif diff --git a/Costumes/marissa-crouching.gif b/Costumes/marissa-crouching.gif Binary files differnew file mode 100644 index 0000000..7bbf4b0 --- /dev/null +++ b/Costumes/marissa-crouching.gif diff --git a/Costumes/marissa-sitting.gif b/Costumes/marissa-sitting.gif Binary files differnew file mode 100644 index 0000000..500ce97 --- /dev/null +++ b/Costumes/marissa-sitting.gif diff --git a/Costumes/marissa.gif b/Costumes/marissa.gif Binary files differnew file mode 100644 index 0000000..bdebc84 --- /dev/null +++ b/Costumes/marissa.gif diff --git a/Costumes/unicorn1.png b/Costumes/unicorn1.png Binary files differnew file mode 100644 index 0000000..eb3b870 --- /dev/null +++ b/Costumes/unicorn1.png diff --git a/Sounds/Cat.mp3 b/Sounds/Cat.mp3 Binary files differnew file mode 100644 index 0000000..e65fdca --- /dev/null +++ b/Sounds/Cat.mp3 diff --git a/Sounds/Chord.wav b/Sounds/Chord.wav Binary files differnew file mode 100644 index 0000000..838ff3a --- /dev/null +++ b/Sounds/Chord.wav diff --git a/Sounds/Dog1.wav b/Sounds/Dog1.wav Binary files differnew file mode 100644 index 0000000..1cbdbcc --- /dev/null +++ b/Sounds/Dog1.wav diff --git a/Sounds/Dog2.wav b/Sounds/Dog2.wav Binary files differnew file mode 100644 index 0000000..68e024c --- /dev/null +++ b/Sounds/Dog2.wav diff --git a/Sounds/FingerSnap.wav b/Sounds/FingerSnap.wav Binary files differnew file mode 100644 index 0000000..df56220 --- /dev/null +++ b/Sounds/FingerSnap.wav diff --git a/Sounds/Kitten.wav b/Sounds/Kitten.wav Binary files differnew file mode 100644 index 0000000..45742d5 --- /dev/null +++ b/Sounds/Kitten.wav diff --git a/Sounds/Laugh-female.wav b/Sounds/Laugh-female.wav Binary files differnew file mode 100644 index 0000000..7784804 --- /dev/null +++ b/Sounds/Laugh-female.wav diff --git a/Sounds/Laugh-male1.wav b/Sounds/Laugh-male1.wav Binary files differnew file mode 100644 index 0000000..191e3b7 --- /dev/null +++ b/Sounds/Laugh-male1.wav diff --git a/Sounds/Laugh-male2.wav b/Sounds/Laugh-male2.wav Binary files differnew file mode 100644 index 0000000..2ab8921 --- /dev/null +++ b/Sounds/Laugh-male2.wav diff --git a/Sounds/Laugh-male3.mp3 b/Sounds/Laugh-male3.mp3 Binary files differnew file mode 100644 index 0000000..f6f22c7 --- /dev/null +++ b/Sounds/Laugh-male3.mp3 diff --git a/Sounds/Meow.wav b/Sounds/Meow.wav Binary files differnew file mode 100644 index 0000000..a07a948 --- /dev/null +++ b/Sounds/Meow.wav diff --git a/Sounds/Pop.wav b/Sounds/Pop.wav Binary files differnew file mode 100644 index 0000000..60bdf1d --- /dev/null +++ b/Sounds/Pop.wav @@ -68,7 +68,7 @@ sb, CommentMorph, CommandBlockMorph, BlockLabelPlaceHolderMorph, Audio*/ // Global stuff //////////////////////////////////////////////////////// -modules.gui = '2014-February-04'; +modules.gui = '2014-February-11'; // Declarations @@ -2061,6 +2061,20 @@ IDE_Morph.prototype.settingsMenu = function () { 'Zoom blocks...', 'userSetBlocksScale' ); + if (shiftClicked) { + menu.addItem( + 'Stage width...', + 'userSetStageWidth', + null, + new Color(100, 0, 0) + ); + menu.addItem( + 'Stage height...', + 'userSetStageHeight', + null, + new Color(100, 0, 0) + ); + } menu.addLine(); addPreference( 'Blurred shadows', @@ -2695,6 +2709,7 @@ IDE_Morph.prototype.newProject = function () { this.globalVariables = new VariableFrame(); this.currentSprite = new SpriteMorph(this.globalVariables); this.sprites = new List([this.currentSprite]); + StageMorph.prototype.dimensions = new Point(480, 360); StageMorph.prototype.hiddenPrimitives = {}; StageMorph.prototype.codeMappings = {}; StageMorph.prototype.codeHeaders = {}; @@ -3464,6 +3479,89 @@ IDE_Morph.prototype.setBlocksScale = function (num) { this.saveSetting('zoom', num); }; +// IDE_Morph stage size manipulation + +IDE_Morph.prototype.userSetStageWidth = function () { + new DialogBoxMorph( + this, + this.setStageWidth, + this + ).prompt( + "Stage width", + StageMorph.prototype.dimensions.x.toString(), + this.world(), + null, // pic + null, // choices + null, // read only + true // numeric + ); +}; + +IDE_Morph.prototype.userSetStageHeight = function () { + new DialogBoxMorph( + this, + this.setStageHeight, + this + ).prompt( + "Stage height", + StageMorph.prototype.dimensions.y.toString(), + this.world(), + null, // pic + null, // choices + null, // read only + true // numeric + ); +}; + +IDE_Morph.prototype.setStageWidth = function (num) { + this.setStageExtent(new Point( + Math.max(num, 240), + (StageMorph.prototype.dimensions.y) + )); +}; + +IDE_Morph.prototype.setStageHeight = function (num) { + this.setStageExtent(new Point( + (StageMorph.prototype.dimensions.x), + Math.max(num, 180) + )); +}; + +IDE_Morph.prototype.setStageExtent = function (aPoint) { + var myself = this; + + function zoom() { + myself.step = function () { + var delta = aPoint.subtract( + StageMorph.prototype.dimensions + ).divideBy(2); + if (delta.abs().lt(new Point(5, 5))) { + StageMorph.prototype.dimensions = aPoint; + delete myself.step; + } else { + StageMorph.prototype.dimensions = + StageMorph.prototype.dimensions.add(delta); + } + myself.stage.setExtent(StageMorph.prototype.dimensions); + myself.stage.clearPenTrails(); + myself.fixLayout(); + }; + } + + this.stageRatio = 1; + this.isSmallStage = false; + this.controlBar.stageSizeButton.refresh(); + this.setExtent(this.world().extent()); + if (this.isAnimating) { + zoom(); + } else { + StageMorph.prototype.dimensions = aPoint; + this.stage.setExtent(StageMorph.prototype.dimensions); + this.stage.clearPenTrails(); + this.fixLayout(); + } +}; + // IDE_Morph cloud interface IDE_Morph.prototype.initializeCloud = function () { diff --git a/history.txt b/history.txt index 77c2e9d..0ffa8c2 100755 --- a/history.txt +++ b/history.txt @@ -2085,3 +2085,12 @@ ______ * Objects: Enable playing sounds and notes on Firefox, thanks, Dean Brettle, for this fix!! * Update Portuguese translation, thanks, Manuel! * Update French translation, thanks, grego! + +140205 +------ +* Objects, Paint: One-stop-shopping for stage dimensions (changing the stage dimensions in line 3720 of objects.js takes care of everything) + +140211 +------ +* GUI: Set stage dimensions arbitrarily (new entries in the settings menu when holding shift) +* Store: Saving & Loading for arbitrary stage dimensions in the project data @@ -124,7 +124,7 @@ PrototypeHatBlockMorph*/ // Global stuff //////////////////////////////////////////////////////// -modules.objects = '2014-February-04'; +modules.objects = '2014-February-11'; var SpriteMorph; var StageMorph; @@ -5314,7 +5314,7 @@ Costume.prototype.edit = function (aWorld, anIDE, isnew, oncancel, onsubmit) { editor.openIn( aWorld, isnew ? - newCanvas(new Point(480, 360)) : + newCanvas(StageMorph.prototype.dimensions) : this.contents, isnew ? new Point(240, 180) : @@ -6566,7 +6566,7 @@ StagePrompterMorph.prototype.init = function (question) { if (this.label) {this.add(this.label); } this.add(this.inputField); this.add(this.button); - this.setWidth(480 - 20); + this.setWidth(StageMorph.prototype.dimensions.x - 20); this.fixLayout(); }; @@ -51,6 +51,7 @@ July 12 - pipette tool, code formatting adjustments (Jens) September 16 - flood fill freeze fix (Kartik) Jan 08 - mouse leave dragging fix (Kartik) + Feb 11 - dynamically adjust to stage dimensions (Jens) */ @@ -59,12 +60,12 @@ CostumeIconMorph, IDE_Morph, Costume, SpriteMorph, nop, Image, WardrobeMorph, TurtleIconMorph, localize, MenuMorph, InputFieldMorph, SliderMorph, ToggleMorph, ToggleButtonMorph, BoxMorph, modules, radians, - MorphicPreferences, getDocumentPositionOf + MorphicPreferences, getDocumentPositionOf, StageMorph */ // Global stuff //////////////////////////////////////////////////////// -modules.paint = '2014-January-09'; +modules.paint = '2014-February-11'; // Declarations @@ -106,7 +107,7 @@ PaintEditorMorph.prototype.buildContents = function () { var myself = this; this.paper = new PaintCanvasMorph(function () {return myself.shift; }); - this.paper.setExtent(new Point(480, 360)); + this.paper.setExtent(StageMorph.prototype.dimensions); this.addBody(new AlignmentMorph('row', this.padding)); this.controls = new AlignmentMorph('column', this.padding); @@ -693,11 +694,11 @@ PaintCanvasMorph.prototype.floodfill = function (sourcepoint) { while (stack.length > 0) { currentpoint = stack.pop(); if (checkpoint(read(currentpoint))) { - if (currentpoint % 480 > 1) { + if (currentpoint % width > 1) { stack.push(currentpoint + 1); stack.push(currentpoint - 1); } - if (currentpoint > 0 && currentpoint < 360 * 480) { + if (currentpoint > 0 && currentpoint < height * width) { stack.push(currentpoint + width); stack.push(currentpoint - width); } @@ -750,7 +751,9 @@ PaintCanvasMorph.prototype.mouseMove = function (pos) { q = relpos.y, // current drag y w = (p - x) / 2, // half the rect width h = (q - y) / 2, // half the rect height - i; // iterator number + i, // iterator number + width = this.paper.width; + mctx.save(); function newW() { return Math.max(Math.abs(w), Math.abs(h)) * (w / Math.abs(w)); @@ -825,7 +828,7 @@ PaintCanvasMorph.prototype.mouseMove = function (pos) { false ); } else { - for (i = 0; i < 480; i += 1) { + for (i = 0; i < width; i += 1) { mctx.lineTo( i, (2 * h) * Math.sqrt(2 - Math.pow( @@ -834,7 +837,7 @@ PaintCanvasMorph.prototype.mouseMove = function (pos) { )) + y ); } - for (i = 480; i > 0; i -= 1) { + for (i = width; i > 0; i -= 1) { mctx.lineTo( i, -1 * (2 * h) * Math.sqrt(2 - Math.pow( @@ -61,7 +61,7 @@ SyntaxElementMorph*/ // Global stuff //////////////////////////////////////////////////////// -modules.store = '2014-February-04'; +modules.store = '2014-February-11'; // XML_Serializer /////////////////////////////////////////////////////// @@ -377,6 +377,15 @@ SnapSerializer.prototype.loadProjectModel = function (xmlNode) { project.pentrails.src = model.pentrails.contents; } project.stage.setTempo(model.stage.attributes.tempo); + StageMorph.prototype.dimensions = new Point(480, 360); + if (model.stage.attributes.width) { + StageMorph.prototype.dimensions.x = + +model.stage.attributes.width; + } + if (model.stage.attributes.height) { + StageMorph.prototype.dimensions.y = + +model.stage.attributes.height; + } project.stage.setExtent(StageMorph.prototype.dimensions); SpriteMorph.prototype.useFlatLineEnds = model.stage.attributes.lines === 'flat'; @@ -1341,7 +1350,8 @@ StageMorph.prototype.toXML = function (serializer) { '<project name="@" app="@" version="@">' + '<notes>$</notes>' + '<thumbnail>$</thumbnail>' + - '<stage name="@" costume="@" tempo="@" threadsafe="@" ' + + '<stage name="@" width="@" height="@" ' + + 'costume="@" tempo="@" threadsafe="@" ' + 'lines="@" ' + 'codify="@" ' + 'scheduled="@" ~>' + @@ -1364,6 +1374,8 @@ StageMorph.prototype.toXML = function (serializer) { (ide && ide.projectNotes) ? ide.projectNotes : '', thumbdata, this.name, + StageMorph.prototype.dimensions.x, + StageMorph.prototype.dimensions.y, this.getCostumeIdx(), this.getTempo(), this.isThreadSafe, |
