kopia lustrzana https://github.com/backface/turtlestitch
updated byob.js for new internal categories ordering
rodzic
78da81e104
commit
1859b4a1bf
|
@ -32,6 +32,7 @@
|
|||
* palette hiding/showing primitives fixes, tanks, Michael!
|
||||
* readme update, thanks, Michael!
|
||||
* objects, gui: rearranged internal order of categories
|
||||
* byob: rearranged internal order of categories
|
||||
|
||||
### 2021-07-15
|
||||
* gui: made sprite-bar height independent of the number of categories
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<script src="src/gui.js?version=2021-07-16"></script>
|
||||
<script src="src/paint.js?version=2021-07-05"></script>
|
||||
<script src="src/lists.js?version=2021-07-05"></script>
|
||||
<script src="src/byob.js?version=2021-07-06"></script>
|
||||
<script src="src/byob.js?version=2021-07-16"></script>
|
||||
<script src="src/tables.js?version=2021-05-07"></script>
|
||||
<script src="src/sketch.js?version=2021-07-05"></script>
|
||||
<script src="src/video.js?version=2019-06-27"></script>
|
||||
|
|
15
src/byob.js
15
src/byob.js
|
@ -108,7 +108,7 @@ WatcherMorph, XML_Serializer, SnapTranslator, SnapExtensions*/
|
|||
|
||||
// Global stuff ////////////////////////////////////////////////////////
|
||||
|
||||
modules.byob = '2021-July-06';
|
||||
modules.byob = '2021-July-16';
|
||||
|
||||
// Declarations
|
||||
|
||||
|
@ -1811,7 +1811,9 @@ BlockDialogMorph.prototype.addCategoryButton = function (category) {
|
|||
var labelWidth = 75,
|
||||
colors = [
|
||||
IDE_Morph.prototype.frameColor,
|
||||
IDE_Morph.prototype.frameColor.darker(MorphicPreferences.isFlat ? 5 : 50),
|
||||
IDE_Morph.prototype.frameColor.darker
|
||||
(MorphicPreferences.isFlat ? 5 : 50
|
||||
),
|
||||
SpriteMorph.prototype.blockColor[category]
|
||||
],
|
||||
button;
|
||||
|
@ -1869,8 +1871,13 @@ BlockDialogMorph.prototype.fixCategoriesLayout = function () {
|
|||
|
||||
this.categories.children.forEach(button => {
|
||||
i += 1;
|
||||
row = Math.ceil(i / 2);
|
||||
col = 2 - (i % 2);
|
||||
if (i < 8) {
|
||||
row = 1 + ((i - 1) % 4);
|
||||
col = i < 5 ? 1 : 2;
|
||||
} else {
|
||||
row = Math.ceil(i / 2);
|
||||
col = 2 - (i % 2);
|
||||
}
|
||||
button.setPosition(new Point(
|
||||
l + (col * xPadding + ((col - 1) * buttonWidth)),
|
||||
t + (row * yPadding + ((row - 1) * buttonHeight) + border)
|
||||
|
|
Ładowanie…
Reference in New Issue