EEschema invalid clipping region after undoing move block

Bug #1803038 reported by Aleksandr Sh on 2018-11-13
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Medium
Jeff Young

Bug Description

1. Open demo "interf_u.pro" for example
2. Select multiple components with a rectangle
3. Move them somewhere and place
4. Undo
5. The clipping region become incorrect. Some buses and traces become invisible while on the screen. See screenshot.

Application: kicad
Version: (6.0.0-rc1-dev-1168-gacfa13c03), release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.61.1 OpenSSL/1.1.1 (WinSSL) zlib/1.2.11 brotli/1.0.6 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) nghttp2/1.34.0
Platform: Windows 8 (build 9200), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8)
    Boost: 1.68.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.61.1
    Compiler: GCC 8.2.0 with C++ ABI 1013

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=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Aleksandr Sh (dsa-t) wrote :
Aleksandr Sh (dsa-t) wrote :

Apart from that, buses sometimes disappear even in the clipping region. Fixed by dragging something.

Wayne Stambaugh (stambaughw) wrote :

I have confirmed that this definitely happens. It only seems to effect the bus visibility. I've attached a screen recording of the issue.

Changed in kicad:
status: New → Triaged
importance: Undecided → Low
milestone: none → 5.1.0
Aleksandr Sh (dsa-t) wrote :

Still happening in

Application: kicad
Version: (6.0.0-rc1-dev-1291-g61b749f0b), release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.61.1 OpenSSL/1.1.1 (WinSSL) zlib/1.2.11 brotli/1.0.6 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) nghttp2/1.34.0
Platform: Windows 8 (build 9200), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8)
    Boost: 1.68.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.61.1
    Compiler: GCC 8.2.0 with C++ ABI 1013

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=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Seth Hillbrand (sethh) wrote :

I do not observe this behavior with Linux, current master.

Is it still reproducible on MSW?

Application: kicad
Version: (6.0.0-rc1-dev-1380-g222c9a401), release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.62.0 OpenSSL/1.1.1a zlib/1.2.11 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) libssh2/1.8.0 nghttp2/1.34.0 librtmp/2.3
Platform: Linux 4.18.0-3-amd64 x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.67.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.62.0
    Compiler: GCC 8.2.0 with C++ ABI 1013

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=OFF
    KICAD_SCRIPTING_MODULES=OFF
    KICAD_SCRIPTING_PYTHON3=OFF
    KICAD_SCRIPTING_WXPYTHON=OFF
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
    KICAD_SCRIPTING_ACTION_MENU=OFF
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Yes, I am still seeing that.

Aleksandr Sh (dsa-t) wrote :

I can even make components disappear sometimes if I rotate it, then cancel, even in Fallback mode in the latest nightly. The demo is pic_programmer.sch.

Application: kicad
Version: (6.0.0-rc1-dev-1419-g1d230bbee), release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.61.1 OpenSSL/1.1.1 (WinSSL) zlib/1.2.11 brotli/1.0.6 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) nghttp2/1.34.0
Platform: Windows 8 (build 9200), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8)
    Boost: 1.68.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.61.1
    Compiler: GCC 8.2.0 with C++ ABI 1013

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=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Jeff Young (jeyjey) on 2018-12-21
Changed in kicad:
assignee: nobody → Jeff Young (jeyjey)
status: Triaged → Fix Committed
importance: Low → Medium

@Jeff,

Unfortunately, the commit 6eca924 does not fix this issue.
After undoing a block move, some items are still not always shown (depending on the zoom level and the position on screen)

note also if I execute a move item, the undo the move, the previously not shown items become visible.

Changed in kicad:
status: Fix Committed → Triaged
Jeff Young (jeyjey) wrote :

@JP, I can't reproduce that. Any particular steps required?

Also, try a Refresh after the item disappears. That'll tell us if it's RTree related. (The bugs so far were actually hidden-flag related, not RTree.)

@Jeff,

A Refresh after the item disappears fixes the issue.

