From 47264f10b03f3d7f2a393902f7551a65e5e81222 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20M=C3=B6nig?= Date: Fri, 8 Sep 2017 19:03:28 +0200 Subject: [PATCH] little tweaks to camera snapshot code mostly to satisfy JSHint ;-) --- gui.js | 11 ++++++++--- history.txt | 5 +++++ objects.js | 16 ++++++++-------- symbols.js | 2 +- widgets.js | 2 +- 5 files changed, 23 insertions(+), 13 deletions(-) diff --git a/gui.js b/gui.js index d6a4a375..a074d83f 100644 --- a/gui.js +++ b/gui.js @@ -70,11 +70,11 @@ fontHeight, hex_sha512, sb, CommentMorph, CommandBlockMorph, BlockLabelPlaceHolderMorph, Audio, SpeechBubbleMorph, ScriptFocusMorph, XML_Element, WatcherMorph, BlockRemovalDialogMorph, saveAs, TableMorph, isSnapObject, isRetinaEnabled, disableRetinaSupport, enableRetinaSupport, -isRetinaSupported, SliderMorph, Animation*/ +isRetinaSupported, SliderMorph, Animation, CamSnapshotDialogMorph*/ // Global stuff //////////////////////////////////////////////////////// -modules.gui = '2017-September-05'; +modules.gui = '2017-September-08'; // Declarations @@ -1503,7 +1503,12 @@ IDE_Morph.prototype.createCorralBar = function () { cambutton.fixLayout(); cambutton.setCenter(this.corralBar.center()); cambutton.setLeft( - this.corralBar.left() + padding + newbutton.width() + padding + paintbutton.width() + padding + this.corralBar.left() + + padding + + newbutton.width() + + padding + + paintbutton.width() + + padding ); if (location.protocol === 'http:') { diff --git a/history.txt b/history.txt index 8da84367..d31da3f3 100755 --- a/history.txt +++ b/history.txt @@ -3615,12 +3615,17 @@ Fixes: * Blocks, Threads: added “csv” option to the SPLIT primitive * Threads: allow https query from locally loaded sources (thanks, Michael, for the hint!) +170908 +------ +* GUI, Objects, Widgets, Symbols: Camera Snapshot Dialog. Thank you, Bernat!! + v4.1 Features: * polymorphic sprite-local custom blocks * inheritance of sprite-local custom blocks * inheritance of sprite attributes (x, y, direction, size, costumes, costume #, sounds, scripts) * first-class costumes and sounds +* camera snapshots for costumes and new sprites * localization support when typing expressions * support for user-forced line-breaks in custom block labels * ternary Boolean slot setting: support to limit Boolean input slots to “true/false” outside of rings and in palette diff --git a/objects.js b/objects.js index 7858a2c0..e89af7e0 100644 --- a/objects.js +++ b/objects.js @@ -80,9 +80,10 @@ document, isNaN, isString, newCanvas, nop, parseFloat, radians, window, modules, IDE_Morph, VariableDialogMorph, HTMLCanvasElement, Context, List, SpeechBubbleMorph, RingMorph, isNil, FileReader, TableDialogMorph, BlockEditorMorph, BlockDialogMorph, PrototypeHatBlockMorph, localize, -TableMorph, TableFrameMorph, normalizeCanvas, BooleanSlotMorph, HandleMorph*/ +TableMorph, TableFrameMorph, normalizeCanvas, BooleanSlotMorph, HandleMorph, +AlignmentMorph*/ -modules.objects = '2017-September-05'; +modules.objects = '2017-September-08'; var SpriteMorph; var StageMorph; @@ -9526,7 +9527,7 @@ StagePrompterMorph.prototype.mouseClickLeft = function () { StagePrompterMorph.prototype.accept = function () { this.isDone = true; -} +}; // CamSnapshotDialogMorph ///////////////////////////////////////////////////////// @@ -9546,7 +9547,7 @@ CamSnapshotDialogMorph.uber = DialogBoxMorph.prototype; function CamSnapshotDialogMorph(ide, sprite, onCancel, onAccept) { this.init(ide, sprite, onCancel, onAccept); -}; +} CamSnapshotDialogMorph.prototype.init = function (ide, sprite, onCancel, onAccept) { this.ide = ide; @@ -9568,8 +9569,7 @@ CamSnapshotDialogMorph.prototype.init = function (ide, sprite, onCancel, onAccep }; CamSnapshotDialogMorph.prototype.buildContents = function () { - var myself = this, - stage = this.ide.stage; + var myself = this; this.videoElement = document.createElement('video'); this.videoElement.hidden = true; @@ -9625,9 +9625,9 @@ CamSnapshotDialogMorph.prototype.buildContents = function () { CamSnapshotDialogMorph.prototype.ok = function () { var stage = this.ide.stage, - canvas = newCanvas(stage.dimensions); + canvas = newCanvas(stage.dimensions), + context = canvas.getContext('2d'); - context = canvas.getContext('2d'); context.translate(stage.dimensions.x, 0); context.scale(-1, 1); diff --git a/symbols.js b/symbols.js index 5607cb4b..b7d20bf2 100644 --- a/symbols.js +++ b/symbols.js @@ -41,7 +41,7 @@ // Global stuff //////////////////////////////////////////////////////// -modules.symbols = '2017-September-01'; +modules.symbols = '2017-September-08'; var SymbolMorph; diff --git a/widgets.js b/widgets.js index e04e4e62..08c3927b 100644 --- a/widgets.js +++ b/widgets.js @@ -85,7 +85,7 @@ HTMLCanvasElement, fontHeight, SymbolMorph, localize, SpeechBubbleMorph, ArrowMorph, MenuMorph, isString, isNil, SliderMorph, MorphicPreferences, ScrollFrameMorph, MenuItemMorph, Note*/ -modules.widgets = '2017-September-01'; +modules.widgets = '2017-September-08'; var PushButtonMorph; var ToggleButtonMorph;