Merge branch 'master' into scenes

snap7
jmoenig 2021-04-23 17:29:13 +02:00
commit 9844408dfa
5 zmienionych plików z 68 dodań i 20 usunięć

Wyświetl plik

@ -52,6 +52,29 @@
* gui: made scene icons selectable
* gui: made scene icons observe the scene's stage versions
## in development:
* **New Features:**
* you can now also "peel off" custom block instances from their prototype templates in the block editor
* **Notable Changes:**
* speed-up talk bubble positioning by 5x
* **Notable Fixes:**
* work around a floating point precision glitch in "ray length"
* fixed an occasional rendering glitch when changing the display style of a variable watcher
* fixed color effect for negative inputs, thanks, Brian!
### 2021-04-23
* objects: fixed color effect for negative inputs, thanks, Brian!
### 2021-04-17
* objects: fixed an occasional rendering glitch when changing the display style of a variable watcher
* objects: tweaked CellMorph shadow rendering
* byob: enable "peeling off" custom block instances from their prototype templates
### 2021-04-17
* new dev version
* threads: worked around a floating point precision glitch in "ray length"
* objects: speed-up talk bubble positioning by 5x
## 6.7.4
* **Notable Fixes:**
* fixed DEAL in the APL library, thanks, Brian!

Wyświetl plik

@ -9,13 +9,13 @@
<script src="src/symbols.js?version=2021-03-03"></script>
<script src="src/widgets.js?version=2021-01-05"></script>
<script src="src/blocks.js?version=2021-04-12"></script>
<script src="src/threads.js?version=2021-04-12"></script>
<script src="src/objects.js?version=2021-04-12"></script>
<script src="src/threads.js?version=2021-04-17"></script>
<script src="src/objects.js?version=2021-04-23"></script>
<script src="src/scenes.js?version=2021-04-23"></script>
<script src="src/gui.js?version=2021-04-23"></script>
<script src="src/paint.js?version=2021-03-17"></script>
<script src="src/lists.js?version=2021-03-15"></script>
<script src="src/byob.js?version=2021-03-05"></script>
<script src="src/byob.js?version=2021-04-20"></script>
<script src="src/tables.js?version=2021-03-05"></script>
<script src="src/sketch.js?version=2021-03-17"></script>
<script src="src/video.js?version=2019-06-27"></script>

Wyświetl plik