A call to HardRedraw() at the end of SCH_EDIT_FRAME::PutDataInPreviousState() fixes the issue on my install.

Jeff Young (jeyjey) wrote :

@JP, that's a pretty big hammer (although the UpdateAllItems( KIGFX::ALL ) is as well, so it may be called for).

Can you try with just a RemoveFromScreen() / AddToScreen() pair around the SwapData() call in the UR_CHANGED case and see if that fixes it?

If not, you should be able to remove the UpdateAllItems() call with the HardRedraw()....

@Jeff,
Adding the RemoveFromScreen() / AddToScreen() pair fixes the issue.
It must be added to all other cases, not only UR_CHANGED, to fully fix this issue.

Thanks.

Jeff Young (jeyjey) wrote :

@JP, OK, so definitely the RTree.

I've rewritten that routine a bit to always (well, except in the cases of UR_DELETED and UR_NEW) do both a remove and an add, and removed the medium-big hammer (UpdateAllItems()) at the end.

Seems to work for me, but then the last one did too, so if you could test it a bit that would be great.

@Jeff,

This last change works fine for me.
Thanks.

Tomasz Wlostowski (twlostow) wrote :

@Jeff, I don't believe calling UpdateAllItems() would have big impact on eeschema's performance given the graphical complexity of even complex schematics. In v6 we'll have view item updates in eeschema handled automagically (as in pcbnew), so I wouldn't spend too much time on this bug for now.

PS. I don't see the clipping issue anymore on today's nightly.

Yeah, I think it’s fixed.

I’m not entirely sure why doing the remove/add in the undo routine fixes it. The UpdateAllItems() that used to run at the end does an update bbox, which does a remove/add. The only thing I can think of is that the remove needs to get called on the old bbox for some reason, but I didn’t dig into it….

Cheers,
Jeff.

> On 24 Dec 2018, at 16:36, Tomasz Wlostowski <email address hidden> wrote:
>
> @Jeff, I don't believe calling UpdateAllItems() would have big impact on
> eeschema's performance given the graphical complexity of even complex
> schematics. In v6 we'll have view item updates in eeschema handled
> automagically (as in pcbnew), so I wouldn't spend too much time on this
> bug for now.
>
> PS. I don't see the clipping issue anymore on today's nightly.
>
> --
> You received this bug notification because you are a bug assignee.
> https://bugs.launchpad.net/bugs/1803038
>
> Title:
> EEschema invalid clipping region after undoing move block
>
> Status in KiCad:
> Triaged
>
> Bug description:
> 1. Open demo "interf_u.pro" for example
> 2. Select multiple components with a rectangle
> 3. Move them somewhere and place
> 4. Undo
> 5. The clipping region become incorrect. Some buses and traces become invisible while on the screen. See screenshot.
>
> Application: kicad
> Version: (6.0.0-rc1-dev-1168-gacfa13c03), release build
> Libraries:
> wxWidgets 3.0.4
> libcurl/7.61.1 OpenSSL/1.1.1 (WinSSL) zlib/1.2.11 brotli/1.0.6 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) nghttp2/1.34.0
> Platform: Windows 8 (build 9200), 64-bit edition, 64 bit, Little endian, wxMSW
> Build Info:
> wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8)
> Boost: 1.68.0
> OpenCASCADE Community Edition: 6.9.1
> Curl: 7.61.1
> Compiler: GCC 8.2.0 with C++ ABI 1013
>
> 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=ON
> KICAD_USE_OCE=ON
> KICAD_USE_OCC=OFF
> KICAD_SPICE=ON
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/kicad/+bug/1803038/+subscriptions

KiCad Janitor (kicad-janitor) wrote :

Fixed in revision 10887868dcc533846694bfc471b2917a196d3823
https://git.launchpad.net/kicad/patch/?id=10887868dcc533846694bfc471b2917a196d3823

Changed in kicad:
status: Triaged → Fix Committed
Changed in kicad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers