Commit Graph

291 Commits

Author SHA1 Message Date
Jon Evans 75ffce1a0b ADDED: Leader dimension object
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5555
2020-09-15 23:37:38 -04:00
Seth Hillbrand 08bf5f4b4e ADDED: 45° snapping for rectangles aka Squares
The snap obeys only the Ctrl key and not the global preference setting
for drawsegments because rectangles are _always_ on H/V lines when drawn

Fixes https://gitlab.com/kicad/code/kicad/issues/5607
2020-09-15 11:22:26 -07:00
Jon Evans 3940e20fcb Expose extension offset and zero suppression settings 2020-09-12 11:52:59 -04:00
Jon Evans e40287d327 Fix auto units to work when drawing new dimensions 2020-09-12 10:30:33 -04:00
Jon Evans 0e9997d9ca Add new dimension features to board design defaults 2020-09-11 21:12:36 -04:00
Jon Evans b11e315d10 Refactor DIMENSION to hide internal details; add some new properties
This is a board file format change to account for the new properties.
Also, we now only store the critical information about the dimension's
geometry in the board, rather than storing every drawn line.

The DIMENSION object is now an abstract base, and ALIGNED_DIMENSION
is the implementation that exists today (we will add more dimension
types in the future)
2020-09-11 21:12:36 -04:00
Seth Hillbrand f493e270ea ADDED: Menu option to enable/disable snap to grid
You can now enable and disable snap to grid when drawing/editing across
all apps.  You can also tie snap to grid to the visibility of the grid
to allow rapid enable/disable via grid display.
2020-09-10 20:09:30 -07:00
Seth Hillbrand 4026904cc4 Make grid snapping depend on grid visibility
Turning the grid view on enables snapping to the grid.  Turning it off
removes the snap and allows free draw
2020-09-09 10:18:15 -07:00
Seth Hillbrand 173b4ff588 Add snapping to eeschema
This generalizes both the SetPosition() function and ORIGIN_VIEWITEM
class away from the pcbnew-centric.
2020-09-09 10:18:15 -07:00
Jeff Young 6e72f609f0 Make sure router and via tools update when sizes change.
Also adds a size menu to the context menu for the Via tool.

Fixes https://gitlab.com/kicad/code/kicad/issues/5321
2020-08-31 23:33:02 +01:00
Jeff Young c71bb246e6 Don't allow preview to try and draw empty polygons.
Fixes https://gitlab.com/kicad/code/kicad/issues/5314
2020-08-22 23:46:56 +01:00
Seth Hillbrand 20de1b2b4f Minor code tightening 2020-08-20 20:18:31 -07:00
PJM 29ddc73d6c Pcbnew: Allow rects to have overlapping end corner locations
CHANGED: If a rectangle is drawn and the location of the second corner
is the same as another rectangle's second corner, Pcbnew crashes. The
reason is that a call is made to DRAWSEGMENT::GetLength(), but that
function only handles shapes of type S_CURVE and S_SEGMENT.  This code
checks if the overlapping end points are from a rectangle and if so
it doesn't call DRAWSEGMENT::GetLength().

Fixes https://gitlab.com/kicad/code/kicad/issues/5282
2020-08-21 02:58:32 +00:00
Ian McInerney c479deaf02 Use groups when doing graphics import
ADDED: Allow DXF/SVG graphics to be imported as a group

Also, cleanup the placement routine to allow the edit tool's flip
and rotate routines to be used when placing the items.
2020-08-20 01:22:48 +01:00
Marek Roszko d2086eecdd Don't update panel while drawing a dimension 2020-08-18 13:11:47 +00:00
Marek Roszko 73b2a10cab Don't try updating msgpanel while segments. 2020-08-18 13:11:47 +00:00
Marek Roszko a0956fbf97 text tool: msgpanel on motion is the same as msgpanel on not moved text.... 2020-08-18 13:11:47 +00:00
Jeff Young 34705fd8b2 More clone vs duplicate bugs.
Fixes https://gitlab.com/kicad/code/kicad/issues/5120
2020-08-10 14:45:01 +01:00
Fabien Corona 133d082cc5 Pcbnew fix arc edition 2020-08-09 23:03:31 +00:00
Jeff Young e5b50d90a7 Update DRC rules to new layer and disallow grammars.
Also adds support for hooking rules up to named zones.

