Skip to content

Commit

Permalink
tweaks - mostly for LINT
Browse files Browse the repository at this point in the history
  • Loading branch information
jmoenig committed Mar 19, 2018
1 parent d744da2 commit d9edaa7
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 54 deletions.
4 changes: 3 additions & 1 deletion gui.js
Expand Up @@ -5204,7 +5204,9 @@ IDE_Morph.prototype.initializeCloud = function () {
myself.source = 'cloud';
if (!isNil(response.days_left)) {
new DialogBoxMorph().inform(
'Unverified account: ' + response.days_left + ' days left',
'Unverified account: ' +
response.days_left +
' days left',
'You are now logged in, and your account\n' +
'is enabled for three days.\n' +
'Please use the verification link that\n' +
Expand Down
2 changes: 1 addition & 1 deletion morphic.js
Expand Up @@ -1163,7 +1163,7 @@

/*global window, HTMLCanvasElement, FileReader, Audio, FileList*/

var morphicVersion = '2018-February-06';
var morphicVersion = '2018-March-19';
var modules = {}; // keep track of additional loaded modules
var useBlurredShadows = getBlurredShadowSupport(); // check for Chrome-bug

Expand Down
16 changes: 11 additions & 5 deletions objects.js
Expand Up @@ -81,7 +81,7 @@ modules, IDE_Morph, VariableDialogMorph, HTMLCanvasElement, Context, List,
SpeechBubbleMorph, RingMorph, isNil, FileReader, TableDialogMorph,
BlockEditorMorph, BlockDialogMorph, PrototypeHatBlockMorph, localize,
TableMorph, TableFrameMorph, normalizeCanvas, BooleanSlotMorph, HandleMorph,
AlignmentMorph, Process*/
AlignmentMorph, Process, XML_Element, VectorPaintEditorMorph*/

modules.objects = '2018-March-19';

Expand Down Expand Up @@ -8449,14 +8449,20 @@ SVG_Costume.prototype.parseShapes = function () {

element.parseString(contents);

if (this.shapes.length == 0 && element.attributes['snap']) {
if (this.shapes.length === 0 && element.attributes.snap) {
this.shapes = element.children.map(function (child) {
return window[child.attributes.prototype].fromSVG(child);
})
});
}
};

SVG_Costume.prototype.edit = function (aWorld, anIDE, isnew, oncancel, onsubmit) {
SVG_Costume.prototype.edit = function (
aWorld,
anIDE,
isnew,
oncancel,
onsubmit
) {
var myself = this,
editor;

Expand All @@ -8478,7 +8484,7 @@ SVG_Costume.prototype.edit = function (aWorld, anIDE, isnew, oncancel, onsubmit)
myself.version = Date.now();
aWorld.changed();
if (anIDE) {
if (isnew) { anIDE.currentSprite.addCostume(myself) };
if (isnew) {anIDE.currentSprite.addCostume(myself); }
anIDE.currentSprite.wearCostume(myself);
anIDE.hasChangedMedia = true;
}
Expand Down
23 changes: 17 additions & 6 deletions paint.js
Expand Up @@ -5,7 +5,7 @@
inspired by the Scratch paint editor.
written by Kartik Chandra
Copyright (C) 2016 by Kartik Chandra
Copyright (C) 2018 by Kartik Chandra
This file is part of Snap!.
Expand Down Expand Up @@ -67,17 +67,18 @@
Apr 10 - getGlobalPixelColor adjustment for Chrome & retina (Jens)
2018
Jan 22 - floodfill alpha tweak (Bernat)
Mar 19 - vector paint editor (Bernat)
*/

/*global Point, Rectangle, DialogBoxMorph, AlignmentMorph, PushButtonMorph,
Color, SymbolMorph, newCanvas, Morph, TextMorph, Costume, SpriteMorph, nop,
localize, InputFieldMorph, SliderMorph, ToggleMorph, ToggleButtonMorph,
BoxMorph, modules, radians, MorphicPreferences, getDocumentPositionOf,
StageMorph, isNil*/
StageMorph, isNil, SVG_Costume*/

// Global stuff ////////////////////////////////////////////////////////

modules.paint = '2018-January-22';
modules.paint = '2018-March-19';

// Declarations

Expand Down Expand Up @@ -274,7 +275,13 @@ PaintEditorMorph.prototype.buildScaleBox = function () {
this.scaleBox.fixLayout();
};

PaintEditorMorph.prototype.openIn = function (world, oldim, oldrc, callback, anIDE) {
PaintEditorMorph.prototype.openIn = function (
world,
oldim,
oldrc,
callback,
anIDE
) {
// Open the editor in a world with an optional image to edit
this.oldim = oldim;
this.callback = callback || nop;
Expand Down Expand Up @@ -646,7 +653,10 @@ PaintCanvasMorph.prototype.calculateCanvasCenter = function(canvas) {
return null;
}
// Can't use canvasBounds.center(), it rounds down.
return new Point((canvasBounds.origin.x + canvasBounds.corner.x) / 2, (canvasBounds.origin.y + canvasBounds.corner.y) / 2);
return new Point(
(canvasBounds.origin.x + canvasBounds.corner.x) / 2,
(canvasBounds.origin.y + canvasBounds.corner.y) / 2
);
};

// If we are in automaticCrosshairs mode, recalculate the rotationCenter.
Expand Down Expand Up @@ -982,7 +992,8 @@ PaintCanvasMorph.prototype.mouseMove = function (pos) {
}
break;
case "crosshairs":
// Disable automatic crosshairs: user has now chosen where they should be.
// Disable automatic crosshairs:
// user has now chosen where they should be.
this.automaticCrosshairs = false;
this.rotationCenter = relpos.copy();
this.drawcrosshair(mctx);
Expand Down
7 changes: 4 additions & 3 deletions symbols.js
Expand Up @@ -7,7 +7,7 @@
written by Jens Mönig
jens@moenig.org
Copyright (C) 2017 by Jens Mönig
Copyright (C) 2018 by Jens Mönig
This file is part of Snap!.
Expand Down Expand Up @@ -41,7 +41,7 @@

// Global stuff ////////////////////////////////////////////////////////

modules.symbols = '2017-September-26';
modules.symbols = '2018-March-19';

var SymbolMorph;

Expand Down Expand Up @@ -1608,7 +1608,8 @@ SymbolMorph.prototype.drawSymbolOctagonOutline = function (canvas, color) {
return canvas;
};

SymbolMorph.prototype.drawSymbolClosedBrushPath = SymbolMorph.prototype.drawSymbolCloudOutline;
SymbolMorph.prototype.drawSymbolClosedBrushPath =
SymbolMorph.prototype.drawSymbolCloudOutline;

SymbolMorph.prototype.drawSymbolNotes = function (canvas, color) {
// answer a canvas showing two musical notes
Expand Down

0 comments on commit d9edaa7

Please sign in to comment.