Assert when creating new footprint: wxRound(): argument out of supported range (lp:#1807676)

[Original report](https://bugs.launchpad.net/bugs/1807676) created by **eelik (eelik)**
```
I deleted the config files and now I got assert when I did this:

1. Open footprint editor (from the project view).
2. Resize the window (it's small by default).
3. Change the grid (from mils to some mm).
4. Try to create new footprint with the toolbar button.

../include/wx/math.h(151): assert "x > INT_MIN - 0.5 && x < INT_MAX + 0.5"
failed in wxRound(): argument out of supported range

#0 __GI___poll() at /build/glibc-
itYbWN/glibc-2.26/sysdeps/unix/sysv/linux/poll.c:29
#1 ??() at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2 g_main_loop_run() at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3 gtk_dialog_run() at /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#4 wxGUIAppTraits::ShowAssertDialog(wxString const&)() at
/usr/lib/x86_64-linux-gnu/libwx_gtk2u_core-3.0.so.0
#5 ??() at /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#6 wxAppConsoleBase::OnAssertFailure(wchar_t const*, int, wchar_t const*,
wchar_t const*, wchar_t const*)() at /usr/lib/x86_64-linux-
gnu/libwx_baseu-3.0.so.0
#7 wxApp::OnAssertFailure(wchar_t const*, int, wchar_t const*, wchar_t
const*, wchar_t const*)() at /usr/lib/x86_64-linux-
gnu/libwx_gtk2u_core-3.0.so.0
#8 ??() at /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#9 wxOnAssert(char const*, int, char const*, char const*, wchar_t const*)()
at /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#10 wxDCImpl::DeviceToLogicalY(int) const() at /usr/lib/x86_64-linux-
gnu/libwx_gtk2u_core-3.0.so.0
#11 wxDC::DeviceToLogicalY() at /usr/include/wx-3.0/wx/dc.h:1012
#12 EDA_DRAW_PANEL::SetClipBox() at
/work/ohjelmointi/kicad/kicad/common/legacy_wx/eda_draw_panel.cpp:545
#13 EDA_DRAW_PANEL::DoPrepareDC() at
/work/ohjelmointi/kicad/kicad/common/legacy_wx/eda_draw_panel.cpp:589
#14 FOOTPRINT_EDIT_FRAME::Process_Special_Functions() at
/work/ohjelmointi/kicad/kicad/pcbnew/footprint_editor_utils.cpp:240
#15 wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&,
wxEvtHandler*, wxEvent&)() at /usr/lib/x86_64-linux-
gnu/libwx_baseu-3.0.so.0
#16 wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*)() at
/usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#17 wxEvtHandler::TryHereOnly(wxEvent&)() at /usr/lib/x86_64-linux-
gnu/libwx_baseu-3.0.so.0
#18 EDA_BASE_FRAME::ProcessEvent() at
/work/ohjelmointi/kicad/kicad/common/eda_base_frame.cpp:173
#19 wxEvtHandler::DoTryChain(wxEvent&)() at /usr/lib/x86_64-linux-
gnu/libwx_baseu-3.0.so.0
#20 wxEvtHandler::ProcessEvent(wxEvent&)() at /usr/lib/x86_64-linux-
gnu/libwx_baseu-3.0.so.0
#21 wxWindowBase::TryAfter(wxEvent&)() at /usr/lib/x86_64-linux-
gnu/libwx_gtk2u_core-3.0.so.0
#22 wxAuiToolBar::OnLeftUp(wxMouseEvent&)() at /usr/lib/x86_64-linux-
gnu/libwx_gtk2u_aui-3.0.so.0
#23 wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&,
wxEvtHandler*, wxEvent&)() at /usr/lib/x86_64-linux-
gnu/libwx_baseu-3.0.so.0
#24 wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*)() at
/usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#25 wxEvtHandler::TryHereOnly(wxEvent&)() at /usr/lib/x86_64-linux-
gnu/libwx_baseu-3.0.so.0
#26 wxEvtHandler::ProcessEventLocally(wxEvent&)() at /usr/lib/x86_64-linux-
gnu/libwx_baseu-3.0.so.0
#27 wxEvtHandler::ProcessEvent(wxEvent&)() at /usr/lib/x86_64-linux-
gnu/libwx_baseu-3.0.so.0
#28 wxEvtHandler::SafelyProcessEvent(wxEvent&)() at /usr/lib/x86_64-linux-
gnu/libwx_baseu-3.0.so.0
#29 ??() at /usr/lib/x86_64-linux-gnu/libwx_gtk2u_core-3.0.so.0
#30 ??() at /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#31 g_closure_invoke() at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#32 ??() at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#33 g_signal_emit_valist() at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#34 g_signal_emit() at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#35 ??() at /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#36 gtk_propagate_event() at /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#37 gtk_main_do_event() at /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#38 ??() at /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0
#39 g_main_context_dispatch() at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#40 ??() at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#41 g_main_loop_run() at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#42 gtk_main() at /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#43 wxGUIEventLoop::DoRun()() at /usr/lib/x86_64-linux-
gnu/libwx_gtk2u_core-3.0.so.0
#44 wxEventLoopBase::Run()() at /usr/lib/x86_64-linux-
gnu/libwx_baseu-3.0.so.0
#45 wxAppConsoleBase::MainLoop()() at /usr/lib/x86_64-linux-
gnu/libwx_baseu-3.0.so.0
#46 APP_KICAD::OnRun() at /work/ohjelmointi/kicad/kicad/kicad/kicad.cpp:256
#47 wxEntry(int&, wchar_t**)() at /usr/lib/x86_64-linux-
gnu/libwx_baseu-3.0.so.0
#48 main() at /work/ohjelmointi/kicad/kicad/kicad/kicad.cpp:287


Application: kicad
Version: (6.0.0-rc1-dev-1353-gdd9a00107), debug build
Libraries:
    wxWidgets 3.0.3
Platform: Linux 4.13.0-46-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.3 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.62.0
    OpenCASCADE Community Edition: 6.8.0
    Compiler: GCC 7.2.0 with C++ ABI 1011

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=OFF
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=OFF
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=OFF
```
Original tags: pcbnew

Story points: 6.0