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
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)
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.
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
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.
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
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.
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.
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.
* 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.
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.
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
When generating a complex pad, this allows the user to combine with a
rotated pad and explode rotated pads without needing to rotate elements
to 0 orientation first.
Fixes: lp:1808137
* https://bugs.launchpad.net/kicad/+bug/1808137
This removes unused static function in page layout editor, unused
variable in pcb_painter and restors the gcc unitialized fix for
pcbnew's drawing_tool.
Includes the addition of an onSetCursor() handler which must be called
from both the GAL canvas AND the GAL backend (at least on OSX) to prevent
cursor flickering between (for instance) pencil and arrow.
Also includes new architecture for point editors which allows them to
coordiate cursors with the editing tools (so we can switch to an arrow
when over a point).
We were running into various corner conditions where a tool's event
loop would exit while the tool was still active, or the tool would
get popped while we were still in the event loop. (A lot of these
had to do with the POINT_EDITOR's, but not all of them.)
The new architecture:
1) tools always do a Push()/Pop()
2) everyone is responsible for their own pops; no more stack-clearing
on a cancel
3) CancelInteractive events go to all tools to facilitate (2)
It's a bit of a hack because they're statically initialized and
so we can't make use of the _() macro. We do still want it in the
code, however, because the string harvesting is based off of it.
Fixes: lp:1833000
* https://bugs.launchpad.net/kicad/+bug/1833000
Set the IS_NEW flags so the POINT_EDITOR doesn't try an poke its head
in, and apply the EE_SELECTION_TOOL hack for mouse clicks leaking
through to the underlying tools.
Fixes: lp:1832911
* https://bugs.launchpad.net/kicad/+bug/1832911
Two issues:
* Unassigned hotkeys were being passed to WX in the menu strings as
"<unassigned>". WX doesn't recognise this, and prints debug each time.
Unassigned hotkeys are no longer rare or naughty, so we shouldn't provoke
debug spew. Suppress by not appending hotkey strings for actions with 0
(i.e. unassigned) hotkey IDs.
* The zone cutout tool uses GR_KB_SHIFT, not MD_SHIFT. This causes
"unknown hotkey" spew from WX.
Mouse capture end is called by some actions such as save board. This
resets the cursor image but doesn't change the current tool. Resetting
the cursor image during action prevents this.
(cherry picked from commit 35e87128f5)
Fixes: lp:1831888
* https://bugs.launchpad.net/kicad/+bug/1831888
When using "Place Text" the crosshair was freezing if cancelled before
placing text.
After the crosshair freezes, the next uses of the "Place Text" or
"Add Dimension" caused the crosshair to jump to the screen location
where the previously the crosshair was frozen.
Cancelling the "Add Dimension" caused the crosshair to jump to the
screen location where the crosshair was when cancelled on the next use
of the "Place Text" or "Add Dimension".
Fixes: lp:1822578
* https://bugs.launchpad.net/kicad/+bug/1822578
Rather than selecting an arbitrary track to snap, we select the closest
track to our point, allowing the via to be placed along the full track
length.
Fixes: lp:1813324
* https://bugs.launchpad.net/kicad/+bug/1813324
Prior to placing the via, we check if the resulting via will pass too
close to different nets on different layers.
Fixes: lp:1718827
* https://bugs.launchpad.net/kicad/+bug/1718827
When creating the zone cutout, we delete the old zone and add a new one
with each cutout. This requires resetting the source zone and clearing
our previous selection if we would like to continue using the cutout
tool on the new zone.
Fixes: lp:1812339
* https://bugs.launchpad.net/kicad/+bug/1812339
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.
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.
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
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
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
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.
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.
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
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
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
Includes some dialog changes to go with the menu update.
Includes promoting the Pcbnew graphics mode back to main menu.
Includes renaming Graphics modes to Toolsets.
Rename GetPolyPoint() to BuildPolyPointsList(), because GetPolyPoint() looks like an accessor, but it is not an accessor.
(Using it as accessor can creates a *very long calculation time* for very basic access to polygon vertices)
Fixes: lp:1745050
https://bugs.launchpad.net/kicad/+bug/1745050