Commit Graph

1160 Commits

Author SHA1 Message Date
Seth Hillbrand faa3829ad4 Add MRU to image placement tools 2022-02-25 13:18:43 -08:00
Jeff Young 6d8507d44f Formatting. 2022-02-25 17:36:35 +00:00
Mike Williams e35c3f2b99 Schematic: handle switching h/v mode better while drawing lines
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/10859
2022-02-21 17:03:43 +00:00
Jeff Young a2772b3363 Don't crash on highight net during drag.
Fixes https://gitlab.com/kicad/code/kicad/issues/10866
2022-02-21 13:30:15 +00:00
Jeff Young b0d7c82e64 Disable grid when ctrl/cmd key is down.
Fixes https://gitlab.com/kicad/code/kicad/issues/9995
2022-02-20 16:50:30 +00:00
Mike Williams d0749c4e9a Schematic: more drag undo fixes
Drag was not clearing IS_CHANGED status of items that were moved by the
drag, but weren't selected or created by it.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/10845
2022-02-20 11:49:18 +00:00
Seth Hillbrand d1a4daefbb wxPoint->VECTOR2I correction for master 2022-02-19 19:14:41 -08:00
Seth Hillbrand 24ac516135 Trim wires based on how many pins they intersect
If a wire intersects more than 2 pins from the same symbol, we don't
trim connections.  If the wire intersects exactly two pins from a single
symbol, we remove the wire between the pins.

We avoided doing this before because we didn't have a good metric for
trimming vs. not.  But the per-symbol calculation feels like the least
surprising option.

Fixes https://gitlab.com/kicad/code/kicad/issues/10909

Fixes https://gitlab.com/kicad/code/kicad/issues/1857

(cherry picked from commit 75a4036e45)
2022-02-19 16:54:45 -08:00
Jeff Young 510dc28a5c Resolve text variables before attempting to open datasheet. 2022-02-19 14:59:50 +00:00
Mike Williams 567168fffc Schematic: make grabbing whole lines more intuitive
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
2022-02-16 19:15:55 +00:00
Mike Williams 97797c44b9 Schematic: added drag wires undo/redo fix
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/10845
2022-02-15 19:31:17 +00:00
Seth Hillbrand 45a1a9a715 Replace awkward double cast with binary logic
The use of XOR with integers here is needed as MSVC doesn't implement
the use of std::signbit for integers and casting up to double just to
get the signbit feels wrong
2022-02-15 10:13:59 -08:00
Marek Roszko 3129f96686 Add awkward cast to double due to msvc conflict
https://github.com/microsoft/STL/issues/519
2022-02-14 21:43:11 -05:00
Mike Williams 9c59c4ee12 Schematic: orthogonal drag bends should depend on move direction
Prevents overlapping lines when possible.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/10844
2022-02-14 22:52:34 +00:00
Jeff Young 4e5b30ad80 Rewrite autostart to not need connectivity.
Fixes https://gitlab.com/kicad/code/kicad/issues/10579
2022-02-14 01:15:06 +00:00
Mike Williams 013d6d088f Eeschema: fix pin starting wire bus bug
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/10819
2022-02-13 15:02:09 +00:00
Jeff Young 33e57930bc Implement undo for Eeschema find/replace.
Fixes https://gitlab.com/kicad/code/kicad/issues/10824
2022-02-11 22:09:22 +00:00
Mike Williams 21b59b4b6a Eeschema: fix bus label drag adding a line
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/10822
2022-02-11 21:30:50 +00:00
Mike Williams a5e8575091 Eeschema: Implement orthogonal dragging
Fixes https://gitlab.com/kicad/code/kicad/-/issues/1956
2022-02-10 18:38:40 +00:00
Mike Williams 7c91cd73e3 Eeschema: unconnected ends of wire entries should allow auto start wires 2022-02-07 23:31:24 +00:00
Jeff Young cc69849719 Fix definition of nonFields to include textboxes.
Fixes https://gitlab.com/kicad/code/kicad/issues/10771
2022-02-06 19:43:25 +00:00
Jeff Young 8d3e1639d0 Update text variables when they change.
Fixes https://gitlab.com/kicad/code/kicad/issues/10734
2022-02-04 12:52:46 +00:00
Seth Hillbrand 3badd53a96 Setup selection when repeating
We need the item to be currently selected when repeating the last symbol
insert.  This ensures we have a valid selection before starting the move
tool and possibly getting odd system behavior from mouse positions

