7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-14 11:19:35 +00:00
Commit Graph

144 Commits

Author SHA1 Message Date
jean-pierre charras
eaa1e6d594 Fix a collision with a Windows define and our use of the same var name.
We use IN for INCH as units, but IN is defined in a Windows header
2025-03-02 11:34:30 +01:00
Jeff Young
f951497a4f Code brevity. 2025-03-01 21:58:31 +00:00
John Beard
fb6d3c1808 Pcbnew: don't let axes hide construction geometry 2025-01-24 21:47:28 +08:00
Wayne Stambaugh
f161d94521 Common folder housekeeping part 2. 2025-01-14 15:25:05 -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
1a86982a2a Avoid enum name conflict on MacOS. 2024-11-05 08:20:37 +08:00
John Beard
dbf68a80b8 GAL: also scope layer depth push/pops
This means that an early return or an exception between
a manual Push/Pop (or an omission of the Pop) cannot
corrupt the layer stack.

It also means the GAL doesn't have to maintain its own
stack (with the in-scope GAL_SCOPED_ATTRS taking that role).

Reomve the Push/PopDepth functions, as they're only ever
used in pairs, and doing it manually needs more care.
2024-11-04 20:41:44 +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
bc9b908de5 Snaps: prevent tiny snap line inhibiting extension lines 2024-10-04 11:01:46 +01:00
John Beard
164ff0b870 Pcbnew: catch some preview item oveflows at low zooms 2024-09-27 23:06:32 +01: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
f6a693475f BOX2: Add a KiROUND specialisation for BOX2D -> BOX2I 2024-09-11 22:35:35 +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
1fb2d7fe26 Pcbnew: Snap to graphic/track intersections
Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/2329
2024-08-28 13:49:36 +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
Jeff Young
6b1d00a528 Smallest font size was a bit too small. 2023-12-18 14:24:04 +00:00
Jeff Young
e3c9cf94b7 Reduce the size of the tuning popups.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16304
2023-12-08 19:50:29 +00:00
Ian McInerney
b64631d7bc Add um support to the unit binder 2023-11-26 00:03:09 +00:00
jean-pierre charras
342a1ec78f KIGFX::PREVIEW::DimensionLabel(): fix a compil warning: add missing cases
micrometers and cm.
2023-11-17 10:35:11 +01:00
Alex Shvartzkop
113208455d Add dashed lines and circles to preview draw context. 2023-10-06 15:56:20 +03:00
Marek Roszko
22b733209d Fail GAL on its header leaking audit
Maybe we should rethink directly accessing GAL so much, but at least 600 files didn't need GAL leaked into them due to view_overlay.h
2023-09-18 19:52:27 -04: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
5e112ca78e ADDED: parameterize font metrics and allow customization of overbar height. 2023-08-06 20:57:41 +01:00
jean-pierre charras
965aaa217c RULER_ITEM: fix incorrect position of the shadow text shape (round 3).
Depending on the text orientation, the shadow shape position was incorrect.
2023-06-23 12:50:56 +02:00
jean-pierre charras
1698fb6608 Refinement of commit 355575e4 (drawing shadow texts of RULER_ITEM and pin names)
Also handle non Kicad fonts (that do not use shadow texts)
Fixes 
https://gitlab.com/kicad/code/kicad/-/issues/15019
2023-06-23 10:32:23 +02:00
jean-pierre charras
355575e477 Fix some (minor) issues when drawing shadow texts of RULER_ITEM and pin names.
Fixes 
https://gitlab.com/kicad/code/kicad/-/issues/15019
2023-06-22 13:28:43 +02: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
qu1ck
0c049eccc7 Fix a bunch of compiler warnings 2023-04-11 17:01:30 +00:00
Alex
c66dc035c7 Clear loop points when resetting polygon/zone draw. 2022-12-15 19:02:22 +03:00
Alex
be43484bc7 Make build45DegLeader static. 2022-12-10 06:21:54 +03:00
Alex
3d2b1aaf90 Improve H/V/45 deg mode when drawing zones and polygons. 2022-12-09 19:11:56 +03:00
Alex
d44a52ceee Make arc endpoint theta consistent with polar coordinate system. 2022-10-07 08:35:14 +03:00
Jeff Young
45d6b4a9fc Readability improvements. 2022-09-19 11:18:20 +01:00
Mark Roszko
b00178adb3 Nuke base_units from orbit 2022-09-16 04:38:10 +00:00
Marek Roszko
03aa63bd50 Move 5 helpers to EDA_UNIT_UTILS since they aren't iu specific 2022-08-29 20:11:03 -04:00
Seth Hillbrand
f1261e71d4 Replace boost::optional with std::optional 2022-08-25 15:50:47 -07:00
Alex
6d739ca9da Improve handling of long distances 2022-08-16 12:08:55 +00:00
Seth Hillbrand
b792a3f3f5 Add angle display to line drawing
Helpful to see what angle you are at when setting graphic lines
2022-07-15 12:03:11 -07:00
Seth Hillbrand
bed38d2fc8 Stroke, don't fill fonts in preview
Fixed new vector-style font display to avoid the non-closed polyline
fills that make it hard to read the proper text

Fixes https://gitlab.com/kicad/code/kicad/issues/11781
2022-07-15 11:58:33 -07:00
Jeff Young
f2440978ec Fix some issues with ruler drawing. 2022-02-08 15:59:48 +00:00
Jeff Young
d5a2059c21 Error messages for zone merging.
Also fixes a bug where zones meeting at a point would get merged
resulting in a self-intersecting zone.

Also fixes a bug where undo would not be handled correctly when zones
could not be merged.

Fixes https://gitlab.com/kicad/code/kicad/issues/10466
2022-01-21 19:55:57 +00:00
Jeff Young
c8a50d9b50 Remove unit-less angles from VECTOR2I/D APIs. 2022-01-20 23:58:20 +00:00
Jeff Young
4a05b36bc6 Prefer EDA_ANGLE to naked radians. 2022-01-20 21:10:04 +00:00