Add m_hasPendingItemUpdates to VIEW so UpdateItems() can
return immediately when no item has queued update flags.
The flag is set wherever m_requiredUpdate is modified and
cleared at the end of UpdateItems().
In DoRePaint(), check the new flag alongside IsDirty() and
cursor movement to skip both item processing and the GL
draw cycle when nothing has changed. Route onPaint through
Refresh() so the existing frame-rate throttle applies to
native paint events as well.
Replace wxCHECK_MSG assertion with a graceful early return and trace
log. Items can end up associated with a different view during teardown
or when moved between views, which is not a fatal error.
Fixes KICAD-72D
Previously, horizontal mouse wheel events (from tilt wheels, side-button
scroll combos, or touchpads) were gated by the m_horizontalPan setting.
When this setting was false (the default), these events were silently
consumed without any visible effect. This caused mice like the Logitech
Lift that use driver-level side-button + scroll wheel remapping to
horizontal scroll to appear broken in KiCad.
The m_horizontalPan setting was originally introduced to block spurious
horizontal scroll events from certain mice, but that issue was separately
addressed by restricting zoom handling to the vertical axis only.
Native horizontal wheel events are now always processed as horizontal
panning, consistent with how other KiCad components (3D viewer, mathplot)
already handle them. The scrolling else-branch is simplified since it
now only handles vertical scroll events.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/23038
VIEW::Clear() will set the view to nullptr. When we then remove the
items afterward, we still want to allow full removal as long as we know
the view is ours or has been released by Clear()
VIEW::Clear() did not invalidate the viewPrivData for items before clearing
internal data structures. When a selection tool's Reset() added its m_selection
VIEW_GROUP to the view before Clear() was called, the m_selection retained a
stale m_viewPrivData->m_view pointer after clearing. Then, when reloading files
the selection tool tried to remove and re-add m_selection, leaving a stale reference
The fix invalidates viewPrivData->m_view for all items before clearing,
ensuring persistent items like selection groups won't have dangling references.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/22755
We don't need a full repaint for items when selected, just update
colors. Selected mode doesn't require hiding the existing items, we
just need to repaint them in a new color. Then we can use the cached
elements
Fixes https://gitlab.com/kicad/code/kicad/-/issues/22591
We detect mouse movement by checking if the screen position is not the
keyboard position and if not, we clear the
m_lastKeyboardCursorPositionValid that is used for detemining keyboard
movement in snaps
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21981
This is a zero-dimensional object that can be used for snapping
and documentation of useful, but non-physical features on a
board or footprint. They do not correspond to any physical
output in exports or plots.
Points do have a "size", but this is a graphical property only
and determines how large they are drawn on the board.
They also have a layer, which allows them to be selected and
made visible according to layer filters.
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/4691
ViewGetLayers returns the item layer even if it is invalid. We filter
this out at the base and skip items that cannot be displayed in the
view.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21368
Saves a mishmash of local HIDE/SHOW defs along with various literals.
Also provide a function that computes the scale at which a given
IU size becomes (notionally) a certain size on screen. While this
is a simple division, it's a bit opaque in terms of meaning.
Also it means the divide by zero case can be more universally
defended-against, which has traditionally been a bug opportunity.
Recommendation is to avoid using the year nomenclature as this
information is already encoded in the git repo. Avoids needing to
repeatly update.
Also updates AUTHORS.txt from current repo with contributor names
This tidies up quite a performance hit on layer change
caused by repainting vias, pads and tracks for their
clearances.
Instead, on a layer change, just disable any old clearance
layer and enable the new one (if any).
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/19404
This means that an early return or an exception between
a manual Push/Pop (or an omission of the Pop) cannot
corrupt the layer stack.
It also means the GAL doesn't have to maintain its own
stack (with the in-scope GAL_SCOPED_ATTRS taking that role).
Reomve the Push/PopDepth functions, as they're only ever
used in pairs, and doing it manually needs more care.
Implemented as handling un-consumed scroll events that the
WX_VIEW_CONTROLS doesn't want because it has too many mods
set. Then dispatch these as TA_MOUSE_WHEEL events.
The default action from the selection tools is to run the
'increment' ACTION, which is implemented differently in the
various tools: eeschema can increment labels, symedit
does pin names and numbers, and fpedit does pad numbers.
Allow a horizontal scroll event to fall through to the panning branch.
This still restricts zooming to use only the vertical axis, but it
(re-?)enables the horizontal pan function that currently doesn't work
even if the user has set "allow horizontal panning", as the horizontal
scroll doesn't have a modifier, which is the default for vertical scroll
zoom, and thus it skips over the whole panning branch.
If the user has not set horizontal panning, the earlier early return
means that there is no handling of any horizontal scroll event, so this
won't change anything for these users.
- Changes BOX2 size to extended coordinates.
- Adds BOX2ISafe to construct a BOX2I that will fit in int32.
- Adds more checks.
- Safer computations.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17670