Fixes https://gitlab.com/kicad/code/kicad/issues/10619

(cherry picked from commit 7642a9db79)
2022-02-03 17:09:59 -08:00
Jeff Young f3cd36d1d7 Bring EEschema textboxes in line with PCBNew's.
Also adds Border checkboxes and fixes a bunch of bugs.
2022-01-31 21:46:40 +00:00
Seth Hillbrand 38706fdd95 Fully select a line for transformation
When not trying to select points, we need to ensure that the full
line is selected for transformation

Fixes https://gitlab.com/kicad/code/kicad/issues/10566

(cherry picked from commit 70d00689ca)
2022-01-29 17:37:30 -08:00
Wayne Stambaugh b36e31c49f Factor out common and remove dead legacy symbol library code. 2022-01-29 14:13:00 -05:00
Jeff Young c6a8100d46 Schematic and symbol text boxes.
Also fixes some plot bugs with arcs.

Also moves polygonization of arcs (when required) in plotting code
from 5 degrees to calculated based on ARC_HIGH_DEF.

Fixes https://gitlab.com/kicad/code/kicad/issues/5017
2022-01-28 21:38:15 +00:00
Jeff Young 3409783d9f Break sch_text.h/.cpp into sch_text and sch_label.
Also moves SCH_NETCLASS_FLAG to SCH_DIRECTIVE_LABEL, and remaps Altium
harnesses from SCH_TEXT to SCH_DIRECTIVE_LABEL.
2022-01-28 21:38:15 +00:00
Mike Williams ecb32b1fb0 Eeschema: hover start from wire end should copy wire properties
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/10128
2022-01-27 17:17:45 +00:00
dsa-t bc1ff6756f Cross-probing/selection for multiple items (SCH->PCB) 2022-01-16 20:29:03 +00:00
Jeff Young e048e51f5d Improve SNR of EDA_ANGLE stuff. 2022-01-14 16:08:18 +00:00
Seth Hillbrand 5a3d53d9e4 Catch default autowire case
Since we are dereferencing the optional, we need to ensure it exists in
all cases

Fixes https://gitlab.com/kicad/code/kicad/issues/10394

(cherry picked from commit 56d87a8613)
2022-01-12 09:03:44 -08:00
Seth Hillbrand 04c46a8fd2 Correct return type in mapCoords 2022-01-07 09:08:40 -08:00
Seth Hillbrand 3d88f37949 Switch mapCoords to VECTOR2I 2022-01-07 08:37:37 -08:00
Seth Hillbrand eb271ca7fb Don't deduplicate schematic polygon points 2022-01-07 08:29:34 -08:00
Seth Hillbrand 4cdc9d3857 Don't deduplicate symbol polygons
SHAPE_LINE_CHAIN will, by default, remove duplicate points when
appending.  We don't want to do this when constructing our polygons in
symbol editor, so we need to explicitly call the routine without
deduplication

Fixes https://gitlab.com/kicad/code/kicad/issues/10289

(cherry picked from commit 62f8603353)
2022-01-07 08:25:49 -08:00
Seth Hillbrand c9fc15b5eb Clear edited point when exiting tool
When leaving the main point editor loop, we need to ensure that the edit
point is cleared as well.  This is usually cleared by a ClearEvent call
but in case this is missed, we need to ensure that other tools are not
caught out

Fixes https://gitlab.com/kicad/code/kicad/issues/10288

(cherry picked from commit 9a2332dfcf)
2022-01-07 08:25:49 -08:00
Seth Hillbrand 88a8ad2ca1 Keep symbol synced with edit tool
Undo/Redo can change the symbol referenced by the symbol drawing tool.
This updates the current symbol before important steps to keep the
system synced

Fixes https://gitlab.com/kicad/code/kicad/issues/10125

