7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-07 15:35:32 +00:00
Commit Graph

81 Commits

Author SHA1 Message Date
Wayne Stambaugh
89db935910 Housekeeping in include path sub-folders. 2025-01-04 09:21:11 -05:00
Seth Hillbrand
0b2d4d4879 Revise Copyright statement to align with TLF
Recommendation is to avoid using the year nomenclature as this
information is already encoded in the git repo.  Avoids needing to
repeatly update.

Also updates AUTHORS.txt from current repo with contributor names
2025-01-01 14:12:04 -08:00
Seth Hillbrand
9dfcb6a362 Cleanup ViewGetLayers()
Old style c-array replaced with vector returns
2024-11-21 13:18:36 -08:00
John Beard
3549b77530 Ruler: fix colours when not the same as the cursor strings
Implement a simple RAII GAL attribute save/restore
class that handles putting the GAL back the way it was found.

This makes draw methods easier to write, as they don't need
to worry if a called method will upset the attribute context
(as long as the caller saves the context, or the callee does).

Obviously not a good idea to use in tight loops, but when text
is involved, this is negligible!
2024-11-04 20:41:20 +08:00
John Beard
11ac6ea976 Position interactive: use the forward vector value
On reflection, the forward vector makes more sense, because
the value in the edit box is then the same as the vector the
user just drew with the ruler.
2024-11-04 20:41:20 +08:00
John Beard
e6e1253fea Pcbnew: allow to copy the ruler co-ordinates 2024-11-04 20:37:14 +08:00
John Beard
c956e6761b Pcbnew: add interative relative offset tool 2024-10-30 09:00:14 +08:00
John Beard
4bad76825c Standardise clamp function
std::clamp and alg:clamp had different argument orders.
Since std::clamp is constexpr, we might as well just use
that now we have it.
2024-10-09 21:27:58 -06:00
John Beard
b3248095e8 Pcbnew: add bezier editing tool
Adds the initial implementation of bezier overlay
(assistant) and geometry manager. This is only
implemented in Pcbnew - the code is common, but
eeschema doesn't currently use it for any shape.

Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/8828
2024-09-25 21:41:32 +01:00
John Beard
ebef24b6b0 Debug: graphical snap anchor debug mode
When working near snap anchors, which come and go
rapidly, it's often useful to see what snaps have been
calculated. Add an advanced config to show these
(EnableSnapAnchorsDebug) on an overlay layer.

With more polish this could be a hotkey or something.
2024-09-11 22:35:35 +01:00
John Beard
b2be0d39bd Snapping: Add construction geometry snapping
This is a pretty major rework of the snapping system.
The GRID_HELPERs now have a separate CONSTRUCTION_MANAGER
which handles some of the state involving "construction
geometry".

This is fed with 'extended' geometry (e.g. "infinite" lines from
segments) for use in generating things like intersection points.
It also handles adding this geoemtry to a GAL view item
(CONSTRUCTION_GEOM) for display to the user.

The process is:

