Skip to content

PCBnew - Moving footprint, snaps to its own graphical elements rather than Grid

Description

In PCBnew, when I move a footprint containing graphical elements (lines drawn on Silkscreen, Fab, Drawing etc layers), the anchor tries to snap to the footprint's own graphical elements instead of the Grid.

This results in a "tremor" of the footprint being moved, a wrong, off-grid placement if you don't pay close attention (if the graphical elements are tiny and/or close to the anchor of the footprint), and sometimes avoid to place on the Grid itself as the footprint skips the Grid and snaps on something else.

If the footprint has a lot of details on its graphical layers, the move feels like almost continuous, as if there was no Snap-to-Grid at all.

If the layers are hidden, the footprint correctly snaps to the Grid.

Also, once the Footprint has been moved sufficiently far away from its original position, the behavior disappears.

The problem has been discussed in forum here: https://forum.kicad.info/t/moving-footprint-with-f-fab-doesnt-snap-to-grid/39783

Please find here a video showing the problem: 2023-01-26_08-56-09.mkv

Here, the Footprint is rather simple: two lines on F.Silkscreen and a rectangle on F.Courtyard.

  1. You can see at 00:08 that the footprint snaps to the F.Silkscreen line.
  2. At 00:57 the F.Silkscreen layer is hidden, and the footprint now doesn't snap anymore to F.Silkscreen but one last off-Grid point.
  3. At 01:08 F.Courtyard is hidden and the footprint now correctly snaps to the Grid.

The problem can be better reproduced if the Grid is slightly larger than the footprint.

Steps to reproduce

  1. Open PCBnew, and add a footprint containing graphical elements on F.Silkscreen for example. (only lines have been tested yet)
  2. (Activate the Snap to Grid functionality in Preferences).
  3. Hover the footprint, strike "M" (or right click on footprint and select "Move" command)
  4. Drag (move) the footprint in any direction, and while the mouse cursor hovers the original footprint area, the footprint should tremor (dither)
  5. And if you click to place the footprint to a new position within that area, it will probably snap to an off-grid position.

KiCad Version

Application: KiCad PCB Editor

Version: 6.0.10-86aedd382b~118~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-137-generic x86_64, 64 bit, Little endian, wxGTK, xubuntu, x11

Build Info:
	Date: Dec 18 2022 19:39:35
	wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
	Boost: 1.71.0
	OCC: 7.5.2
	Curl: 7.86.0
	ngspice: 36
	Compiler: GCC 9.4.0 with C++ ABI 1013

Build settings:
	KICAD_USE_OCC=ON
	KICAD_SPICE=ON