tiled icon indicating copy to clipboard operation
tiled copied to clipboard

Incorrect redrawing of oversized Tile Collision Shapes

Open eishiya opened this issue 1 year ago • 1 comments

When "Show Tile Collisions Shapes" is enabled, the redraw area for the brush is based only on the tiles and does not include the collision that may stick out of the tiles. In this screenshot, I'm drawing with a 16x16 tile that has a 32x32 collision rectangle. Notice how the brush preview only shows the top left part of the collision, and how there are a bunch of trails left of the other parts of the collision rectangle where I moved my cursor around. The top left of the map contains a single correctly rendered tile+collision, I achieved this by drawing the tile, then changing the zoom to rerender the entire map. image

I am using 1.9.0, Win10 64-bit, but I imagine this is a much older issue that's got unnoticed because collisions don't normally go beyond the tile's edges.

Edit: Disabling "Show Tile Collision Shapes" after having created a bunch of these glitches doesn't clear all of them, looks like only the chunks with tiles are redrawn: image

eishiya avatar Aug 09 '22 14:08 eishiya

Yeah, this is quite an annoying issue to resolve. Essentially the margins used to calculate the area to repaint will need to take into account how far any collision shapes are extending beyond the edge of each tile. Currently, this is only handled for tile objects (in MapObjectItem::expandBoundsToCoverTileCollisionObjects), but not for tiles.

bjorn avatar Aug 11 '22 07:08 bjorn