(cherry picked from commit b8a7a66a0a)
2022-01-05 16:52:02 -08:00
Roberto Fernandez Bautista 2d3624a016 Rename ComparePageNumAndName -> ComparePageNum 2022-01-02 23:20:17 +00:00
Jeff Young 32dec0127e Fix some issues with Eeschema's Shape Properties dialog.
Fixes https://gitlab.com/kicad/code/kicad/issues/10140
2022-01-01 20:46:45 +00:00
Marek Roszko 34e90e5045 Silence MSVC warnings about type mismatch and unused var 2022-01-01 14:41:36 -05:00
Marek Roszko c91d3e3cf9 Remove some more wxPoint 2022-01-01 14:12:20 -05:00
Marek Roszko d1552c3fec Some more wxPoint removal 2022-01-01 12:11:21 -05:00
Marek Roszko c4c56de708 Neurotically update position wxPoint usages 2022-01-01 11:55:51 -05:00
Marek Roszko 347e03363a Convert wxPoint/wxSize starting from EDA_RECT usages 2022-01-01 11:30:33 -05:00
Roberto Fernandez Bautista 701e256b3f Correctly handle excluding an ERC marker in eeschema when right clicking
In addition, hide the option to exclude a marker if the selected marker
is already excluded.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/10173
2021-12-30 17:14:36 +00:00
Jeff Young 86cb57f4a7 Cherry-pick TEXT_ATTRIBUTES and EDA_ANGLE from rockola/kicad-strokefont 2021-12-28 22:15:20 +00:00
Jeff Young af13533b42 Add show/hide controls for ERC markers.
ADDED show/hide controls for ERC warnings, ERC errors and ERC exclusions.

Fixes https://gitlab.com/kicad/code/kicad/issues/7270
2021-12-24 17:38:50 +00:00
Jeff Young 889970a449 SCH_NETCLASS_FLAGs and SCH_FIELDs for labels.
ADDED: a new label type for netclass flags.
ADDED: the ability to define fields on labels.
2021-12-24 16:13:27 +00:00
Jeff Young 9ee28ea8f5 Flatten out some more preferences. 2021-12-24 15:43:20 +00:00
Jeff Young 2bc86fa0a8 Shapes for schematic.
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.
2021-12-23 20:36:07 +00:00
Jeff Young ee5db73113 Use a bigger hammer to update adjacent segments.
Fixes https://gitlab.com/kicad/code/kicad/issues/9927
2021-12-23 16:54:03 +00:00
Jeff Young 885979ba75 Fix selection logic to handle LIB_ITEM as well as SCH_ITEM.
Fixes https://gitlab.com/kicad/code/kicad/issues/9954
2021-12-12 17:38:38 +00:00
Jeff Young d1e6c216e1 And the modify bit wasn't getting set either.
Fixes https://gitlab.com/kicad/code/kicad/issues/9926
2021-12-11 01:09:13 +00:00
Jeff Young 15d1abeeef Sigh. But addCorner() *does* need mapCoords().
And it's got an off-by-one error in it too.  I don't think this
ever worked at all.

Fixes https://gitlab.com/kicad/code/kicad/issues/9926
2021-12-11 01:06:36 +00:00
Jeff Young 1f126c5619 Hittesting already handles inverse coordinate system.
Fixes https://gitlab.com/kicad/code/kicad/issues/9926
2021-12-11 00:32:24 +00:00
Jeff Young 8c5dd46861 Undo for SCH add/remove corner.
(PCB_POINT_EDITOR uses a BOARD_COMMIT and so already handles undo.)

Fixes https://gitlab.com/kicad/code/kicad/issues/9925
2021-12-10 23:08:16 +00:00
Jeff Young 0ad0627bb0 Overhaul drag-select logic to handle children better.
Fixes https://gitlab.com/kicad/code/kicad/issues/6662
2021-12-10 18:44:07 +00:00
Wayne Stambaugh b7af66e3f9 Eeschema: fix broken page numbers when renaming a sheet file name.
Always use full sheet paths when storing sheet instances.  Partial sheet
paths cannot be full resolved resulting in lost page numbers when renaming
sheet file name.

