Page 1 of 1

[2.0.14] Rail signal selection_box shifts incorrectly when not on tile edges

Posted: Mon Nov 04, 2024 4:34 pm
by robot256
When using selection_box to produce an asymmetric selection area, the actual selection box is different than the entered values specifically when the boundaries are not on tile edges. In these cases, the highlight box accuratly reflects the mouse-selectable area, so this is a different bug than viewtopic.php?f=7&t=119778

Example:
With selection_box = {{-1.5, -0.5}, {-0.5, 0.5}} (and selection_box_shift = 0,0), the selection rectangle is shifted by 1.0 tiles as expected. (East orientation shown)
Screenshot 2024-11-03 200332_2.png
Screenshot 2024-11-03 200332_2.png (62.43 KiB) Viewed 411 times
I then tried to make the box a little smaller than a full tile. I set selection_box = {{-1.35, -0.65}, {-0.35, 0.35}} (selection_box_shift is still 0,0). The total width of the box should be 0.7x0.7 tiles and the center should still be offset by 1.0. But the result I get is the following:
Screenshot 2024-11-03 200834.png
Screenshot 2024-11-03 200834.png (164.7 KiB) Viewed 411 times
The box is still 1.0x1.0 tiles wide, and the center has been shifted by (0.15, 0.15). This happens in all four cardinal directions (the diagonals have other issues as I reported).

Re: [2.0.14] Rail signal selection_box shifts incorrectly when not on tile edges

Posted: Wed Mar 05, 2025 6:11 pm
by Rseding91
Thanks for the report however I'm not seeing any bug here. Your bounding box definition of

Code: Select all

{{-1.35, -0.65}, {-0.35, 0.35}}
matches perfectly what you're showing: a 1x1 box moved left 1 tile and up 15% of a tile (and then rotated 90 degrees).
Untitled.png
Untitled.png (241.92 KiB) Viewed 252 times

Re: [2.0.14] Rail signal selection_box shifts incorrectly when not on tile edges

Posted: Wed Mar 05, 2025 7:00 pm
by robot256
Thank you for pointing out my mistake. Somehow I had convinced myself that the box definition was {{x1, x2}, {y1, y2}} when it is actually {{x1, y1}, {x2, y2}}. I will fix this and try again. Cheers!