Fixes https://gitlab.com/kicad/code/kicad/issues/2041
2020-08-07 21:49:36 +01:00
Jeff Young 7108a25278 Fix issues flipping text.
This is a really hard problem to get right.  This algorithm won't
look quite right if you assemble a paragraph from disjoint text
objects and flip them all top-to-bottom (as it will re-order the
text).  But this is really the nature of the problem (and has to
stay that way to correctly flip disjoint graphic items or mixed
text and graphic items).  The real fix here is to support text
wrapped in a single text box.

Fixes https://gitlab.com/kicad/code/kicad/issues/4480
2020-08-02 17:05:13 +01:00
Thomas Pointhuber 7ba6a77c94 Improve arc geometry manager to choose the direction which makes more sense
As long as the arc angle stays below <60°, it will automatically choose between
clockwise and counter clockwise. This allows the user to choose the direction
with a simple mouse movement.
2020-07-03 15:05:17 +00:00
Jon Evans 0d4ee39f75 CHANGED: Copper zones can be on more than one layer
Fixes https://gitlab.com/kicad/code/kicad/-/issues/1963
2020-06-28 08:52:37 -04:00
Jeff Young 367fd79b5f Don't try and second-guess the user.
(Especially now that polygons are useful on copper layers for custom
pad shapes.)
2020-06-27 22:08:13 +01:00
Jon Evans a16c9df79c Delete the right object in arc cleanup
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4694
2020-06-21 13:03:14 -04:00
jean-pierre charras ad69e449fe Fix a collision name in drawing_tool.h with a msys2 header 2020-06-21 10:36:01 +02:00
Jeff Young a3cab09fb4 Make it clearer that drawSegment() can modifiy the current seg pointer.
This might also quiet the Coverity warning, but I've also marked it as a
false positive (as it might still mess up on the new code).
2020-06-17 18:44:39 +01:00
Seth Hillbrand 8c57821e9b pcbnew: Move ratsnest items to separate folder 2020-06-16 11:15:14 -07:00
Jeff Young aeed8e6e2c Finish implementation of DRAWSEGMENT::C_RECT.
It's currently only supported in the Footprint Editor.  It could be
easily added to the board editor (all the code is there), but the board
editor is a little short on room in the drawing tools toolbar.
2020-06-15 20:51:31 +01:00
Jeff Young 47ab7c78a6 Divorce GRID_HELPER from the parent frame.
This moves GRID_HELPER fully into the tool framework.
2020-06-13 22:44:16 +01:00
Jeff Young 19dc1f8b69 Make sure text gets drawn after placing even if the mouse isn't moved. 2020-05-09 14:14:38 +01:00
Ian McInerney f649204c04 Allow graphic polygons/keepouts to be closed automatically
ADDED: Auto close option for graphic polygons/keepouts/cutouts
ADDED: Delete last point option for graphic polygons/keepouts/cutouts

Fixes https://gitlab.com/kicad/code/kicad/issues/2350
2020-04-24 18:35:43 +01:00
Jeff Young cb708aaadb Fix some memory leaks. 2020-04-16 21:57:07 +01:00
Jeff Young 9c8941e040 Remove a bunch of globals. 2020-04-16 17:34:46 +01:00
Jeff Young 6e800bddae Rationalize penWidth processing as first step in removing some globals. 2020-04-13 20:58:13 +01:00
Jon Evans e59a3d981e Implement a new settings framework across all of KiCad
CHANGED: Settings are now stored in versioned sub-directories
ADDED: First-run dialog for migrating settings from a previous version
CHANGED: Settings are now stored as JSON files instead of wxConfig-style INI files
CHANGED: Color settings are now all stored in a separate settings file
CHANGED: The symbol editor and footprint editor now have their own settings files
CHANGED: Color settings are no longer exposed through BOARD object
CHANGED: Page layout editor now uses Eeschema's color scheme

