Cleanup graphics (make rectangle) wrong delete lines
Because the new "draw rectangle" tool at Footprint editor it is provided a "Cleanup graphics..." to erase duplicated lines and make connected lines rectangles.
But it algorithm is not considering "rectangles" that have a lateral by two partial lines. Not just this, in this specific case, it erase line lines of the checked rectangle. It get wrong in two cases:
Steps to reproduce
Open the attached "footprint" example RJ45-female_V2.kicad_mod;
Check the "Partial lines at a lateral" example (the others appear fine;
a. (Case a on the draws) have one lateral by two lines (end of first coincident with begin of second) -> It delete some laterals;
b. (Case b on the draws) have a lateral by two lines but begin of the second is before the end of the first line (they have a partial coincident segment) -> The final rectangle is not the size of the "original one".
Application: ModEdit Version: 5.99.0-unknown-bb1afb7~88~ubuntu20.04.1, release build Libraries: wxWidgets 3.0.4 libcurl/7.68.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3 Platform: Linux 5.4.0-39-generic x86_64, 64 bit, Little endian, wxGTK Build Info: Build date: Jun 30 2020 15:18:36 wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24 Boost: 1.71.0 OCE: 6.9.1 Curl: 7.68.0 Compiler: GCC 9.3.0 with C++ ABI 1013 Build settings: KICAD_SCRIPTING=ON KICAD_SCRIPTING_MODULES=ON KICAD_SCRIPTING_PYTHON3=ON KICAD_SCRIPTING_WXPYTHON=ON KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON KICAD_SCRIPTING_ACTION_MENU=ON BUILD_GITHUB_PLUGIN=ON KICAD_USE_OCE=ON KICAD_SPICE=ON