Fixes #9782
2021-12-09 12:56:03 +00:00
dsa-t 9c619d8f4e Allow some navigation tools when selecting
Fixes https://gitlab.com/kicad/code/kicad/-/issues/9565
2021-12-07 23:00:39 +00:00
Jeff Young 73b39e836d Set modify bit when editing page layout.
Fixes https://gitlab.com/kicad/code/kicad/issues/9891
2021-12-06 23:08:33 +00:00
Wayne Stambaugh a03e6e4926 Revert "Eeschema: fix broken page numbers when renaming a sheet file name."
This reverts commit a468a79948.
2021-12-06 07:47:18 -05:00
Mikolaj Wielgus 10be483430 Make an exception for SCH_TEXT in SELECTION::GetCenter()
And undo the previous changes in SCH_TEXT::Rotate().

We continue hitting this with a wrench until it gets fixed or becomes
broken beyond any recognition.
2021-12-04 05:32:48 +01:00
dsa-t cb482eb8eb Symbol Fields Table: Highlight proper symbols even if they aren't annotated 2021-12-03 20:35:54 +00:00
Jeff Young 863699f2d1 Fix logic error in selection tool.
Any new selection made by clicking is not a hover selection.

Fixes https://gitlab.com/kicad/code/kicad/issues/9857
2021-12-02 16:56:47 +00:00
Mikolaj Wielgus 3960c2441b Snap rotation center to half-grid, not grid 2021-12-01 17:53:42 +01:00
Seth Hillbrand 85ab4e5886 Don't deselect wires when aligning
This makes undo/redo look really strange as the other elements get
aligned but the wires do not (or rather their unconnected ends do not)

Fixes https://gitlab.com/kicad/code/kicad/issues/9275
2021-11-30 16:30:28 -08:00
Wayne Stambaugh a468a79948 Eeschema: fix broken page numbers when renaming a sheet file name.
Remove duplicate instance data saved in both root SCH_SCREEN and SCH_SHEET
objects that was causing them to be out of sync.  All sheet instance data
is stored in the SCH_SHEET object itself and rebuilt on the fly so it is
always current.

Remove Get/SetPageNumber from SCH_SHEET_PATH object so it doesn't obfuscate
where the actual sheet page number information exists.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9782
2021-11-30 08:11:24 -05:00
dsa-t 5750e38102 Re-enable and fix Move+Autoplace Fields
Fixes https://gitlab.com/kicad/code/kicad/-/issues/9766
2021-11-29 20:48:16 +00:00
Jeff Young a224d8dd6c Disable autoplace fields when dragging/moving.
Fixes https://gitlab.com/kicad/code/kicad/issues/9766
2021-11-28 19:18:08 +00:00
Mikolaj Wielgus 9bb370e6b4 SCH_SHEET_PIN: Rename GetEdge, SetEdge to GetSide, SetSide 2021-11-28 20:07:06 +01:00
Jeff Young 80d6b9e76d Tighten up hittesting for symbols and other items.
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
2021-11-28 19:03:51 +00:00
Jeff Young 75d750a3cb Copy lastResolved stuff when pasting.
This of course assumes the paste came from the same document.  If not
then pasted items will get default lastResolved stuff.
2021-11-28 17:09:24 +00:00
Jeff Young f23cd9c9e5 Clearer naming. 2021-11-28 17:09:24 +00:00
Mikolaj Wielgus 65af3a8568 Make sheet pin positions invariant to four rotations more often 2021-11-28 02:18:18 +01:00
Jeff Young 9f7db24871 Selection bug fixes for Symbol Editor.
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
2021-11-27 15:17:05 +00:00
Jeff Young 87e71072b1 Default line width to 0 in symbol editor.
Also removes some atrophied settings for repeated non-pins in
symbol editor (which only ever repeats pins).

Fixes https://gitlab.com/kicad/code/kicad/issues/9776
2021-11-27 11:53:38 +00:00
Jeff Young 5863bc0937 Put Repair Schematic behind Advanced Config. 2021-11-25 12:56:46 +00:00
Jeff Young 5e6da9f964 Auto-start-wire tool requires an up-to-date connectivity.
Fixes https://gitlab.com/kicad/code/kicad/issues/9628
2021-11-25 01:24:35 +00:00
Jeff Young 7fc04c3cf2 Fixes for realtime connectivity being off.
Fixes https://gitlab.com/kicad/code/kicad/issues/9628
2021-11-24 13:20:44 +00:00
Jeff Young 9e999f4de4 ADDED Repair Schematic.
Fixes https://gitlab.com/kicad/code/kicad/issues/9749
2021-11-24 13:20:44 +00:00
Jeff Young 228edd4121 Don't generate duplicate IDs in line/wire/bus tool.
Also cleans up existing duplicate IDs when reading.

