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

Bugs that are actually features.
robot256
Smart Inserter
Smart Inserter
Posts: 1145
Joined: Sun Mar 17, 2019 1:52 am
Contact:

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

Post 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 327 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 327 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).
Rseding91
Factorio Staff
Factorio Staff
Posts: 15335
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post 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 168 times
If you want to get ahold of me I'm almost always on Discord.
robot256
Smart Inserter
Smart Inserter
Posts: 1145
Joined: Sun Mar 17, 2019 1:52 am
Contact:

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

Post 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!
Post Reply

Return to “Not a bug”