tiled icon indicating copy to clipboard operation
tiled copied to clipboard

Status Bar pixel coord is rounded rather than floored for orthogonal maps

Open howprice opened this issue 8 months ago • 2 comments

Describe the bug The integer pixel coordinates displayed in the Tiled status bar are incorrect for object layers. The numbers appear to be rounded to nearest rather than floored. This can lead to a lot of confusion when debugging placements by moving the mouse and looking at the coord.

To Reproduce

  1. New Map
  2. Orthogonal
  3. Place a tile at (0,0) in the default tile layer in which each pixel is obvious e.g. checkerboard pattern, zoom in on it.
  4. Add an Object Layer
  5. Select the object layer
  6. Select Select Objects (S)
  7. Move the mouse pointer around in the top left pixel. It can be seen that the Pixel Coord in the Status Bar changes from (0,0), (0,1), (1,0), and (1,1) depending on which quadrant of the pixel the mouse is pointing at.

Expected behavior In Step 7 above, the Pixel Coordinate in the Status bar should always read (0,0). It would make sense to floor the float/double pixel coord instead of rounding it in this case.

More discussion here: https://discord.com/channels/524610627545595904/524610627545595906/1164211436206182532

Media image

(Apologies that screen capture does not capture the pointer, so drawn in manually!)

Specifications:

  • OS: Windows 10
  • Tiled Version: 2023.08.03

howprice avatar Oct 19 '23 08:10 howprice