* A TOOL creates a GRID_HELPER
* Optionally, it pre-loads a "persistent" batch of construction
  geometry (e.g. for an item's original position)
* The grid helper finds useful snap 'anchors' as before, including
  those involving the construction items.
* Other items on the board can be 'activated' by snapping to one
  of their main points. Then, if it has construction geometry,
  it will be added to the display. At most 2 items of this kind of
  geometry are shown, plus the original item, to reduce avoid
  too much clutter.

The dashed snap lines state machine is also handled in the
CONSTRUCTION_MANAGER and displayed in the CONSTRUCTION_GEOM item.
2024-09-11 22:35:35 +01:00
John Beard
0818ee1770 Pcbnew/FPedit: Add snap anchor type indicators
This allows to see what the current snap point is, which is useful when
zoomed in, or the point is like the corner of a rounded pad where it's
"in free space" and might not be immediately obvious.
2024-08-28 13:49:36 +01:00
James J
be8744176c Add SCH_RULE_AREA shapes to eeschema
Includes:
 - Fix GAL to draw closed polygons in eeschema
 - Add functionality to eeschema to draw arbitary polygons
 - Update polygon item previews to have customisable edge colour
 - Add new SCH_RULE_AREA class, derived from a poly SCH_SHAPE
 - Add SCH_RULE_AREA to paint and plot methods
 - Add new rule area color preference to themes
2024-04-25 14:24:46 +00:00
Alex Shvartzkop
113208455d Add dashed lines and circles to preview draw context. 2023-10-06 15:56:20 +03:00
Jeff Young
aef0f44b8e Smarten up double-click handing in PCBNew drawing tool.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15700
2023-09-24 18:49:41 +01:00
Marek Roszko
67b031adab Painter base class should just live in gal instead of being in denial 2023-09-06 20:23:19 -04:00
Jeff Young
30336b2fe3 Unify go-back-one-step processing for drawing tools (and router).
Also warps mouse on all go-back-one-step operations for better feedback.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14981

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9985
2023-06-19 17:14:32 +01:00
Jeff Young
ef6866757e Treat undo as backspace and/or escape when drawing. Ignore redo.
Undo == backspace when drawing a polygon or chained lines.  Otherwise
it's an escape.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14961
2023-06-16 22:08:21 +01:00
Jeff Young
5875f89531 Centralize text size clamping.
Also introduces alg::clamp to improve readability of
std::max( min, std::max( value, max ) )

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14876
2023-06-03 20:29:51 +01:00
Alex
3d2b1aaf90 Improve H/V/45 deg mode when drawing zones and polygons. 2022-12-09 19:11:56 +03:00
Mark Roszko
b00178adb3 Nuke base_units from orbit 2022-09-16 04:38:10 +00:00
Jeff Young
854987f663 Remove unit-less angles from geometry manager APIs. 2022-01-20 21:10:04 +00:00
Jeff Young
8f7d2dd06a More VECTOR2D -> VECTOR2I and wxPoint cleanup. 2022-01-11 14:20:14 +00:00
Seth Hillbrand
f97c7c78c8 Connect ruler tool with axes preferences
Adds "UpdatePreferences" action that is called when the preferences are
updated, allowing running tools to act on changes that may affect them

Fixes https://gitlab.com/kicad/code/kicad/issues/9737
2021-11-23 12:52:21 -08:00
Jeff Young
a41944020d Push most of PCB_SHAPE impl down in to EDA_SHAPE. 2021-10-15 12:45:43 +01:00
Jeff Young
f221220fe2 Rename layer ids file.
It hasn't had anything to do with colors or visibility for some time
now.
2021-07-29 16:03:25 +01:00
Wayne Stambaugh
78e5e98ea0 Pass VECTOR2I objects by reference instead of on the stack. 2021-07-27 08:41:27 -04:00
Wayne Stambaugh
89b1fdabe9 Pass COLOR4D object by reference instead of on the stack. 2021-07-26 13:28:56 -04:00
luz paz
f968fc8719 Fix source comment / documentation typos 2021-06-09 19:32:58 +00:00
Jon Evans
6924b98bc3 Remove deprecated BRIGHT_BOX preview item 2021-03-20 12:09:20 -04:00
Wayne Stambaugh
6ab1144ea3 Fix broken Doxygen comment specifiers.
Please note, ///> is not a valid Doxygen comment specifier.  ///< is the
correct specifier to use for single line or short Doxygen comments.
2021-01-25 07:42:36 -05:00
Jeff Young
8c782506b9 Appy units updating more consistently to editing assistants.
Fixes https://gitlab.com/kicad/code/kicad/issues/6283
2020-11-04 14:11:25 +00:00
Jeff Young
f6c17001e4 Formatting 2020-11-04 13:46:51 +00:00
Marek Roszko
1984581c46 Remove common.h from more headers 2020-10-25 22:29:53 -04:00
Marek Roszko
e928b2d8fd Split EDA_UNITS out from common. 2020-10-25 00:02:52 -04:00
Marek Roszko
b2e9f6987d Split base_struct into eda_item and eda_rect 2020-10-13 21:24:50 -04:00
Ian McInerney
3a570c27f0 Update unit handling in the preview ruler
* Make the ruler able to switch to mils after creation
* Cleanup an unused flag in Pcbnew dimensions
* Move unit changed notification into EDA_DRAW_FRAME so more
  frames to use it.
* Allow switching units when GerbView ruler tool is active
2020-10-04 17:53:55 +01:00
Jeff Young
7a4900b8dc PCB_LINE_T -> PCB_SHAPE_T and PCB_MODULE_EDGE_T -> PCB_FP_SHAPE_T
Also updated footprint text and zone types for consistencey.
2020-10-04 16:49:04 +01:00
Jeff Young
70f329df91 Fix two-point assistant drawing layers to be in correct order.
Fixes https://gitlab.com/kicad/code/kicad/issues/5654
2020-10-03 22:55:34 +01:00
Jeff Young
0052954046 Try to make rulers draw right on Cairo as well as OpenGL.
Fixes https://gitlab.com/kicad/code/kicad/issues/5654
2020-10-02 13:50:16 +01:00
Jeff Young
612411a87b Give assistant graphics a max bounding box.
They're only on screen when they're being used, and we don't have
a GAL available to calculate their actual extents from (since their
text scales with zoom).

Fixes https://gitlab.com/kicad/code/kicad/issues/5845
2020-10-01 17:53:44 +01:00
Jeff Young
c7802e7ff8 Adjust ruler text on non-HDPI displays.
Fixes https://gitlab.com/kicad/code/kicad/issues/5654
2020-10-01 14:35:30 +01:00
Jeff Young
626bcea8ce Move ruler drawing to the stroke font.
We don't need to be fast, and this allows us to implement drop
shadows for better readability.

Fixes https://gitlab.com/kicad/code/kicad/issues/5654
2020-09-30 20:38:20 +01:00
Jon Evans
b439c169ff Fix two-point assistant shape enum 2020-09-22 18:06:57 -04: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
Jeff Young
6e800bddae Rationalize penWidth processing as first step in removing some globals. 2020-04-13 20:58:13 +01: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
7c28c3838a Comment-only changes
Makes class comments conform to coding standards
2020-01-10 16:43:01 -08:00
Mark Roszko
11ff16be4e Switch to scoped enums 2019-12-20 14:11:39 +00:00
Seth Hillbrand
ea1c8525ce Increase visibility of polygon preview
This set the polygon preview item to wider size and adjusts the draw
order to ensure it remains visible even when antialiasing
2019-10-24 16:00:01 -07:00