Commit Graph

162 Commits

Author SHA1 Message Date
Jeff Young 37af3adffb Add preference for flip axis.
Fixes: lp:1836267
* https://bugs.launchpad.net/kicad/+bug/1836267
2019-07-14 10:36:48 +01:00
Jeff Young c2662b0e11 Retire EDA_DRAW_PANEL and legacy_wx/EDA_DRAW_FRAME. 2019-05-31 21:55:30 +01:00
Jeff Young d6e9bdf07b Convert remaining legacy drawing code to print code. 2019-05-31 21:54:22 +01:00
Jon Evans adfc4d2485 PcbNew: fix Bezier curves not having bounding boxes at startup 2019-05-29 00:17:34 -04:00
Jeff Young b83dac68d0 Fix drag-select hit-testing of LibEdit items. 2019-05-10 23:24:27 +01:00
Seth Hillbrand f7c042a357 pcbnew: Allow curves in custom pads
Updates custom pad functions to permit adding arbitrary curves to the
primitives
2019-05-08 15:54:26 -07:00
Jeff Young fd546da640 Homogenize hit testing and selection return types.
Prep work for sharing SCH_SELECTION_TOOL with LibEdit.
2019-05-05 17:14:30 +01:00
Seth Hillbrand 24bf838392 pcbnew: Allow arc editing via midpoint
This permits changing the radius of the arc by adjusting the center
point of the arc.  The arc end points are fixed in this operation.
2019-04-07 06:50:25 -07:00
Seth Hillbrand ec24981cc8 pcbnew: Don't refresh S_CURVE in bbox()
The bounding box calculation needs to be fast and is threaded in many
places in pcbnew.  We cannot invalidate items (the function is const but
this wasn't caught at compile-time for some reason) when getting the
bbox. This shouldn't be an issue as the m_BezierPoints is rebuilt each
time the curve is updated, so rebuilding during the bbox seems extra.

Fixes: lp:1819984
* https://bugs.launchpad.net/kicad/+bug/1819984
2019-03-14 05:47:05 -07:00
Seth Hillbrand 5c5979dfc6 pcbnew: Fix polygon hittest
Previous version had minimum width to account for it being difficult to
click on small lines.  This should not be used for filled polygons

Fixes: lp:1808141
* https://bugs.launchpad.net/kicad/+bug/1808141
2018-12-12 17:23:40 -08:00
jean-pierre charras 754837f947 Pcbnew: DRAWSEGMENT polygonal shape: fix drawings in Legacy mode. Add IsPolygonFilled() to know if the polygon is filled or not.
IsPolygonFilled() replaces the hard coded comparisob with Edge_Cut in code.
For now the polygon is not filled only on Edge_Cut layer.

But in the future, it could be an option for other layers.
2018-12-05 09:57:59 +01:00
Seth Hillbrand b8309e2a70 pcbnew: Edgecuts polygons only hit edges
Only allow hittest for edgecuts polygons on their edges as we do not
display the fill for this layer.

Fixes: lp:1806782
* https://bugs.launchpad.net/kicad/+bug/1806782
2018-12-04 17:19:40 -08:00
Seth Hillbrand ecc80c00a5 pcbnew: Initialize DRAWSEGMENT to default width
The check against S_POLYGON was always false because we set the default
type to S_SEGMENT.  This unifies the magic numbers to the board design
settings file
2018-10-08 09:07:24 -07:00
Seth Hillbrand 6a6d580a1c pcbnew: Improve zone/polygon selection
Allows selection of polygons and zones by their visible area.  Will only
select polygons/filled areas when they are unobstructed by other
elements in the footprint/pcb.  Also adds a "skip heuristics" modifier
key for clicking (ALT) that allows the full disambiguation list to be
displayed without removing less-likely elements.  This dovetails the
zone/polygon selection as it allows selecting even when areas a fully
overlapped.

Fixes: lp:1753153
* https://bugs.launchpad.net/kicad/+bug/1753153
2018-10-03 06:23:35 -07:00
jean-pierre charras d73db8c73a Make a few strings not internationalized, because they must not be translated (html format strings) 2018-07-28 12:47:23 +02:00
jean-pierre charras 4cac974420 Add Bezier curve (S_CURVE shape) support in DIALOG_GRAPHIC_ITEM_PROPERTIES.
Fix some issues related to S_CURVE shape support.
2018-07-22 18:39:48 +02:00
jean-pierre charras 72d1597201 DXF import: add import of DXF splines that are converted to Bezier curves.
Fix also a lot of bugs related to Bezier curves (S_CURVE shape in DRAW_SEGMENT class) in Pcbnew code.
Add missing code to handle these Bezier curves
2018-07-22 18:39:47 +02:00
Jeff Young eacaa39aa2 Remove global units usage from GetSelectionText...
... and GetMsgPanelInfo.

Step 4 in the g_UserUnit eradication effort.

Also removes a couple of conversion routines that were close
enough to extinction.

(cherry picked from commit c75da51)
2018-07-17 15:11:09 +01:00
Jeff Young f7861c90ec Use more self-documenting names for conversion routines.
In particular, make sure no one thinks the low-precision ones are
OK for dialogs and/or files.

(cherry picked from commit bc1fcfa)
2018-07-17 15:10:13 +01:00
Jeff Young b99ea159c8 Rationalize select menu texts.
Be consistent with order, formatting, etc.
Remove debug stuff such as zone timestamp and net code.
Clean up misleading pad messages.

(cherry picked from commit 2132109)
2018-07-17 15:09:48 +01:00
Seth Hillbrand ca544eb138 Adding radius info to panel for arcs/circles 2018-04-17 11:21:34 -07:00
Seth Hillbrand 6d855cbccb Remove extraneous assert
Fixes: lp:1764619
* https://bugs.launchpad.net/kicad/+bug/1764619
2018-04-17 10:53:27 -07:00
Andrzej Wolski 9241a399a7 Add EDA_RECT hit test for S_POLYGON
Fixes lp:1749989
2018-02-19 10:59:02 +01:00
Jeff Young b0d1e49319 Fix plotting of 360 degree arcs and printing of mirrored arcs.
The second issue is OSX-only; the first is universal.
2018-02-05 07:53:51 +01:00
jean-pierre charras 8552f3fedf fix code after renaming files 2018-01-29 22:00:44 +01:00
jean-pierre charras 5d72aebd22 Fix code after renaming files 2018-01-29 16:40:22 +01:00
jean-pierre charras d0754acf00 Fix code after renaming files 2018-01-29 11:37:29 +01:00
jean-pierre charras 270a63daac DRAWSEGMENT, S_POLYGON shape: remove useless copies or conversion to std::vector<wxPoint> of SHPE_POLY_SET polygon shape.
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
2018-01-24 14:22:43 +01:00
jean-pierre charras 52eedc7192 Footprint editor: Fix a crash when trying to create a custom pad from selected graphic primitives. 2018-01-12 21:25:45 +01:00
Tomasz Włostowski a4528988ca pcbnew: fix graphical polygon movement, rotation, flipping and edit points synchronization.
Fixes: lp:1738449
* https://bugs.launchpad.net/kicad/+bug/1738449

Fixes: lp:1738032
* https://bugs.launchpad.net/kicad/+bug/1738032
2017-12-18 18:25:45 +01:00
jean-pierre charras 2ec3a46984 Add support of DRAWSEGMENT S_POLYGON shape to plot functions.
Fixes: lp:1732570
https://bugs.launchpad.net/kicad/+bug/1732570
2017-11-16 12:09:24 +01:00
jean-pierre charras 25f9c6e4f9 Incorrect default value (not saved in file) of DRAWSEGMENT width, for the S_POLYGON shape.
The value of the width is now always saved to avoid this kind of issue.

Also Fixes: lp:173257
2017-11-16 09:38:26 +01:00
Marvin Schmidt 69974b73db Remove some extra semicolons 2017-11-09 19:52:18 +01:00
Tomasz Włostowski 0245912c34 refactoring: split BOARD_ITEM::SwapData to use polymorphic per-item methods 2017-11-03 20:02:06 +01:00
Tomasz Włostowski 81d1e17f02 refactoring: renamed pcbstruct.h to pcb_display_options.h, DISPLAY_OPTIONS->PCB_DISPLAY_OPTIONS 2017-11-03 20:02:06 +01:00
jean-pierre charras 78ec983632 DRAWSEGMENT fix crash when trying to copy a empty polygon.
SHAPE_POLY_SET: fix crash in VertexCount when it is a empty poly set, or when params are incorrect.

minor other fixes:
warning in degug mode in dialog_dxf_import_base.cpp
pcb_painter.cpp: remove a useless debug line.
2017-10-25 09:39:26 +02:00
jean-pierre charras 7418deb454 Pcbnew: fix issues with 360 deg angle arcs.
Fixes: lp:1725943
https://bugs.launchpad.net/kicad/+bug/1725943
2017-10-23 15:35:03 +02:00
jean-pierre charras 0b1eb5695f Fix crash when converting selected EDGE_MODULE items to a custom pad. 2017-10-21 12:46:59 +02:00
Tomasz Włostowski ac095b6724 pcbnew: tools for converting between custom-shaped pads and graphical shapes 2017-10-19 23:35:18 +02:00
jean-pierre charras 19ad350c1c Fix a bug in DRAWSEGMENT::GetParentModule() that expected a non null parent to return a null parent! 2017-09-08 20:19:14 +02:00
Tomasz Włostowski 32185ddcd3 Multiple improvements concerning colors, configuration handling and legacy features in pcbnew:
- support for background color setting
    - removed several global config settings (such as g_Drc_On)
    - wrapped most of global config settings in PCB_GENERAL_SETTINGS class
    - reorganized PCB general options dialog to clearly mark which options concern only the legacy canvas
    - new GAL feature for legacy users: double-click (or E) to change track width available as an option.

Fixes: lp:1530543
* https://bugs.launchpad.net/kicad/+bug/1530543

Fixes: lp:1707145
* https://bugs.launchpad.net/kicad/+bug/1707145
2017-08-04 16:06:57 +02:00
Maciej Suminski e79f97860c Bezier2Poly refactor
Before the refactor library browser display Bezier curves correctly only
once, at other times they were just straight lines or crashed the
application.
2017-05-16 17:58:09 +02:00
Oliver Walters 2ae47d31cc Fix for Arc HitTest
compureArcBBox does not account for line width
2017-05-10 10:57:29 +02:00
Oliver Walters f338d46476 HitTest for Rectangular pads
HitTest for Rectangular pads

- Works at any rotation, even with Shape Offset
- Fixed bugs in D_PAD BoundingBox calculation
2017-05-10 10:57:28 +02:00
Oliver Walters a0afcd5a62 HitTest for pads
- Circular pads
2017-05-10 10:57:28 +02:00
Oliver Walters 2b4c2efc85 Fixed HitTest for Arc segment 2017-05-10 10:57:28 +02:00
Oliver Walters f8734bd057 Fixed ::HitTest for Circle shape
- Testing against rectangle intersection now works correctly
- Previously tested against BoundingBox() not circle outline
2017-05-10 10:57:28 +02:00
Jon Evans 3ec28e2acf Refactor layer enumerations to all live in the same place 2017-03-30 16:01:48 -04:00
Jon Evans a52250a91e Change from EDA_COLOR_T to COLOR4D globally; arbitrary color support
eeschema now supports arbitrary colors for all object types, and
pcbnew does in GAL canvas.  When switching from GAL to legacy canvas,
pcbnew will convert colors to the nearest legacy color.
2017-02-22 17:35:00 +01:00
John Beard a8eea6155a Move bitmaps.h out of base_struct.h
bitmaps.h was included in nearly every file in the project due to it
being included by base_struct.h

Only about 130 files actually use the XPM definitions defined there, and
many of those already included bitmaps.h themselves, or via
menu_helpers.h. However, touching bitmaps.h would result in over 400
rebuilt files for pcbnew alone.

This commit moves the bitmap-related types like BITMAT_DEF out to a new
header, which is still included by base_struct.h, which is less
avoidable for now, it's it's used in the interface.

The icon list is still in bitmaps.h. This has the side effect that's
it's now easier to automatically generate this file.

Many classes in pcbnew and eeschema needed some functions moved
to the implementaitons from the headers too.
2017-02-21 09:50:15 -05:00