mchlnix / SMB3-Foundry

SMB3 Level Editor in Python
GNU General Public License v3.0
91 stars 12 forks source link

Resizing objects doesn't take their width/height into consideration #193

Open mchlnix opened 5 months ago

mchlnix commented 5 months ago

For objects that expand more than 1 block per index (best example pipe boxes) the resizing seems confusing.

When we resize we take the distance of the cursor to the x,y position of the object, with every block difference meaning one index different.

But when an object grows an entire screen, like the pipe boxes, with every index, we have a problem.

Resizing a Pipebox of size '1', which shows as 16 blocks, means as soon as we move the cursor on block to the right, it is now 15 units, aka 15 indexes aka 15 * 16 blocks long.

This isn't a problem for most objects, which only get longer by one or maybe 2 blocks per index, but for bigger ones (maybe even only the pipebox) it's a problem.

Let's see if we can find/calculate the "length per index" of objects and resize them correctly.