Bug with crop and inverted "black" tile

This is a weird one! If I use crop to crop the visible part of the room I expect the screen area outside of that to be tiled with the default “black” tile. Usually this works correctly. However if I invert the “black” tile (so that it is actually all white pixels) then in the simulator and on device the player tile is tiled outside of the crop area instead! This bug is not present in the browser player.

Here is how it should look, taken from the browser:

and here is the bug on simulator (which is the same as on device):

Here is a minimal PDX that recreates the bug (source code included within):

JBKFPNWMJICrop-Bug_20251020131554.zip (31.5 KB)

There are two workarounds I can use in the meantime, neither of which are ideal:

  1. Use fill to draw white over the cropped area
  2. Use invert so an actually black “black” tile appears white

Option 1 is unnecessary performance overhead and option 2 means I have to invert every tile in the editor which is awkward to work with.

I’ve solved this and (probably) worked out the problem! tl;dr I inverted the “white” tile to be black.

I suspect this is related to the deduplication of tiles with the same appearance that is now done following one of the Pulp updates. By inverting just “black” to appear fully white it was then matching the default “white” tile. I think it was then the combination of that deduplication and “black” being used to fill the cropped area that results in the bug. By inverting the “white” tile “black” is not de-duped and it works as expected.