Add Zone cutout doesn't check that it has a point in the zone
Description
After creating a filled zone, we can add a zone cutout using the hotkey (default Shift-C). If the zone cutout doesn't overlap the originally-selected zone, we clear the whole zone and it is difficult to fix without reloading.
Steps to reproduce
- Create a filled zone.
- With the filled zone selected, move your mouse outside of the zone area
- Create a cutout that doesn't overlap the original zone outline
KiCad Version
Application: Pcbnew
Version: (5.99.0-3190-g7b05e456c-dirty), debug build
Libraries:
wxWidgets 3.0.5
Platform: Linux 5.7.0-3-amd64 x86_64, 64 bit, Little endian, wxGTK
wxWidgets: 3.0.5 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
Boost: 1.71.0
OCC: 7.4.0
Curl: 7.72.0
ngspice: 32
Compiler: GCC 10.2.0 with C++ ABI 1014
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_OCC=ON
KICAD_SPICE=ON
KICAD_STDLIB_DEBUG=ON
KICAD_SANITIZE=OFF