diff --git a/pull-new-snap.txt b/pull-new-snap.txt new file mode 100644 index 00000000..ca40b89f --- /dev/null +++ b/pull-new-snap.txt @@ -0,0 +1,2 @@ +git pull upstream +refs/tags/v6.9.0:master +git pull upstream +refs/tags/v5.4.5:master diff --git a/stitchcode/CHANGELOG.txt b/stitchcode/CHANGELOG.txt index 4d3a8ed9..ba3e2c28 100644 --- a/stitchcode/CHANGELOG.txt +++ b/stitchcode/CHANGELOG.txt @@ -1,11 +1,12 @@ +* 2021-08-13 (snap6 branch/ 2.7 dev) + - fix app mode? - -* 2021-08-12 (snap6 branch) - - revert back to three r97 (too many small bugs no big pros? ) +* 2021-08-12 (snap6 branch/ 2.7 dev) + - revert back to three r97 (too many small bugs no big pros? (issue #93) - make fullscreen/appmode usable again -* 2021-07-08 (snap6 branch) +* 2021-07-08 (snap6 branch/ 2.7 dev) - update and merge Snap 6.9.0 - update to Three r124 - remove tools library and merge Snap's new blocks (map, etc..) diff --git a/stitchcode/gui.js b/stitchcode/gui.js index 2a32f319..81466dd3 100644 --- a/stitchcode/gui.js +++ b/stitchcode/gui.js @@ -133,14 +133,13 @@ IDE_Morph.prototype.createCorral = nop; // build panes (do not add all) IDE_Morph.prototype.buildPanes = function () { - - this.createStage(); this.createLogo(); this.createControlBar(); this.createCategories(); this.createPalette(); this.createSpriteBar(); this.createSpriteEditor(); + this.createStage(); //this.createCorralBar(); //this.createCorral(); this.createStatusDisplay(); @@ -939,7 +938,7 @@ IDE_Morph.prototype.turtlestitchMenu = function () { IDE_Morph.prototype.toggleAppMode = function (appMode) { var world = this.world(), elements = [ - // this.logo, + this.logo, this.controlBar.projectButton, this.controlBar.settingsButton, this.controlBar.stageSizeButton, @@ -951,17 +950,16 @@ IDE_Morph.prototype.toggleAppMode = function (appMode) { this.stageHandle, this.palette, this.statusDisplay, - this.categories, - ]; - + this.categories + ]; this.isAppMode = isNil(appMode) ? !this.isAppMode : appMode; if (this.isAppMode) { - this.wasSingleStepping = Process.prototype.enableSingleStepping; - if (this.wasSingleStepping) { - this.toggleSingleStepping(); - } + this.wasSingleStepping = Process.prototype.enableSingleStepping; + if (this.wasSingleStepping) { + this.toggleSingleStepping(); + } this.setColor(this.appModeColor); this.controlBar.setColor(this.color); this.controlBar.appModeButton.refresh(); @@ -985,7 +983,7 @@ IDE_Morph.prototype.toggleAppMode = function (appMode) { elements.forEach(e => e.show() ); - this.stage.setScale(2); + this.stage.setScale(1); // show all hidden dialogs world.children.forEach(morph => { if (morph instanceof DialogBoxMorph) { @@ -1012,7 +1010,6 @@ IDE_Morph.prototype.toggleAppMode = function (appMode) { } this.setExtent(this.world().extent()); }; - // IDE_Morph resizing IDE_Morph.prototype.setExtent = function (point) { @@ -1033,7 +1030,7 @@ IDE_Morph.prototype.setExtent = function (point) { minExt = StageMorph.prototype.dimensions.add( this.controlBar.height() + 10 ); - } + } } else { if (this.stageRatio > 1) { minExt = padding.add(StageMorph.prototype.dimensions); @@ -1042,7 +1039,7 @@ IDE_Morph.prototype.setExtent = function (point) { StageMorph.prototype.dimensions.multiplyBy(this.stageRatio) ); } - + } ext = point.max(minExt); @@ -1056,11 +1053,11 @@ IDE_Morph.prototype.setExtent = function (point) { (maxHeight / this.stage.dimensions.y) ); if (this.isAppMode) { - this.stageSetRatio = this.height() / this.width(); + this.stageRatio = this.height() / this.width(); } else { this.stageRatio = Math.min(maxRatio, Math.max(minRatio, this.stageRatio)); } - + // apply IDE_Morph.uber.setExtent.call(this, ext); this.fixLayout(); @@ -1475,20 +1472,12 @@ IDE_Morph.prototype.fixLayout = function (situation) { if (situation !== 'refreshPalette') { // stage if (this.isAppMode) { - //this.stage.setScale(this.width() / this.stage.dimensions.x); - // temp hack!! - this.stage.setScale(Math.min(this.height() / this.stage.dimensions.y, this.width() / this.stage.dimensions.x)); - //console.log(this.stageRatio, this.height() / this.width()) - //this.stage.setScale(3); - this.stage.setCenter(this.center()); - //this.stage.setTop(this.controlBar.bottom()); - //this.stage.setLeft(0); - //this.stage.setWidth(this.width()); - //this.stageSetRatio = this.height() / this.width() - - - this.controlBar.setTop(0); - this.controlBar.setRight(this.width() - padding); + this.stage.setScale(Math.floor(Math.min( + (this.width() - padding * 2) / this.stage.dimensions.x, + (this.height() - this.controlBar.height() * 2 - padding * 2) + / this.stage.dimensions.y + ) * 10) / 10); + this.stage.setCenter(this.center()); } else { this.stage.setScale(this.isSmallStage ? this.stageRatio : 1); this.stage.setTop(this.logo.bottom() + padding); @@ -1515,14 +1504,13 @@ IDE_Morph.prototype.fixLayout = function (situation) { )); } this.statusDisplay.fixLayout(); + } Morph.prototype.trackChanges = true; this.changed(); }; - - // SVG export IDE_Morph.prototype.downloadSVG = function() { svgStr = this.stage.turtleShepherd.toSVG(); diff --git a/stitchcode/objects.js b/stitchcode/objects.js index e33b640c..bb819a75 100644 --- a/stitchcode/objects.js +++ b/stitchcode/objects.js @@ -943,11 +943,11 @@ SpriteMorph.prototype.drawTextScale = function (text, scale, trim) { vy = Math.sin(radians(this.heading - 90)); nx = Math.cos(radians(this.heading )); ny = Math.sin(radians(this.heading )); - + if (!isNaN(text)) { text = text.toString() } - + for(var i in text) { var index = text.charCodeAt(i) - 33; var x = this.xPosition(); @@ -1869,7 +1869,7 @@ SpriteMorph.prototype.blockTemplates = function (category) { blocks.push('-'); blocks.push(block('doScreenshot')); } - + blocks.push('='); blocks.push(this.makeBlockButton(cat)); @@ -1906,7 +1906,7 @@ SpriteMorph.prototype.blockTemplates = function (category) { blocks.push('='); blocks.push(this.makeBlockButton(cat)); - + } else if (cat === 'pen') { blocks.push(block('clear')); @@ -1923,7 +1923,7 @@ SpriteMorph.prototype.blockTemplates = function (category) { blocks.push(block('changeOpacity')); blocks.push(block('getOpacity')); blocks.push('='); - blocks.push(this.makeBlockButton(cat)); + blocks.push(this.makeBlockButton(cat)); } else if (cat === 'embroidery') { @@ -1948,7 +1948,7 @@ SpriteMorph.prototype.blockTemplates = function (category) { } else if (cat === 'other') { blocks.push(block('zoomToFit')); - + blocks.push('='); blocks.push(this.makeBlockButton(cat)); @@ -2061,7 +2061,7 @@ SpriteMorph.prototype.blockTemplates = function (category) { // for debugging: /////////////// - + if (this.world().isDevMode) { blocks.push('-'); @@ -2078,10 +2078,10 @@ SpriteMorph.prototype.blockTemplates = function (category) { blocks.push(block('reportStackSize')); blocks.push(block('reportFrameCount')); } - + blocks.push('='); blocks.push(this.makeBlockButton(cat)); - + } else if (cat === 'operators') { @@ -2131,7 +2131,7 @@ SpriteMorph.prototype.blockTemplates = function (category) { } // for debugging: /////////////// - + if (this.world().isDevMode) { blocks.push('-'); txt = new TextMorph(localize( @@ -2144,7 +2144,7 @@ SpriteMorph.prototype.blockTemplates = function (category) { blocks.push(block('reportTypeOf')); blocks.push(block('reportTextFunction')); } - + blocks.push('='); blocks.push(this.makeBlockButton(cat)); @@ -2295,7 +2295,7 @@ SpriteMorph.prototype.blockTemplates = function (category) { blocks.push(block('reportMappedCode')); blocks.push('='); } - + blocks.push(this.makeBlockButton()); } return blocks; @@ -2706,7 +2706,7 @@ StageMorph.prototype.initCamera = function () { myself.camera.fitScene = function () { var boundingBox = new THREE.Box3().setFromObject(myself.myStitchLines), - boundingSphere = boundingBox.getBoundingSphere(new THREE.Vector3()), // center with new vector + boundingSphere = boundingBox.getBoundingSphere(), center = boundingSphere.center, distance = boundingSphere.radius;