kopia lustrzana https://github.com/backface/turtlestitch
tweaked block representations in widgets for fading
rodzic
b28ca0c2dc
commit
0bcbaf55de
|
@ -5,7 +5,8 @@
|
||||||
### 2020-07-24
|
### 2020-07-24
|
||||||
* gui: cleaned up block-fading pre-sets
|
* gui: cleaned up block-fading pre-sets
|
||||||
* updated German translation
|
* updated German translation
|
||||||
* tweaked IDE colors for block-fading
|
* gui: tweaked IDE colors for block-fading
|
||||||
|
* blocks, threads, byob, widgets: tweaked block representations in widgets for fading
|
||||||
|
|
||||||
### 2020-07-23
|
### 2020-07-23
|
||||||
* morphic: fixed mouseDown events for touch devices
|
* morphic: fixed mouseDown events for touch devices
|
||||||
|
|
|
@ -6,14 +6,14 @@
|
||||||
<link rel="icon" href="src/favicon.ico">
|
<link rel="icon" href="src/favicon.ico">
|
||||||
<script src="src/morphic.js?version=2020-07-23"></script>
|
<script src="src/morphic.js?version=2020-07-23"></script>
|
||||||
<script src="src/symbols.js?version=2020-07-21"></script>
|
<script src="src/symbols.js?version=2020-07-21"></script>
|
||||||
<script src="src/widgets.js?version=2020-07-21"></script>
|
<script src="src/widgets.js?version=2020-07-24"></script>
|
||||||
<script src="src/blocks.js?version=2020-07-23"></script>
|
<script src="src/blocks.js?version=2020-07-24"></script>
|
||||||
<script src="src/threads.js?version=2020-07-22"></script>
|
<script src="src/threads.js?version=2020-07-24"></script>
|
||||||
<script src="src/objects.js?version=2020-07-20"></script>
|
<script src="src/objects.js?version=2020-07-20"></script>
|
||||||
<script src="src/gui.js?version=2020-07-24"></script>
|
<script src="src/gui.js?version=2020-07-24"></script>
|
||||||
<script src="src/paint.js?version=2020-05-17"></script>
|
<script src="src/paint.js?version=2020-05-17"></script>
|
||||||
<script src="src/lists.js?version=2020-07-01"></script>
|
<script src="src/lists.js?version=2020-07-01"></script>
|
||||||
<script src="src/byob.js?version=2020-07-01"></script>
|
<script src="src/byob.js?version=2020-07-24"></script>
|
||||||
<script src="src/tables.js?version=2020-05-18"></script>
|
<script src="src/tables.js?version=2020-05-18"></script>
|
||||||
<script src="src/sketch.js?version=2020-07-13"></script>
|
<script src="src/sketch.js?version=2020-07-13"></script>
|
||||||
<script src="src/video.js?version=2019-06-27"></script>
|
<script src="src/video.js?version=2019-06-27"></script>
|
||||||
|
|
|
@ -158,7 +158,7 @@ CustomCommandBlockMorph, SymbolMorph, ToggleButtonMorph, DialMorph*/
|
||||||
|
|
||||||
// Global stuff ////////////////////////////////////////////////////////
|
// Global stuff ////////////////////////////////////////////////////////
|
||||||
|
|
||||||
modules.blocks = '2020-July-23';
|
modules.blocks = '2020-July-24';
|
||||||
|
|
||||||
var SyntaxElementMorph;
|
var SyntaxElementMorph;
|
||||||
var BlockMorph;
|
var BlockMorph;
|
||||||
|
@ -3481,7 +3481,6 @@ BlockMorph.prototype.showHelp = function () {
|
||||||
if (comment) {
|
if (comment) {
|
||||||
block = def.blockInstance();
|
block = def.blockInstance();
|
||||||
block.refreshDefaults(def);
|
block.refreshDefaults(def);
|
||||||
block.addShadow();
|
|
||||||
comment = comment.fullCopy();
|
comment = comment.fullCopy();
|
||||||
comment.contents.parse();
|
comment.contents.parse();
|
||||||
help = '';
|
help = '';
|
||||||
|
@ -3492,7 +3491,13 @@ BlockMorph.prototype.showHelp = function () {
|
||||||
'Help',
|
'Help',
|
||||||
help.substr(1),
|
help.substr(1),
|
||||||
myself.world(),
|
myself.world(),
|
||||||
block.fullImage()
|
block.doWithAlpha(
|
||||||
|
1,
|
||||||
|
() => {
|
||||||
|
block.addShadow();
|
||||||
|
return block.fullImage();
|
||||||
|
}
|
||||||
|
)
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -4053,6 +4058,14 @@ BlockMorph.prototype.scriptPic = function () {
|
||||||
return pic;
|
return pic;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
BlockMorph.prototype.clearAlpha = function () {
|
||||||
|
this.forAllChildren(m => {
|
||||||
|
if (m instanceof BlockMorph) {
|
||||||
|
delete m.alpha;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// BlockMorph drawing
|
// BlockMorph drawing
|
||||||
|
|
||||||
BlockMorph.prototype.render = function (ctx) {
|
BlockMorph.prototype.render = function (ctx) {
|
||||||
|
|
11
src/byob.js
11
src/byob.js
|
@ -108,7 +108,7 @@ BooleanSlotMorph, XML_Serializer, SnapTranslator*/
|
||||||
|
|
||||||
// Global stuff ////////////////////////////////////////////////////////
|
// Global stuff ////////////////////////////////////////////////////////
|
||||||
|
|
||||||
modules.byob = '2020-July-01';
|
modules.byob = '2020-July-24';
|
||||||
|
|
||||||
// Declarations
|
// Declarations
|
||||||
|
|
||||||
|
@ -1228,7 +1228,6 @@ CustomCommandBlockMorph.prototype.deleteBlockDefinition = function () {
|
||||||
method = this.isGlobal? this.definition
|
method = this.isGlobal? this.definition
|
||||||
: rcvr.getLocalMethod(this.blockSpec);
|
: rcvr.getLocalMethod(this.blockSpec);
|
||||||
block = method.blockInstance();
|
block = method.blockInstance();
|
||||||
block.addShadow();
|
|
||||||
new DialogBoxMorph(
|
new DialogBoxMorph(
|
||||||
this,
|
this,
|
||||||
() => {
|
() => {
|
||||||
|
@ -1264,7 +1263,13 @@ CustomCommandBlockMorph.prototype.deleteBlockDefinition = function () {
|
||||||
'Delete Custom Block',
|
'Delete Custom Block',
|
||||||
localize('block deletion dialog text'), // long string lookup
|
localize('block deletion dialog text'), // long string lookup
|
||||||
this.world(),
|
this.world(),
|
||||||
block.fullImage()
|
block.doWithAlpha(
|
||||||
|
1,
|
||||||
|
() => {
|
||||||
|
block.addShadow();
|
||||||
|
return block.fullImage();
|
||||||
|
}
|
||||||
|
)
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ StageMorph, SpriteMorph, StagePrompterMorph, Note, modules, isString, copy, Map,
|
||||||
isNil, WatcherMorph, List, ListWatcherMorph, alert, console, TableMorph, BLACK,
|
isNil, WatcherMorph, List, ListWatcherMorph, alert, console, TableMorph, BLACK,
|
||||||
TableFrameMorph, ColorSlotMorph, isSnapObject, newCanvas, Symbol, SVG_Costume*/
|
TableFrameMorph, ColorSlotMorph, isSnapObject, newCanvas, Symbol, SVG_Costume*/
|
||||||
|
|
||||||
modules.threads = '2020-July-22';
|
modules.threads = '2020-July-24';
|
||||||
|
|
||||||
var ThreadManager;
|
var ThreadManager;
|
||||||
var Process;
|
var Process;
|
||||||
|
@ -6114,7 +6114,13 @@ Context.prototype.image = function () {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ring.embed(block, this.inputs);
|
ring.embed(block, this.inputs);
|
||||||
return ring.doWithAlpha(1, () => ring.fullImage());
|
return ring.doWithAlpha(
|
||||||
|
1,
|
||||||
|
() => {
|
||||||
|
ring.clearAlpha();
|
||||||
|
return ring.fullImage();
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (this.expression instanceof Array) {
|
if (this.expression instanceof Array) {
|
||||||
block = this.expression[this.pc].fullCopy();
|
block = this.expression[this.pc].fullCopy();
|
||||||
|
|
|
@ -85,7 +85,7 @@ HTMLCanvasElement, fontHeight, SymbolMorph, localize, SpeechBubbleMorph,
|
||||||
ArrowMorph, MenuMorph, isString, isNil, SliderMorph, MorphicPreferences,
|
ArrowMorph, MenuMorph, isString, isNil, SliderMorph, MorphicPreferences,
|
||||||
ScrollFrameMorph, MenuItemMorph, Note*/
|
ScrollFrameMorph, MenuItemMorph, Note*/
|
||||||
|
|
||||||
modules.widgets = '2020-July-21';
|
modules.widgets = '2020-July-24';
|
||||||
|
|
||||||
var PushButtonMorph;
|
var PushButtonMorph;
|
||||||
var ToggleButtonMorph;
|
var ToggleButtonMorph;
|
||||||
|
@ -1351,7 +1351,15 @@ ToggleElementMorph.prototype.init = function (
|
||||||
// ToggleElementMorph drawing:
|
// ToggleElementMorph drawing:
|
||||||
|
|
||||||
ToggleElementMorph.prototype.render = function (ctx) {
|
ToggleElementMorph.prototype.render = function (ctx) {
|
||||||
var shading = !MorphicPreferences.isFlat || this.is3D;
|
var shading = !MorphicPreferences.isFlat || this.is3D,
|
||||||
|
shadow = () => {
|
||||||
|
if (shading) {
|
||||||
|
this.element.addShadow(
|
||||||
|
this.shadowOffset,
|
||||||
|
this.userState === 'normal' ? 0 : this.shadowAlpha
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
this.color = this.element.color;
|
this.color = this.element.color;
|
||||||
this.element.removeShadow();
|
this.element.removeShadow();
|
||||||
|
@ -1366,13 +1374,22 @@ ToggleElementMorph.prototype.render = function (ctx) {
|
||||||
this.element[this.builder](this.contrast);
|
this.element[this.builder](this.contrast);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (shading) {
|
if (this.element.doWithAlpha) {
|
||||||
this.element.addShadow(
|
ctx.drawImage(
|
||||||
this.shadowOffset,
|
this.element.doWithAlpha(
|
||||||
this.userState === 'normal' ? 0 : this.shadowAlpha
|
1,
|
||||||
|
() => {
|
||||||
|
shadow();
|
||||||
|
return this.element.fullImage();
|
||||||
|
}
|
||||||
|
),
|
||||||
|
0,
|
||||||
|
0
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
shadow();
|
||||||
|
ctx.drawImage(this.element.fullImage(), 0, 0);
|
||||||
}
|
}
|
||||||
ctx.drawImage(this.element.fullImage(), 0, 0);
|
|
||||||
|
|
||||||
// reset element
|
// reset element
|
||||||
this.element.removeShadow();
|
this.element.removeShadow();
|
||||||
|
|
Ładowanie…
Reference in New Issue