Fixes https://gitlab.com/kicad/code/kicad/issues/9749
2021-11-24 13:20:44 +00:00
Seth Hillbrand 2159acc9ce Fix missing handler for multiple labels
This was intended to handle multiple labels but we missed the selection
condition.

Fixes https://gitlab.com/kicad/code/kicad/issues/9704
2021-11-20 14:37:18 -08:00
Jeff Young 7bda077f69 Disable EE_POINT_EDITOR for uneditable symbol graphics.
Fixes https://gitlab.com/kicad/code/kicad/issues/9675
2021-11-18 15:38:46 +00:00
Jon Evans ae24daa033 Do not include text when computing drag origin for a group
Fixes https://gitlab.com/kicad/code/kicad/-/issues/9630
2021-11-14 11:54:04 -05:00
Wayne Stambaugh 53f5d616aa Coverity issue fixes. 2021-11-13 11:38:31 -05:00
Seth Hillbrand 6e5a918377 Writeable -> Writable 2021-11-08 15:56:51 -08:00
Roberto Fernandez Bautista 04a30638f0 eeschema: Pasted items are moving as soon as they are pasted
Fixes https://gitlab.com/kicad/code/kicad/-/issues/9539
2021-11-07 15:14:11 +00:00
Roberto Fernandez Bautista b572781a8a eeschema: Update anchor position of pasted items after initial move
Fixes https://gitlab.com/kicad/code/kicad/-/issues/9534
2021-11-06 16:03:41 +00:00
Roberto Fernandez Bautista d1bab3116d eeschema: Warp to origin when moving - add missing text items
Schematic fields and text items were not being warped to origin when
moving.
2021-11-06 15:19:22 +00:00
Jeff Young 996a5b85a6 Overhaul IsJunctionNeeded logic to support all the different cases.
Several clients were using this with different needs.  The API is
now more explicit (and there are more options under the hood).

Fixes https://gitlab.com/kicad/code/kicad/issues/9518
2021-11-04 12:57:16 +00:00
Jeff Young 40b4052ad4 Improve text hittesting in schematics.
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
2021-11-01 21:13:12 +00:00
Jeff Young 9f806d9304 Don't assume the grid size.
Fixes https://gitlab.com/kicad/code/kicad/issues/9013
2021-11-01 15:26:39 +00:00
Jeff Young f345eacf13 Be more careful with undo, and don't re-merge a bus over a bus entry.
Fixes https://gitlab.com/kicad/code/kicad/issues/9475
2021-10-30 19:58:09 +01:00
Roberto Fernandez Bautista c5cdda26ae Fix crash in libedit when moving/editing pins in synchronised mode
Unit numbers start at 1, not 0. Our vector needs to be size + 1 if we want
to use the unit number as an index.
0 is reserved for "all units"
2021-10-30 18:14:23 +01:00
Jon Evans d426abafd7 Handle empty shape in removeCornerCondition
Fixes https://gitlab.com/kicad/code/kicad/-/issues/9495
2021-10-30 13:10:12 -04:00
Jeff Young b967610e05 Remove confirmation for De Morgan (and spell his name right).
Fixes https://gitlab.com/kicad/code/kicad/issues/9483
2021-10-29 20:30:37 +01:00
Jeff Young 1fa9ad227a Repair new junction logic for crossing wires.
Fixes https://gitlab.com/kicad/code/kicad/issues/9484
2021-10-29 19:09:02 +01:00
Seth Hillbrand 18318c73b5 Fix swapped parameters 2021-10-27 08:59:39 -07:00
Seth Hillbrand dd99b2dc2f Add action to edit symbol from Library
Analog of ea4e06124e for symbol editor.  Allows scripting to open
library symbol
2021-10-26 12:59:59 -07:00