Fixes:
* Various special cases around junctions on pins and dragging.
* Some rotations of endpoints resulting in a 45 degree rotate.
* Some cases where it was possible to get a line with neither
endpoint selected, and also substractive unselecting only one of two
selected endpoints unselecting both.
* Use line midpoint for sorting. Start and endpoints aren't
consistent in the order they appear on the X or Y axis. So,
we need to use the midpoint for our position for consistent
sorting when dragging groups of parallel lines where some
have the start and end reversed.
Other:
* Rename TEMP_SELECTED TO SELECTED_BY_DRAG. This is the actual meaning
of the flag, and should reduce confusion as
to when it should be used.
* Move usage of TEMP_SELECTED as an algorithmic mark to CANDIDATE
instead.
* Fix mistaken clearing of START_POINT and ENDPOINT.
* Move endpoint setting and clearing out of narrowSelection, and into
selectPoint and selectMultiple.
* Don't show dangling end warnings on new lines
Center rotation will often misalign lines to the grid, which is bad
until fix off grid items on the schematic.
We can rotate a connection end into a new connection or to become
collinear with an existing line, so we need to check for this at the end
of rotation.
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/10565
(cherry picked from commit 7d4cb91f39)
Selecting end and midpoint will select whole line. Some changes for
orthogonal dragging made this worse than in 6.0.
Improves, but does not fully resolve:
https://gitlab.com/kicad/code/kicad/-/issues/10860
ADDED arc, circle and rectangle shapes for schematic. Shapes support
line styles and fill colors.
CHANGED sheet background color in Edit Text & Graphics Properties to
fill color (and it now affects shapes).
Pushed STROKE_PARAMS down into common and moved all shapes to using it
for stroke descriptions.
Grid-based accuracy doesn't need to be any larger than 1/2 the
diagonal as we'll snap to one side or the other. And symbols don't
need as much slop as other items since there's plenty of "meat" on
them.
Fixes https://gitlab.com/kicad/code/kicad/issues/9805
1) Make sure the y-coord is correctly inverted before calling collision
routines.
2) Give LIB_SHAPE poly lines the same extra slop as SCH_LINEs.
Fixes https://gitlab.com/kicad/code/kicad/issues/9791
Text has a fairly big bounding box to account for descenders, overbars,
etc., but it makes it feel too sloppy for hittesting. This change
allows selection disambiguation to look at the actual strokes of the
text when deciding what's "closest".
Fixes https://gitlab.com/kicad/code/kicad/issues/9506
Leaving the forced position on results in the auto-line linking to a pin
for far longer than we intend if there are other hits in the area of the
cursor
Fixes https://gitlab.com/kicad/code/kicad/issues/9321
If we do a real drag, the timer will be cancelled. If we don't, then
the user is still holding the mouse button down and would probably like
to see the menu. Otherwise it appears the action is dropped.
Keeps the lines connected but doesn't solve the crossed-wire mixups.
This allows common usage (mirroring labels/rotating segments) and leaves
prevention of the crossed wires to the user.
We can't really prevent crossed wires when rotating e.g. a part with
wires connected to 4 sides and users will not expect that. But we
should not disable useful features like mirroring multiple parallel
items to avoid a known impossible situation
Also provides an alternative solution to 345f506f0c that allows us to
rotate groups without destroying connections on hover
Fixes https://gitlab.com/kicad/code/kicad/issues/8403
Fixes https://gitlab.com/kicad/code/kicad/issues/8523
doSelectionMenu returns false to indicate a cancelled menu. This needs
to be handled in selectPoint when directly accessing doSelectionMenu in
the same manner as SelectionMenu() events
Fixes https://gitlab.com/kicad/code/kicad/issues/9218
The select-single-wire stuff is no longer needed, and the prefer-wire-ends
stuff needs to be distance-based.
Also improved wire hit-testing to include bubbles the size of the dangling
symbol at each end.
Fixes https://gitlab.com/kicad/code/kicad/issues/9187
1) Expand the accuracy to at least the grid spacing
2) Move pin-selects-symbol logic to Selectable()
3) Recode pick-closest algorithm to handle exactHits and inexactHits
separately
4) Remove pin target from bounding box in favour of expanding it to
at least as wide as the pin decoration (this prevents the accuracy
off the end of the pin from growing too large)
We have two cases where we might be requesting a disambiguation menu.
In one case, we already have the event loop waiting and we need to run
the selectionMenu through the action system. In the other case, the
tool isn't on the stack and won't activate. Here we need to run
directly and we are assured of not crashing because the tool isn't
active.
Fixes https://gitlab.com/kicad/code/kicad/issues/9154
Moving points should not be overrided by disambiguation menu, so we
track where the disambiguation event started and only trigger the menu
if the mouse hasn't moved a full unit in x/y
Fixes https://gitlab.com/kicad/code/kicad/issues/9132
Previously, we were checking if the selection tool was the top of the
stack but this ignored many other "secondary" tools that might be
running such as the point editor. These still allow the selection tool
to handle events such as clicks. This change allows the selection tool
to handle clicks when it is the primary tool on the stack rather than
the top
Fixes https://gitlab.com/kicad/code/kicad/issues/9110
This standardizes selection tools in SELECTION_TOOL class to be able to
handle a long-click as asking for a non-heuristic disambiguation menu.
Fixes https://gitlab.com/kicad/code/kicad/issues/8490
SHIFT, CTRL, ALT modifier keys were handled in 2 different codes, one for
the selection tool and another to modify the mouse cursor shape, with 2
different configs.
Now the modifiers are managed from only one function.
Pcbnew: group also SHIFT, CTRL, ALT modifier keys management to a specific function.
Fixes#8021https://gitlab.com/kicad/code/kicad/issues/8021
We kept having various issues of the pointer list going stale. This
will prevent all permutations of that.
Also while I was in there I fixed the double-move thing (see bug
number).
Fixes https://gitlab.com/kicad/code/kicad/issues/7910
Bitmaps are now identified by an enum class instead of by pointers.
Bitmap loading and caching is now handled by a class in common, and
we no longer compile most bitmaps into the binary, so there is no
longer a bitmaps static library.
Instead, bitmaps are archived to a .tar.gz file which is installed
in ${KICAD_DATA}/resources/images.tar.gz
The source PNGs are checked in to Git as the original CPP files were,
so that people can build without the required dependencies to convert
SVGs to PNGs.
Initial support is also added for dark theme icons, although this
is not yet exposed in the GUI.
Stubs are present for multi-resolution image resources, but this is
not fully-baked yet and could use some refinement.
CHANGED: Ctrl-middle mouse button double click should perform
'Zoom to Objects' in Eeschema, but a change in modifier key handling
broke it. This MR restores the functionality.
Fixes https://gitlab.com/kicad/code/kicad/issues/7803
I think the guessSelectionCandidates narrows down to a single item
in 99.9% of cases, so we can probably remove this entirely. But for
now it's safer just to fix it.
Now looks at how hard it is to select the item (grids) and switches only
if the mouse is more than a grid square away and there is a new item
under the mouse.
Fixes https://gitlab.com/kicad/code/kicad/issues/4455
Forcing grid snap for the kick-start behavior loses snaps to pins that
may be desired. This also adds force-snapping in select mode to match
the user's auto-start preferences
Fixes https://gitlab.com/kicad/code/kicad/issues/7293
1) init reference pages before trying to draw the SCH_FIELDs when
turning intersheet references on
2) don't double redraw because we accidentally cleared the last
hover item on a non-mouse-moved event.
3) make sure the root sheet gets a name for the hypertext menu.
1) Generalize SCH_ITEM owners (SCH_COMPONENT, SCH_SHEET, and now
SCH_GLOBALLABEL)
2) Generalize hypertext items
3) Use SCH_FIELD autoplace infrastructure for placing intersheet
references
4) Use textVar infrastructure for buildin intersheet references.
As an important side-effect this also fixes the undo issues with
intersheet refs.
The groundwork has now been laid for per sheet instance data. Initially
this only supports sheet page numbers but could be expanded to include
other per sheet instance information.
ADDED: Support for user defined schematic page numbers.
Also fixes a bug where the auto-start-wire stuff was messing up the seleciton
when the selection tool wasn't at the top of the tool stack.
Fixes https://gitlab.com/kicad/code/kicad/issues/5960
CHANGED: If you start the interactive delete tool and the mouse pointer
isn't near anything, Eeschema tries to use a null EDA_ITEM pointer
which throws an exception. This commit checks if the pointer is null
and exits if it is.
ADDED: Make middle mouse button double click do a 'Zoom to Fit'
in Eeschema, Pcbnew, and Gerbview. Ctrl-MMB does a 'Zoom to Objects'
in Eeschema.
Fixes https://gitlab.com/kicad/code/kicad/issues/1988