Frame refresh in wxWidgets sets the focus back to indeterminate state
and prevents hotkey action until the focus is captured again. Using
canvas update is the correct method to update the canvas display after
modifying zones/similar
Fixes: lp:1810993
* https://bugs.launchpad.net/kicad/+bug/1810993
When routing in high-contrast mode, the user may wish to place items
that are primarily on a different layer while remaining in high contrast
mode. This fixes a regression from 4.0.7
Fixes: lp:1804309
* https://bugs.launchpad.net/kicad/+bug/1804309
Moving pcbnew error strings that may be seen by the user to translated
strings. Strings that denote unexpected cases are moved to debug logs
as they are essentially asserts that should never be shown. The
exceptions are the messages shown when files are loaded. All unknown
items should show an error here.
Checks for ratsnest enabled prior to calculating and displaying the
local/dynamic ratsnest. Calls the ratsnest clear from selection clear
Notably, it appears that the tool actions do not chain transitions for
the same event. So only a single action (first specified) will be
executed when an event fires unless the actions are executed by separate
tools.
Fixes: lp:1809752
* https://bugs.launchpad.net/kicad/+bug/1809752
This fixes the handling of align/distribute tool when called on locked
items. Locked items cannot be moved but they may be used for the target
of an align/distribute operation.
Fixes: lp:1808238
* https://bugs.launchpad.net/kicad/+bug/1808238
Instead of a nag screen for locked items, we allow first the unlocked
items to be deleted and then, with a repeated request, the locked items.
This adds a popup cursor window informing the user of the option for
repeating the delete
Fixes: lp:1806507
* https://bugs.launchpad.net/kicad/+bug/1806507
Simply calling it Alternative Delete was hiding its behavior. This gives
a descriptive tooltip and command name allowing users to more easily
find the equivalent to the "Ripup" command
Graphic lines and polygons are drawn to fit specific areas for which it
is helpful to have the endpoint controlled by the cursor even when
constraining the angle.
Fixes: lp:1805502
* https://bugs.launchpad.net/kicad/+bug/1805502
* Do not compile dxf old files.
* import gfx, gal mode: make absolute placement working.
* Import gfx in legacy canvas: use it and make interactive placement working
* Take imported line width in account. Ensure DXF line thickness is OK.
* handling empty files in legacy mode.
The client filter might add items in the case where locked pads are
filtered. We need to handle this case when requesting selection by
adding new items to the m_selection
Fixes: lp:1802686
* https://bugs.launchpad.net/kicad/+bug/1802686
When we draw a path, we usually want to close the path when clicking on
the end of another line. This uses grid helper to ensure this
progression happens as expected.
When updating the status of the ratsnest, we mark its target layer as
dirty to ensure the revised data are used to draw/clear the ratsnest
Fixes: lp:1800301
* https://bugs.launchpad.net/kicad/+bug/1800301
(cherry picked from commit 50eedcf0b3)
The ratsnest layer needs to be always enabled in GAL rather than taken
from the board settings. This also adds a finalize handler to the
picker tool that allows a picker-caller to perform a specific action
when the picker tool exits. In this case, we use it to clear the local
ratsnest selections back to the default.
Fixes: lp:1800301
* https://bugs.launchpad.net/kicad/+bug/1800301
(cherry picked from commit c0d9b9ab81)
When the local ratsnest tool is used, it should toggle the state based
on the global ratsnest visibility. After changing state, the layer
cache is marked as well.
Possibly related to lp:1800301
(cherry picked from commit 22fbf30f22)
Distinguish between the snap-from and snap-to items. Previously, we
used the SELECTED or DRAGGED flags but the flagging arcitecture was
inherently fragile. This specifies items directly that should not be
used as snap targets.
Fixes: lp:1802795
* https://bugs.launchpad.net/kicad/+bug/1802795
Filtering based on selection ignores the use case where we are measuring
to a selected item. This utilizes the dragged flag to prevent snapping
based on the current state of the item drag.
Fixes: lp:1801089
* https://bugs.launchpad.net/kicad/+bug/1801089
When snapping, we should allow any point identified as a snappable
point. The additional consideration for corners might be used for
alignment in the future.
Fixes: lp:1802741
* https://bugs.launchpad.net/kicad/+bug/1802741
Separate out zone edges (which are quite specific, and should
win over most other things) from zone fills (which are pretty
generic and should only be considered when there's nothing else).
Also excludes zone fills when the zones aren't being shown as
filled.
When processing the selection filter, items were deselected before being
reselected after passing through the filter. This adjusts the logic to
only deselect those items that are filtered out.
Refactor the polygon event loop into its parent function to allow access
to the params structure. Active layer now updates the drawing layer for
add/cutout zones.
Fixes: lp:1797483
* https://bugs.launchpad.net/kicad/+bug/1797483
When using the board edit, align tool automatically moved footprints
instead of pads but distribute tool did not. This standardizes the
behavior.
Fixes: lp:1796997
* https://bugs.launchpad.net/kicad/+bug/1796997
If the user is carefully selecting the zone edge, we do not filter the
zone preemptively from our disambiguation list in the same manner as we
do for selecting on zone copper.
Fixes: lp:1796719
* https://bugs.launchpad.net/kicad/+bug/1796719
Disabling the grid should leave the snapping in place. But our disabler
returned the current point as closest, effectively always ensuring the
cursor position was the closest snap. This only uses grid when
requested.
This is temporary until we figure out a way to do multiple constraint
handling in GRID_HELPER or the EC_* class. This will work as long as
the EC constraint helper places the endpoint on either the primary or
aux grid.
Fixes: lp:1796540
* https://bugs.launchpad.net/kicad/+bug/1796540
Get the board settings when changing the drawing layer. These include
default line thickness that should be updated.
Fixes: lp:1796489
* https://bugs.launchpad.net/kicad/+bug/1796489
When drawing the crosshair should track the element while the mouse
provides the position to calculate the next snap.
Fixes: lp:1796524
* https://bugs.launchpad.net/kicad/+bug/1796524
The dimension tool is used to measure physical dimensions on the board
therefore it should be able to snap to any other object, not just those
on its own layer set as is the case for other items.
This also deals with a corner snap case for constraints by first
snapping, then constraining, then aligning to grid. This ensures OoO
for alignment from least to most constraining.
When considering potential targets for snap points, we need to exclude
the currently selected item as this will mean that we always snap to
ourselves when editing an existing item.
Fixes: lp:1796507
* https://bugs.launchpad.net/kicad/+bug/1796507
When drawing segments, the segment will be NULL'd after committing, at
which point we lost our snap layer. Choosing snap layers from the
current drawing layer is a more robust method.
Fixes: lp:1796467
* https://bugs.launchpad.net/kicad/+bug/1796467
Deselection by clicking on a zone makes working with plane zones easier
by allowing the selected item to de-selected by clicking on a zone.
Once the selection is cleared, the zone may be re-selected as normal.
Clicking on non-zone items while a separate item is selected will still
select the new non-zone item without requiring a second click.
This shows the snap indicator even when the item we are snapping to
occurs on a grid point, giving the user an indication that the point is
correctly connected.
Many items require precise, non-grid movement. Adding the ability to
flag a non-grid option will permit this behavior.
This is a required precursor commit to fixing lp:1738818 and lp:1771683
The computeAnchors function is used to find best drag locations for
items being moved. All movable PCB items should be handled.
Fixes: lp:1794304
* https://bugs.launchpad.net/kicad/+bug/1794304
When requesting to move a footprint based on the pad, the pad layers
should determine the snapping. This extracts layers from the selected
pad before allowing the filtering for locked pads
Fixes: lp:1787627
* https://bugs.launchpad.net/kicad/+bug/1787627
Since we are handling snapping in the grid helper, we don't need to
enable it in the cursor position return. This allows the grid helper to
use the frame position while optionally snapping to segments.
Put the cursor and pan control TOOL_ACTIONs in ACTION,
and refer to them in that way.
The handlers are currently identical in Pcbnew and Cvpcb,
and Gerbview (and all canvases) can benefit from them as well
if they are in libcommon. Also saves duplicated code.
Fixes: lp:1795855
* https://bugs.launchpad.net/kicad/+bug/1795855
This ensures that when starting to draw a zone or graphic element, the
preview is drawn in the same color/on the same layer as the element that
will be created. Previously, beginning a graphic polygon while a copper
layer was active would result in the preview being drawn in the color of
the active copper layer.
Polygon corners were enabled in the footprint editor but the logic
didn't extend to the board editor. This revises the logic to look for
DRAWSEGMENTs and only reference the PCB_MODULE_EDGE_T where needed to
create a new segment in the footprint.
Fixes: lp:1782966
* https://bugs.launchpad.net/kicad/+bug/1782966
Allows selection of polygons and zones by their visible area. Will only
select polygons/filled areas when they are unobstructed by other
elements in the footprint/pcb. Also adds a "skip heuristics" modifier
key for clicking (ALT) that allows the full disambiguation list to be
displayed without removing less-likely elements. This dovetails the
zone/polygon selection as it allows selecting even when areas a fully
overlapped.
Fixes: lp:1753153
* https://bugs.launchpad.net/kicad/+bug/1753153
SEGZONEs are no longer created by pcbnew but may exist in older boards.
This allows deleting the old fills in a manner similar to the deletion
in Legacy canvas.
Fixes: lp:1794571
* https://bugs.launchpad.net/kicad/+bug/1794571
SEGZONE types were confusingly named PCB_ZONE_T. Zones in pcbnew are
now _only_ PCB_ZONE_AREA_T, so we name segzone types PCB_SEGZONE_T to be
clear.
This also removes processing of the SEGZONEs from connectivity
calculations.
Unselecting performs two functions: unselecting and unhighlighting.
Some items may be deselected but still live in the temporary highlighted
layer (e.g. selecting a footprint and exchanging it). Since there is no
harm in unselecting an unselected item, we can allow it to proceed
without the check.
Commit efdbc91e42 broken the primary
alignment mechanism for maintaining the current point as an auxilliary
grid reference. This reverts that commit and fixes both the initial
issue and the associated bug by applying the primary constraint after
the secondary. In this way, we consider the secondary constraint as an
additive rather than alternative constraint.
Fixes: lp:1793888
* https://bugs.launchpad.net/kicad/+bug/1793888
When editing the pcb, Ctrl-Click will highlight a net. This allows
de-highlight with the ESC/cancel action from the selection tool. Inside
the highlight tool, ESC reverts to the selection tool while keeping the
net highlighted.
Fixes: lp:1793842
* https://bugs.launchpad.net/kicad/+bug/1793842
This is a boyscouting commit to standardize the threading of zone fills.
We do not need to join threads after their completion, instead we simply
allow them to clean up their memory without blocking the user. This
also sets the maximum number of threads that may be created to the
number of zones being filled. More than this will only leave un-used
threads being created and immediately killed.
We also include the connectivity search as a phase in the fill progress
reporter. This was the case before but did not utilize the correct
maxsize, leading to stalled progress bar.
Repeating find with the same search string would result in a not found
error for absolute search strings. Don't clear the found item if the
search string did not change from the previous search..
Fix another minor bug where the do not warp mouse pointer option was
always checked when the find dialog was called from one of the gal
canvases.
Fixes lp:1793300
https://bugs.launchpad.net/kicad/+bug/1793300
We had been deselecting items after calling edits to be safe in case the
item was deleted/exchanged by the edit. The item pointer itself remains
valid even when deleting as it is assigned to the undo stack. But it
should not remain visible or selected on the schematic if it is removed.
This tests for removed items by checking whether it (in the case of
first-level BOARD_ITEMS) or its parent (in the case of footprint item
components) remain in the view list after editing. If they are still in
the view list, then we re-select them.
( cherry-picked from 2c6d0ffe2 )
Fixes: lp:1765774
* https://bugs.launchpad.net/kicad/+bug/1765774
Fixes: lp:1775946
* https://bugs.launchpad.net/kicad/+bug/1775946
Allow corner adding to polygons in both module editor and board editor.
The board editor was already allowed but only through special types.
The module editor is now sychronized to the same process and both
recognize standard context menus
Fixes: lp:1782966
* https://bugs.launchpad.net/kicad/+bug/1782966
( cherry-picked from 06ac172c2 )
When constraining moves, the cursor snaps to grid but does not
represent the position of the final edited point. The point is rotated
to the nearest snap angle, while the vector length remains unchanged
resulting in a line longer than intended and off-grid.
This adds a grid-snap after the constraint is applied.
Fixes: lp:1792655
* https://bugs.launchpad.net/kicad/+bug/1792655
( cherry-picked from e7c51a6a6 )
Normally working at a zoom level when a footprint is not fully displayed
indicates that the user modifies other components. Selection Tool used
to discard footprints that had area larger than the viewport area, but
it may make sense to select them if there are no other candidates.
Fixes: lp:1789578
* https://bugs.launchpad.net/kicad/+bug/1789578
This allows full copper connections even when THT changes a trace layer.
It avoides selecting the actual pad to prevent actions on the copper
connections from affecting the footprints as well.
Fixes: lp:1789807
* https://bugs.launchpad.net/kicad/+bug/1789807
Text can be included in the same selection group as the parent module.
Thus if we clear the selection marker on a module's child elements we
also need to remove the element from the selection group.
Fixes: lp:1789418
* https://bugs.launchpad.net/kicad/+bug/1789418
Using Title + Message wasn't working for all the dialogs which
did substitutions in the message (which was a lot of them).
Fixes: lp:1789348
* https://bugs.launchpad.net/kicad/+bug/1789348
Also fixes a bug where nets wouldn't get changed because the
pads weren't changed and so the pad nets would propagate and
wipe out the changed nets on the tracks.
Also includes warning dialogs that pad nets will be changed if the
track nets are.
Fixes: lp:1779854
* https://bugs.launchpad.net/kicad/+bug/1779854
Use standard Magnetize() to handle grid and magnetic pads.
Use the standard menu from PCB_TOOL. Delegating the menu to
the SELECTION_TOOL just caused grief.
Also brings clients (such as Position Relative To) into line,
and implements better Cancel behaviour.
Also improves visibility of modal status messages:
- moves Select Anchor message from status bar to popup
- moves Select Reference message from dialog to popup
Fixes: lp:1786727
* https://bugs.launchpad.net/kicad/+bug/1786727
New algorithm more targetted and just clears the items. This
also obviates the need for the aQuietMode flags.
Only fixes one part of the bug, but the "fixes" line is the
easiest way to get a link in the bug to the commit.
Fixes: lp:1786727
* https://bugs.launchpad.net/kicad/+bug/1786727
This makes zoom automatique work much better in the footprint
editor, and should improve other things which probably assumed
the bounding box included everything (such as refresh code).
Callers which still want just the module outline should call
GetFootprintRect() instead of GetBoundingBox().
Some other tools (in this case the POINT_EDITOR) aren't good
citizens and activate themselves when receiving selection
changes.
Fixes: lp:1785781
* https://bugs.launchpad.net/kicad/+bug/1785781
Adds a hotkey to the TOOL_ACTION, and also checks for
action validity prior to running the actions (previously
implicitly gated by the enablement of the menu item).
Also fixes some interactivity issues in the microwave tools around
single-click tools that have initial properties dialogs. Those
need to act kind of like a hybrid between single-click and two-click
tools.
Fixes: lp:1751381
* https://bugs.launchpad.net/kicad/+bug/1751381
When changing elements in the module editor, each element shares the
same parent. Undo commits store a copy of the parent as it existed
before the change. For footprints with many elements, this creates
large, slow undo commits as a copy of the full footprint is stored for
each element being edited.
This keeps a single copy of the footprint in the undo stack per edit.
Fixes: lp:1780526
* https://bugs.launchpad.net/kicad/+bug/1780526
This introduces a new util function in geometry_utils which snaps a vector
to axes or 45 degree lines. This can be used whenever you want to
snap a vector to these angles, but still want it to stay on a grid.
This snapping is used for the dimension tool and the ruler tool.
This is substantially simpler for two-point tools that the method
used by the line tool, which uses DIRECTION_45.
Fixes: lp:1780826
https://bugs.launchpad.net/kicad/+bug/1780826
Also includes a bunch of changes to simplifiy the terminology
and unify the copper, non-copper and keepout versions.
Also removes some legacy features:
Removes contol for fill method. If the fill method is currently
segments the dialog will ask if you want to convert to polygons
on OK.
Removes control of boundary resolution. We've done this with trig
since 5.0.
(cherry picked from commit 487aaeb)
... and GetMsgPanelInfo.
Step 4 in the g_UserUnit eradication effort.
Also removes a couple of conversion routines that were close
enough to extinction.
(cherry picked from commit c75da51)
This not only reduces the number of different mechanisms, but
will also reduce (yet again) the number of Clarify Selection
pop-ups (because the CLIENT_SELECTION_FILTER runs before the
pop-up, while SanitizePads ran after it).
Fixes: lp:1710451
* https://bugs.launchpad.net/kicad/+bug/1710451
(cherry picked from commit e50a993)
The general idea is to support user-units inheritance. The
UNIT_BINDER allows wrapped controls to inherit units from their
parent dialog, while KEYWAY_HOLDER and DIALOG_SHIM allow child
KEYWAY_HOLDERs or DIALOG_SHIMs to inherit units from their
parent.
The GetUserUnits() method signature has to move to KEYWAY_HOLDER
rather than KEYWAY_PLAYER (where it makes more sense) as it’s the
only common ancestor of KEYWAY_PLAYER and DIALOG_SHIM.
As long as we'll be using the UNIT_BINDER more widely, it also
makes sense to move evaluation and validation into it.
This commit also provides eeschema’s DIALOG_LABEL_EDITOR and
pcbnew’s DIALOG_TRACK_VIA_PROPERTIES and DIALOG_SET_GRID as
models of how to use the new user-units inheritance, eval, and
validation.
Fixes: lp:593795
* https://bugs.launchpad.net/kicad/+bug/593795
(cherry picked from commit c8bc53e)
The old item pointers (which aren't safe to keep around) were
removed in favour of opaque references (void*) which are then
compared against existing items when needed.
Also improves brightening by brightening the whole footprint
(ie: its pads, drawings, reference and value) rather than just
its target cross.
(cherry picked from commit 30e90b0)
The local ratsnest needs to be able to hide as well as show visibility.
Clicking a module will toggle the visibility while clicking off all
modules clears the local ratsnest display.
Fixes: lp:1531332
* https://bugs.launchpad.net/kicad/+bug/1531332
The assert in the title line verifies that an item does not belong to
any DLIST when it is being added to one. Items in clipboard are already
owned by DLISTs, therefore they need to be removed from the original
DLISTs before being added to new ones.
Commit 72b49acc changed behavior of MODULE::ViewBBox(),
which now includes text fields area. This caused problems
with selecting footprints with relatively large text fields.
This patch fixes this problem by using MODULE::GetBoundingBox instead.
Fixes: lp:1776942
* https://bugs.launchpad.net/kicad/+bug/1776942
There's no risk in measuring an empty footprint but there's no benefit
either. This matches the measure tool to the other, deactivated
footprint tools.
- fixed via bounding box calculation in TRACK::GetBoundingBox()
- moved clearance to TRACK::ViewBBox()
- modified the Selection Tool to use EDA_ITEM::GetBoundingBox() rather
than VIEW_ITEM::ViewBBox() to determine selection
Fixes: lp:1776314
* https://bugs.launchpad.net/kicad/+bug/1776314
New items just being placed on the board are still temporary. Although
we can modify their orientations/positions, we can't stage these changes
for undo/redo without corrupting the undo stack.
Fixes: lp:1776312
* https://bugs.launchpad.net/kicad/+bug/1776312
Previously, the "Select Connection" sub-items were greyed out when the
selection contained both tracks and vias. This meant that you couldn't
access "Select Copper Connection" when the selection contained both
tracks and vias (though the keyboard shortcuts did work).
Change to use SELECTION_CONDITIONS::OnlyTypes( GENERAL_COLLECTOR::Tracks
) to allow any combination of track elements to be selected.
Fixes: lp:1772249
* https://bugs.launchpad.net/kicad/+bug/1772249
A perfect solution would create holes in the coverage map
for the zone edges and handles, but that's a lot more
work.
Fixes: lp:1773204
* https://bugs.launchpad.net/kicad/+bug/1773204
The SELECTION is a std::set. Numerical dereference of item n is O(n) as
the iterator is not random access. Therefore, a for loop using
numerical dereference is O(n!) and quickly slows.
We avoid this by storing items to remove separately while iterating and
then removing the items after we complete.
Fixes: lp:1692081
* https://bugs.launchpad.net/kicad/+bug/1692081
If you select a track with many segments (e.g. a length-tuned track) and
then select all connected items again ('U' -> 'U'), we would iterate
over all items in the selection and mark connections for each of the n
segments n separate times.
We avoid this by using the marked flag to show when the segment has
already been visited by the routine. This means that if the segment has
been checked for connections because it was connected to the previous
item, it won't be checked for connections again. However, a selection
that interleaves items from multiple connection segments will still
(potentially) be multiply checked as the BUSY flag is cleared each time
there is one not-BUSY track in the selection.
Circles are defined by center and a point on their edge. This requires
the user to do extra math to figure out the size of the circle. The
patch allows the user to edit and draw circles using radial coordinates.
This allows the user to selectively disable the snap-to behavior when
placing stand-alone vias. Full solution will require an update to the
segment distance calculation that takes into account the rounded line
caps.
Fixes: lp:1769523
* https://bugs.launchpad.net/kicad/+bug/1769523
Also fixes a bug where a FOOTPRINT_EDIT_FRAME was being passed
in to a PCB_EDIT_FRAME.
Also tidies up Modedit settings handling for settings which can't
be edited in Modedit's preferences dialog. They're now copied
from Pcbnew.
Fixes: lp:1768477
* https://bugs.launchpad.net/kicad/+bug/1768477
Duplicate already works, so there's little reason to disallow
using the zone dialog to do it.
The legacy canvas can't be fixed because we'll immediately
union the two zones, resulting in a no-op.
Fixes: lp:1464677
* https://bugs.launchpad.net/kicad/+bug/1464677
This really needs to get put into the VIEW_CONTROLS for all the
tools, but that's probably a bit too risky for 5.0 at this
point.
Fixes: lp:1766547
* https://bugs.launchpad.net/kicad/+bug/1766547
If the initial pad was a custom pad converted in a usual pad + graphic items by the command:
"Explode Pad to Graphic Shapes"
the "old" primitives were not cleaned, and the new created pad contained these old primitives, regardless the new selected shapes.
(Usual case when a user want to edit a custom shape)
When multiple cut commands were issued, the cut command handler would
restart multiple times and keep running until the handler that was
invoked first finishes. As all handlers kept a selection copy, they
would try to save the deleted items to the clipboard resulting in a
crash.
Fixes: lp:1761221
* https://bugs.launchpad.net/kicad/+bug/1761221
Previous implementation refilled zones every time they have been
unselected. This patch adds a flag that tracks whether the
zone has been actually modified, so it will be refilled only when
necessary.
Fixes: lp:1760903
* https://bugs.launchpad.net/kicad/+bug/1760903
- vias were always left selected, include vias in tracks filter - as in legacy
- make text filtering work
- cleanup drawings filtering code
- hide checkbox "Include items on invisible layers" because it does not work in GAL
CTRL+{X,C,V} used to be handled both by the legacy hotkey system that
generated ID_EDIT_{CUT,COPY,PASTE} wxCommandEvent, and the Tool Framework
hotkey system.
Fixes: lp:1749549
* https://bugs.launchpad.net/kicad/+bug/1749549
When aligning module centers, it can be hard to determine which item
will be chosen for the alignment target when it chooses based on the
median of the center values. Instead, this patch chooses the alignment
target as the top and left most items of the Y and X centering,
respectively
When aligning in pcbnew, check for pad/module locks before performing a
move and query the user.
When aligning on pads, don't move the pad without moving the footprint,
so we don't break footprints.
Fixes: lp:1751352
* https://bugs.launchpad.net/kicad/+bug/1751352
reimplement the centerpoint distribution and use it when the items to be
distributed overlap leaving no gap to use for spacing
Fixes: lp:1748763
* https://bugs.launchpad.net/kicad/+bug/1748763