biigle / core

:large_blue_circle: Application core of BIIGLE
https://biigle.de
GNU General Public License v3.0
12 stars 15 forks source link

Ignore zero-sized rectangles #763

Closed mzur closed 6 months ago

mzur commented 8 months ago

We found out that some people are drawing lots of rectangles with zero size (i.e. all four points have the same coordinates. These rectangles should be ignored in the UI and not sent to the backend.

Also try to reproduce why this happens. Maybe people double-click when creating or finishing a rectangle? Then we should catch that, too.

lehecht commented 8 months ago

Should there be a message box when a user tries to create invalid shapes in general? Because there is just one for invalid polygons.

mzur commented 8 months ago

This depends on how these zero-rectangles are created. If they are created involuntarily (e.g. a user draws a valid rectangle, then makes a double-click and thereby creates a second zero-rectangle) then I would say this should just be silently ignored. If zero-rectangles can only be created "intentionally" by clicking three times in a row on the same spot then maybe we should show a warning.

neopaulit4n commented 7 months ago

I am one of the users experiencing the zero-sized rectangles. I notice this happens whenever I start drawing a polygon using a straight horizontal line only. If I start drawing with a vertical or diagonal line, it never has this issue. However, starting to draw the polygon with a perfectly horizontal line then clicking the first time to set it causes the blue dashed drawing line to disappear every time. Nothing happens until you click again anywhere on the image (where you would normally want to draw the height of the polygon and complete the rectangle) and then an annotation appears in the annotations list, but the bounding box is invisible in the image itself.

mzur commented 7 months ago

Thanks for the info @neopaulit4n! As I mentioned in the user meeting, I believe we fixed a similar bug that you describe in the past. @lehecht can you please check if you can reproduce this? Or will this be resolved with https://github.com/biigle/core/pull/769?

lehecht commented 7 months ago

Unfortunately, I couldn't reproduce this bug. But with #769 everything seems to work. I can draw polygons like @neopaulit4n described without any problems or weird behaviour.