@ -106,7 +106,7 @@ WatcherMorph, XML_Serializer, SnapTranslator*/
// Global stuff ////////////////////////////////////////////////////////
modules.byob = '2021-March-05';
modules.byob = '2021-April-20';
// Declarations
@ -645,6 +645,9 @@ CustomCommandBlockMorph.prototype.init = function (definition, isProto) {
this.isGlobal = definition ? definition.isGlobal : false;
this.isPrototype = isProto || false; // optional
CustomCommandBlockMorph.uber.init.call(this);
if (isProto) {
this.isTemplate = true;
}
this.category = definition.category;
this.selector = 'evaluateCustomBlock';
this.variables = null;
@ -655,6 +658,17 @@ CustomCommandBlockMorph.prototype.init = function (definition, isProto) {
}
};
CustomCommandBlockMorph.prototype.reactToTemplateCopy = function () {
var def;
if (this.isPrototype) {
def = this.definition;
this.isPrototype = false;
this.refresh();
this.refreshDefaults(def);
}
CustomCommandBlockMorph.uber.reactToTemplateCopy.call(this);
};
CustomCommandBlockMorph.prototype.initializeVariables = function (oldVars) {
this.variables = new VariableFrame();
if (!this.isGlobal) {
@ -1413,6 +1427,9 @@ CustomReporterBlockMorph.prototype.init = function (
this.isGlobal = definition ? definition.isGlobal : false;
this.isPrototype = isProto || false; // optional
CustomReporterBlockMorph.uber.init.call(this, isPredicate, true); // sil.
if (isProto) {
this.isTemplate = true;
}
this.category = definition.category;
this.storedTranslations = null; // transient - only for "wishes"
this.variables = new VariableFrame();
@ -1426,6 +1443,9 @@ CustomReporterBlockMorph.prototype.init = function (
CustomReporterBlockMorph.prototype.initializeVariables =
CustomCommandBlockMorph.prototype.initializeVariables;
CustomReporterBlockMorph.prototype.reactToTemplateCopy =
CustomCommandBlockMorph.prototype.reactToTemplateCopy;
CustomReporterBlockMorph.prototype.refresh = function (aDefinition) {
var def = aDefinition || this.definition;
CustomCommandBlockMorph.prototype.refresh.call(this, aDefinition, true);

Wyświetl plik

@ -84,7 +84,7 @@ BlockEditorMorph, BlockDialogMorph, PrototypeHatBlockMorph, BooleanSlotMorph,
localize, TableMorph, TableFrameMorph, normalizeCanvas, VectorPaintEditorMorph,
AlignmentMorph, Process, WorldMap, copyCanvas, useBlurredShadows*/
modules.objects = '2021-April-12';
modules.objects = '2021-April-23';
var SpriteMorph;
var StageMorph;
@ -5124,7 +5124,7 @@ SpriteMorph.prototype.applyGraphicsEffects = function (canvas) {
}
v = max / 255;
h = (h + hueShift * 360 / 200) % 360;
h = (((h + hueShift * 360 / 200) % 360) + 360) % 360;
s = Math.max(0, Math.min(s + saturationShift / 100, 1));
v = Math.max(0, Math.min(v + brightnessShift / 100, 1));
@ -5388,7 +5388,11 @@ SpriteMorph.prototype.positionTalkBubble = function () {
var stage = this.parentThatIsA(StageMorph),
stageScale = stage ? stage.scale : 1,
bubble = this.talkBubble(),
middle = this.center().y;
bottom = this.bottom(),
step = this.extent().divideBy(10)
.max(new Point(5, 5).scaleBy(stageScale))
.multiplyBy(new Point(-1, 1));
if (!bubble) {return null; }
bubble.show();
if (!bubble.isPointingRight) {
@ -5398,9 +5402,10 @@ SpriteMorph.prototype.positionTalkBubble = function () {
}
bubble.setLeft(this.right());
bubble.setBottom(this.top());
while (!this.isTouching(bubble) && bubble.bottom() < middle) {
bubble.moveBy(new Point(-1, 1).scaleBy(stageScale));
while (!this.isTouching(bubble) && bubble.bottom() < bottom) {
bubble.moveBy(step);
}
bubble.moveBy(step.mirror());
if (!stage) {return null; }
if (bubble.right() > stage.right()) {
bubble.isPointingRight = false;
@ -11282,7 +11287,7 @@ CellMorph.prototype.render = function (ctx) {
ctx.shadowOffsetY = this.border;
ctx.shadowBlur = this.border;
ctx.shadowColor = this.color.darker(80).toString();
this.drawShadow(ctx, this.edge, this.border / 2);
this.drawShadow(ctx, this.edge, 0);
}
}
};
@ -11296,10 +11301,8 @@ CellMorph.prototype.drawShadow = function (context, radius, inset) {
context.beginPath();
context.moveTo(0, h - offset);
context.lineTo(0, offset);
context.stroke();
// top left:
context.beginPath();
context.arc(
offset,
offset,
@ -11308,11 +11311,8 @@ CellMorph.prototype.drawShadow = function (context, radius, inset) {
radians(-90),
false
);
context.stroke();
// top right:
context.beginPath();
context.moveTo(offset, 0);
context.lineTo(w - offset, 0);
context.stroke();
};
@ -12041,7 +12041,9 @@ WatcherMorph.prototype.parseTxt = function () {
WatcherMorph.prototype.setStyle = function (style) {
this.style = style;
this.changed();
this.fixLayout();
this.rerender();
};
WatcherMorph.prototype.styleNormal = function () {

Wyświetl plik

@ -61,7 +61,7 @@ StageMorph, SpriteMorph, StagePrompterMorph, Note, modules, isString, copy, Map,
isNil, WatcherMorph, List, ListWatcherMorph, alert, console, TableMorph, BLACK,
TableFrameMorph, ColorSlotMorph, isSnapObject, newCanvas, Symbol, SVG_Costume*/
modules.threads = '2021-April-12';
modules.threads = '2021-April-17';
var ThreadManager;
var Process;
@ -5075,23 +5075,26 @@ Process.prototype.reportRayLengthTo = function (name) {
dir,
a, b, x, y,
top, bottom, left, right,
hSect, vSect,
circa, hSect, vSect,
point, hit,
temp,
width, imageData;
circa = (num) => Math.round(num * 10000000) / 10000000; // good enough
hSect = (yLevel) => {
var theta = radians(dir);
b = rc.y - yLevel;
a = b * Math.tan(theta);
x = rc.x + a;
if (
(x === rc.x &&
(circa(x) === circa(rc.x) &&
((dir === 180 && rc.y < yLevel) ||
dir === 0 && rc.y > yLevel)
) ||
(x > rc.x && dir >= 0 && dir < 180) ||
(x < rc.x && dir >= 180 && dir < 360)
(circa(x) < circa(rc.x) &&
dir >= 180 && dir < 360)
) {
if (x >= left && x <= right) {
intersections.push(new Point(x, yLevel));
@ -5105,7 +5108,7 @@ Process.prototype.reportRayLengthTo = function (name) {
a = b * Math.tan(theta);
y = rc.y + a;
if (
(y === rc.y &&
(circa(y) === circa(rc.y) &&
((dir === 90 && rc.x < xLevel) ||
dir === 270 && rc.x > xLevel)
) ||