Hey there, I'm currently working on developing my own catalog and I'm in the process of creating a selection tool to allow users to zoom in on a specific part of an image. If you're interested, you can check out the project here.
However, I seem to have hit a roadblock with my logic when it comes to resizing the selection box while dragging from the bottom right corner to the top left. I realized that the issue lies in how the box is currently positioned, as positioning is typically based on the top left corner. I've been exploring a couple of solutions, but haven't made much progress.
One approach I considered was finding a way to position the box relative to its bottom right corner.
Another idea I've been experimenting with is adjusting the box's position by its height and width to potentially achieve a bottom right position.
If you're interested in checking out the JavaScript related to this project, you can find it here.
If anyone has any suggestions or guidance on how to tackle this problem, I would greatly appreciate it.
Thanks,
Levi