Commit Graph

1139 Commits

Author SHA1 Message Date
jean-pierre charras be6379a8f6 Fix minor Coverity and compil warnings. 2022-04-01 20:43:21 +02:00
jean-pierre charras 5d9668938b SYMBOL_EDITOR_CONTROL::DuplicateSymbol(): fix incorrect validation test.
DuplicateSymbol() is called both to duplicate and paste. Only duplicate
needs a test to know if a symbol is selected.
Fixes #11053
https://gitlab.com/kicad/code/kicad/issues/11053
2022-04-01 10:42:20 +02:00
Jeff Young 7c21a0bdd4 Dirty text render caches in point editor.
Fixes https://gitlab.com/kicad/code/kicad/issues/11284
2022-03-30 16:32:23 +01:00
Jeff Young 8dc680adbb Implement align-to-grid for sheets.
Fixes https://gitlab.com/kicad/code/kicad/issues/11201
2022-03-29 19:31:02 +01:00
Jeff Young 4ee6f9e138 Make sure setting the cursor gets put into the right tool context.
Fixes https://gitlab.com/kicad/code/kicad/issues/10141
2022-03-28 21:54:24 +01:00
Mike Williams 2a726a882f Schematic: new feature, force 45 degree lines
* New modes to force 45 deg angle at beginning or end of line

* Backspace will undo most recent segment added

* / will toggle posture of 90 and 45 degree lines

* Added alg::signbit for convenience

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/10869
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/9175
2022-03-28 16:07:23 -04:00
Mike Williams e51ab86225 Schematic Drag: fixes and improvements
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
2022-03-28 16:02:48 -04:00
Jeff Young 343b2681d4 Midpoints for eeschema rectangles and text boxes.
Fixes https://gitlab.com/kicad/code/kicad/issues/10362
2022-03-28 11:16:39 +01:00
jean-pierre charras 38bd612c01 sch_sexpr_parser.cpp: allows reading a polyline descr with more than 2 points
In symbols, a polyline descr is already a true polyline / polygon descr.
In schematic, a polyline descr was restricted to only 2 points (a line).
A true polyline / polygon descr is now allowed in schematic that support already
polygons.
For compatibility reason, a 2 points polygon (SCH_SHAPE) is converted to a SCH_LINE.
2022-03-27 10:31:21 +02:00
Jeff Young a54457386c Enable immediate mode for pin tool.
Fixes https://gitlab.com/kicad/code/kicad/issues/10156
2022-03-26 21:07:10 +00:00
Jeff Young 0652c7b429 More visible Synchronized Pins Mode informatics.
Fixes https://gitlab.com/kicad/code/kicad/issues/10340
2022-03-26 15:16:08 +00:00
Jeff Young 1c158a4ea4 Use a standard HTML reporter for Symbol Checker. 2022-03-26 14:22:31 +00:00
Wayne Stambaugh 7da7864f5e Fix some Coverity issues. 2022-03-25 15:51:05 -04:00
jean-pierre charras 21144481d2 PLOTTER: do not clamp coordinates to an arbitrary value.
Previously, coordinates were clamped to +- 60 inches. It makes no sense to
clamp them at plotter level: max cooed depends on the editor (schematic/board...)
Rename MAX_PAGE_SIZE_MILS to MAX_PAGE_SIZE_EESCHEMA_MILS and use it only for Eeschema.
Fixes #11196
https://gitlab.com/kicad/code/kicad/issues/11196
2022-03-22 10:32:36 +01:00
Jeff Young 4f62960334 Update message panel from PCB point editor and SCH drawing tools.
Fixes https://gitlab.com/kicad/code/kicad/issues/11186
2022-03-21 10:32:36 +00:00
Jeff Young 63b5ad7df1 Fix some issues with global-label fields' bounding boxes. 2022-03-19 19:37:01 +00:00
jean-pierre charras 77c52ad5df Fix a compil warning (shadowed var). 2022-03-17 20:13:17 +01:00
Jeff Young 400cff994d Update value & footprint from clipboard whether keeping annotation or not.
Fixes https://gitlab.com/kicad/code/kicad/issues/11116
2022-03-17 18:19:13 +00:00
Jeff Young 05bca282f7 Re-entrancy blocker for line/wire/bus tool.
Also clear infobar messages after a cancelInteractive.

Fixes https://gitlab.com/kicad/code/kicad/issues/11155
2022-03-17 15:27:33 +00:00
Jeff Young e68e2e973e Separate Line Properties dialog from Bus/Wire, and handle Junctions in Bus/Wire.
Fixes https://gitlab.com/kicad/code/kicad/issues/9979
2022-03-16 14:56:32 +00:00
Jeff Young ec44dfa60f Unescape value fields when pasting from legacy schematics.
Fixes https://gitlab.com/kicad/code/kicad/issues/11124
2022-03-13 22:17:44 +00:00
Jeff Young 1f745b000d Special-case synthetic click after tool selection.
Fixes https://gitlab.com/kicad/code/kicad/issues/11057
2022-03-07 20:30:50 +00:00
Jeff Young 39fa4e2065 Include textbox in movable objects.
Fixes https://gitlab.com/kicad/code/kicad/issues/11058
2022-03-07 10:33:59 +00:00
jean-pierre charras dbfdd3fb56 Fix some Coverity warnings. 2022-03-06 09:48:33 +01:00
Seth Hillbrand 7ecc70a79d Duplicate from selected or current
When double-clicking to open a symbol, it is no longer selected in the
tree.  We need to use the `GetTargetLibId()` to pick the correct symbol
(first selected, then current) when using the duplicate command

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

(cherry picked from commit 802d20c409)
2022-03-03 16:04:22 -08:00
Seth Hillbrand 548936bb22 Fix broken unit select context menu
The fix for https://gitlab.com/kicad/code/kicad/issues/10529 kicked the
subsequent IDs for unit selection off the maximum ID value for popup
menus.  This increases the maximum popup number (integers are free)

(cherry picked from commit 79b6991d7b)
2022-03-02 16:33:28 -08:00
Mike Williams 5503afc09a Schematic: disallow center rotation, allow both endpoint rotations
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)
2022-02-28 08:50:12 -08:00
Jeff Young c4d2ac570f Don't allow break commands (or labelling cmds) on multiple wire selections.
Fixes https://gitlab.com/kicad/code/kicad/issues/10934
2022-02-27 23:15:07 +00:00
Seth Hillbrand 535ea800c0 Honor modifier keys in diambiguation
Needs to be reset for the new action before selecting elements at a
point.

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

(cherry picked from commit a30ad0b54a)
2022-02-25 16:16:15 -08:00
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