Settings are now managed through a central SETTINGS_MANAGER held by PGM_BASE.
Existing settings will be migrated from the wxConfig format on first run of each application.
Per-application settings are now stored in one class for each application.
2020-02-19 23:44:56 -05:00
Ian McInerney 34e5b76c5f Add virtual constructors to some classes that should have them
This is more for safety from undefined deletion behavior than
anything else (it also silences the Clang -Wnon-virtual-dtor warning).
2020-02-05 22:19:14 +00:00
Seth Hillbrand 7c296fbcb7 GRID_HELPER: Provide alignment axes from snap points
ADDED: alignment lines from item snap points

Alignment lines are shown when moving the cursor horizontally or
vertically from a possible snap point.
2020-01-18 20:43:40 -08:00
Ian McInerney 13b6028e1b Refactor all math into a new kimath library
* Split up the thirdparty code into the thirdparty folder (#3637)
* Create a new kimath static library containing all the math functions

This is part of cleaning the build system for #1906.
2020-01-07 17:12:59 +00:00
Mark Roszko 19ceb11ae7 Change more enums over to scoped enums 2019-12-28 00:55:11 +00:00
Mark Roszko 11ff16be4e Switch to scoped enums 2019-12-20 14:11:39 +00:00
Jeff Young 1c153c55c0 Add default units and precision for new dimension objects.
Fixes: lp:1846376
* https://bugs.launchpad.net/kicad/+bug/1846376
2019-11-05 17:22:51 +00:00
Seth Hillbrand 2e1af66a2b pcbnew: Commit polygon points to new constrained zone
Adds leader points if they are not already existing in the zone

Fixes: lp:1846028
* https://bugs.launchpad.net/kicad/+bug/1846028
2019-10-20 09:29:35 -07:00
Ian McInerney 0aa5424511 pcbnew: Switch over some drawing tools to use PrimeTool
Before, if the tools were activated from the context menu,
they would start drawing where the menu item was selected
instead of where the menu was opened.
2019-10-03 19:04:36 +01:00
Jeff Young d2cd659471 Be better about cleaning up mouse capture.
Fixes: lp:1841996
* https://bugs.launchpad.net/kicad/+bug/1841996
2019-08-29 23:56:16 +01:00
Jeff Young 359cf384de Import graphics is a one-shot, not a tool.
Fixes: lp:1841975
* https://bugs.launchpad.net/kicad/+bug/1841975
2019-08-29 23:56:16 +01:00
Seth Hillbrand 64c012c175 modedit: Enable snapping on anchors
The selection of footprint anchor should obey normal snapping paradigm.
2019-08-28 10:38:27 -07:00
Jeff Young 3f28a1d1cb Cleanup after cancelled add text dialog.
Fixes: lp:1838452
* https://bugs.launchpad.net/kicad/+bug/1838452
2019-07-31 23:10:13 -06:00
Jeff Young 5347c2ad3d Clear selection when running drawing tools.
Fixes: lp:1837796
* https://bugs.launchpad.net/kicad/+bug/1837796
2019-07-26 23:38:37 -06:00
Jeff Young 77334628c4 Change default tool behaviour to skip unhandled events.
The problem is that wxEVT_CHAR_HOOK doesn’t do the key translation
properly.  wxEVT_CHAR does, but we only get to that if we skip the
event at the end of the tool’s event processing loop, which most tools
don’t do.  (Selection tools, point editors, pickers, and a couple of
others do skip, which is probably why this didn’t get reported earlier.)

I played around with a couple of ways to fix wxEVT_CHAR_HOOK.  Most of
them don’t work, and the few egregious hacks I tried weren't cross-
platform.

So I’m changing it so that most tools now skip at the end of their
event loops.  I left out a couple that I felt were high risk (length
tuning, for instance).  But there’s still enough risk that I’m 100%
sure it will break something, I just haven’t a clue what.

Fixes: lp:1836903
* https://bugs.launchpad.net/kicad/+bug/1836903
2019-07-26 12:21:24 -06:00