fixed overlapping blocks bug in unified palette

snap7
jmoenig 2021-07-16 12:48:48 +02:00
rodzic 1859b4a1bf
commit a04fcd5434
2 zmienionych plików z 5 dodań i 3 usunięć

Wyświetl plik

@ -33,6 +33,7 @@
* readme update, thanks, Michael!
* objects, gui: rearranged internal order of categories
* byob: rearranged internal order of categories
* objects: fixed overlapping blocks bug in unified palette
### 2021-07-15
* gui: made sprite-bar height independent of the number of categories

Wyświetl plik

@ -3160,7 +3160,7 @@ SpriteMorph.prototype.freshPalette = function (category) {
hideNextSpace = true;
} else if (block === '#') {
x = 0;
y = ry;
y = (ry === 0 ? y : ry);
} else {
hideNextSpace = false;
if (x === 0) {
@ -3168,8 +3168,9 @@ SpriteMorph.prototype.freshPalette = function (category) {
}
block.setPosition(new Point(x, y));
palette.addContents(block);
if (block instanceof ToggleMorph
|| (block instanceof RingMorph)) {
if (block instanceof ToggleMorph) {
x = block.right() + unit / 2;
} else if (block instanceof RingMorph) {
x = block.right() + unit / 2;
ry = block.bottom();
} else {