Skip to content

Commit 413cf48

Browse files
authored
fix tileset duplicate and rendering of gallery tiles (microsoft#10924)
1 parent 0886e7e commit 413cf48

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎pxtblocks/fields/field_tileset.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export class FieldTileset extends FieldImages implements FieldCustom {
7474
src: FieldTileset.getTileImage(tile),
7575
width: PREVIEW_SIDE_LENGTH,
7676
height: PREVIEW_SIDE_LENGTH,
77-
alt: displayName(tile)
77+
alt: displayName(tile) || tile.id
7878
}, tile.id, tile])
7979
}
8080

@@ -167,7 +167,7 @@ export class FieldTileset extends FieldImages implements FieldCustom {
167167
src: bitmapToImageURI(pxt.sprite.Bitmap.fromData(tile.bitmap), PREVIEW_SIDE_LENGTH, false),
168168
width: PREVIEW_SIDE_LENGTH,
169169
height: PREVIEW_SIDE_LENGTH,
170-
alt: displayName(tile)
170+
alt: displayName(tile) || tile.id
171171
}, this.value_, tile]
172172
}
173173
}
@@ -247,6 +247,8 @@ export class FieldTileset extends FieldImages implements FieldCustom {
247247
return null;
248248
}
249249

250+
this.localTile = undefined;
251+
250252
return newValue;
251253
}
252254

@@ -261,7 +263,7 @@ export class FieldTileset extends FieldImages implements FieldCustom {
261263
src: bitmapToImageURI(pxt.sprite.Bitmap.fromData(this.localTile.bitmap), PREVIEW_SIDE_LENGTH, false),
262264
width: PREVIEW_SIDE_LENGTH,
263265
height: PREVIEW_SIDE_LENGTH,
264-
alt: displayName(this.localTile)
266+
alt: displayName(this.localTile) || this.localTile.id
265267
},
266268
this.localTile.id,
267269
this.localTile

0 commit comments

Comments
 (0)