added "width" and "height" to the MY blocks dropdown

pull/89/head
jmoenig 2019-05-02 12:32:04 +02:00
rodzic cbc06cef80
commit 2e8b5e9d76
4 zmienionych plików z 18 dodań i 2 usunięć

Wyświetl plik

@ -30,6 +30,7 @@
* new "for" loop and "if then else" reporter primitives in the Control category
* added "neg", "lg" (log2) and "2^" selectors to monadic function reporter in Operators
* added "^" reporter (power of) in the Operators category
* added "width" and "height" to the MY blocks dropdown
* added "width" and "height" as attribute selectors of the OF primitive for the stage
* added "costume" selector to the MY attributes dropdown
* special context-aware drop-downs for custom blocks
@ -76,6 +77,7 @@
### 2019-05-02
* Blocks: reordered MY block dropdown by data type
* Blocks, Threads: added "width" and "height" to the MY blocks dropdown
### 2019-04-30
* Blocks, Threads: added "id" to image attributes dropdown

Wyświetl plik

@ -7,7 +7,7 @@
<script type="text/javascript" src="src/morphic.js?version=2019-02-07"></script>
<script type="text/javascript" src="src/widgets.js?version=2019-04-05"></script>
<script type="text/javascript" src="src/blocks.js?version=2019-05-02"></script>
<script type="text/javascript" src="src/threads.js?version=2019-04-30"></script>
<script type="text/javascript" src="src/threads.js?version=2019-05-02"></script>
<script type="text/javascript" src="src/objects.js?version=2019-04-30"></script>
<script type="text/javascript" src="src/gui.js?version=2019-04-27"></script>
<script type="text/javascript" src="src/paint.js?version=2019-02-22"></script>

Wyświetl plik

@ -8878,6 +8878,8 @@ InputSlotMorph.prototype.gettablesMenu = function () {
}
// numbers
dict.width = ['width'];
dict.height = ['height'];
dict['rotation style'] = ['rotation style'];
dict['rotation x'] = ['rotation x'];
dict['rotation y'] = ['rotation y'];

Wyświetl plik

@ -62,7 +62,7 @@ StageMorph, SpriteMorph, StagePrompterMorph, Note, modules, isString, copy,
isNil, WatcherMorph, List, ListWatcherMorph, alert, console, TableMorph, Color,
TableFrameMorph, ColorSlotMorph, isSnapObject, Map, newCanvas, Symbol*/
modules.threads = '2019-April-30';
modules.threads = '2019-May-02';
var ThreadManager;
var Process;
@ -4108,6 +4108,18 @@ Process.prototype.reportGet = function (query) {
return thisObj.reportCostumes();
case 'sounds':
return thisObj.sounds;
case 'width':
if (thisObj instanceof StageMorph) {
return thisObj.dimensions.x;
}
stage = thisObj.parentThatIsA(StageMorph);
return thisObj.width() / stage.scale;
case 'height':
if (thisObj instanceof StageMorph) {
return thisObj.dimensions.y;
}
stage = thisObj.parentThatIsA(StageMorph);
return thisObj.height() / stage.scale;
}
}
return '';