86 Commits

Author SHA1 Message Date
jean-pierre charras
7bd4fa3fa6 Fix a Coverity and a compil minor warning 2025-03-26 13:19:00 +01:00
Jeff Young
877c6bce89 Printing is not zoom-specific.
(Some of these items don't currently get printed, but
there's no sense in leaving a latent bug around in case
we ever change our minds.)
2025-03-07 13:01:00 +00:00
John Beard
520a7cf62c GAL: ViewGetLOD should not be able to change the VIEW
Make the VIEW* parameter const. Since PCB_TEXT does a null-check,
it's not very clear if this can ever be null (and if it is,
why don't the other VIEW_ITEMs check?), so don't make them
all references too at this time.

Also dereference a few pointers a bit earlier to make non-null
promises sooner rather than later.
2025-01-02 22:59:31 +08:00
John Beard
527faddbfd GAL: provide constants for LoD HIDE/SHOW and a scale helper
Saves a mishmash of local HIDE/SHOW defs along with various literals.

Also provide a function that computes the scale at which a given
IU size becomes (notionally) a certain size on screen. While this
is a simple division, it's a bit opaque in terms of meaning.

Also it means the divide by zero case can be more universally
defended-against, which has traditionally been a bug opportunity.
2025-01-02 22:59:31 +08: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
215533f31a Unify flip direction handling
There was a gentle mish-mash of booleans, some with
true being left/right and some up/down, and some functions that
can flip in both axes (which is never actually done, and doesn't
really make geometric sense).

Replace all this with the FLIP_DIRECTION enum class, which makes
the intention completely unambiguous.

This also then allows a small scattering of simplifications,
because everything takes the same type and you don't have to
fiddle booleans to fit.
2024-09-27 17:13:13 +01:00
Jeff Young
16340e6cf4 Support both short and long item descriptions. 2024-06-28 22:10:22 +01:00
Seth Hillbrand
a9ae86eefd Cleanup geometry functions
Added Distance(VECTOR2) function that returns a double.  Removed
superfluous EuclideanNorm, GetLineLength, integer constructor for
EDA_ANGLE (this promotes to double in the CTOR), DistanceLinePoint and
HitTestPoints

Also extended the size for arc calculations that get distances to center
points to avoid overflow
2024-05-31 12:26:37 -07:00
jean-pierre charras
89b1b69662 Gerbview: fix missing initialization of variables in bounding box calculations. 2023-09-11 09:49:17 +02:00
jean-pierre charras
72984c5c40 Gerbview: add refinements to option to set offset and rotation of layers.
Fix incorrect calculation of bounding boxes when the rotation is not n*90 deg.
2023-09-08 10:43:59 +02:00
jean-pierre charras
efdead2008 Gerbview: added (in Layers Manager) a new setting to adjust draw offset
and rotation of the active layer. This is a draw option only.
2023-09-06 20:08:45 +02:00
Seth Hillbrand
19d0aceda3 Remove superfluous m_status variable
This used to be used to store information for the item similar to
m_state but it has been deprecated and no uses remained
2023-03-24 09:38:39 -07:00
jean-pierre charras
54b4f0e673 Gerbview: Aperture Macro: handle overwriting of variables
Gerbview did not handle redefinition of variable like $3 = $3 / 2
This redefinition is sometimes found in Gerber files.
This is a long standing issue now fixed.
Fixes #7222
https://gitlab.com/kicad/code/kicad/issues/7222
2023-02-11 18:22:29 +01:00
jean-pierre charras
00374f0a75 Gerbview: code refactor: change name of a member:
GERBER_DRAW_ITEM::m_Polygon -> m_ShapeAsPolygon
No actual code change.
2023-02-10 11:50:20 +01:00
jean-pierre charras
fa1591d021 Gerbview: code refactor: change name of a D_CODE member:
D_CODE::m_Shape -> m_ApertType (it is not a shape, it is a aperture type)
Fix also an outdated/incorrect comment
No actual code change.
2023-02-10 11:20:16 +01:00
jean-pierre charras
0d0c9aee3a Gerbview: code refactor: change name and type of a member:
GERBER_DRAW_ITEM::m_Shape -> m_ShapeType of type GBR_BASIC_SHAPES
Minor coding style fix.
2023-02-10 10:09:35 +01:00
jean-pierre charras
098b03e17a gerbview: Cleanup code. Remove useless or not working code. 2023-01-18 17:26:41 +01:00
jean-pierre charras
00d77f624a Gerbview: fix coding style (better names for variable members is some classes).
(no actual change in code)
2023-01-14 17:08:44 +01:00
Jon Evans
c530bdb5a1 Rename GetSelectMenuText to GetItemDescription
This descriptive text is used for many more things than
just the select menu these days.
2023-01-11 22:27:44 -05:00
Jeff Young
366cad1f01 Uniformly translate "<no net>" message. 2022-12-15 13:59:25 +00:00
Jeff Young
64a6fc0fd4 Push UNITS_PROVIDER down into a low-level mixin.
This allows us to also construct cheap UNIT_PROVIDERs for specific
tasks when necessary.
2022-09-19 17:10:59 +01:00
Marek Roszko
a8613ee80f Combine Iu2Millimeter & remove PcbMm2iu 2022-09-16 21:09:26 -04:00
Mark Roszko
b00178adb3 Nuke base_units from orbit 2022-09-16 04:38:10 +00:00
jean-pierre charras
0b233d593a Gerbview: fix missing pad shapes when exporting to Pcbnew. 2022-09-08 18:43:07 +02:00
Jeff Young
9188838e50 RIP EDA_RECT. 2022-08-31 23:57:24 +01:00
Jeff Young
f17a865593 Move EDA_ITEM hitTest to BOX2I. 2022-08-31 17:18:45 +01:00
Jeff Young
2dc6300501 Move EDA_ITEM bounding boxes to BOX2I. 2022-08-31 10:16:55 +01:00
Marek Roszko
bf964d8678 Commonize page_info by simply making the Iu scale a parameter on call. 2022-08-27 13:36:00 -04:00
Jeff Young
4f0136db3b Attempt to fix std::initializer_list lifetime issue. 2022-08-21 20:54:41 +01:00
Jeff Young
aa2ad3b44c Move KICAD_T[] to std::initializer_list<KICAD_T>. 2022-08-20 10:28:11 +01:00
Marek Roszko
a8505d9c76 SEARCH_RESULT -> INSPECT_RESULT
To fix the name squatting it's doing for future functionality
2022-07-29 20:01:10 -04:00
Jeff Young
f41af10007 Clean up hole shapes for safety (smart pointer) and consistency. 2022-07-22 23:06:07 +01:00
Jeff Young
4e3109a633 Wide string decls for gerbview. 2022-02-05 22:34:45 +00:00
Jeff Young
60bcfd1bf1 Bug fixes in arc & textbox printing.
Also removal of the no-longer-used clipping code from GR*.
2022-01-31 20:00:47 +00:00
Mike Williams
20788897ee Gerbview: display Start and End position of drawable items
Originally written by Tarun Johar.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/8426
2022-01-24 08:40:49 -05:00
Jeff Young
78385f7ab5 Clean some more tenths-of-degrees out of GerbView. 2022-01-18 02:14:09 +00:00
Jeff Young
3f98769a77 More EDA_ANGLE.
Includes bug fix for catastrophic error in Add() for converting to
radians.

Includes bug fixes for the fact that the pcbnew test can't seem to
find the ANGLE_* objects (getting all 0's instead).
2022-01-15 01:30:04 +00:00
Jeff Young
07013d00e1 More EDA_ANGLE. 2022-01-14 16:08:19 +00:00
Jeff Young
e048e51f5d Improve SNR of EDA_ANGLE stuff. 2022-01-14 16:08:18 +00:00
Jeff Young
8f7d2dd06a More VECTOR2D -> VECTOR2I and wxPoint cleanup. 2022-01-11 14:20:14 +00:00
Marek Roszko
c4c56de708 Neurotically update position wxPoint usages 2022-01-01 11:55:51 -05:00
Marek Roszko
347e03363a Convert wxPoint/wxSize starting from EDA_RECT usages 2022-01-01 11:30:33 -05:00
Jeff Young
86cb57f4a7 Cherry-pick TEXT_ATTRIBUTES and EDA_ANGLE from rockola/kicad-strokefont 2021-12-28 22:15:20 +00:00
Jeff Young
4ba3937f8a Cleanup. 2021-12-24 15:43:24 +00:00
jean-pierre charras
c504b5165d Try to fix use of a non const method in a const method (created by commit 5abe257)
(not detected by my compil).
2021-09-14 14:05:33 +02:00
jean-pierre charras
5abe2572b9 Gerbview: fix incorrect bounding box of lines drawn with a rectangular aperture.
Fixes #9152
https://gitlab.com/kicad/code/kicad/issues/9152
2021-09-14 10:44:40 +02:00
Jeff Young
6aaf4413b3 Fix kicad_string.h / string.cpp mismatch.
They don't define a KiCad string class, so the header file name was
somewhat misleading. But the fact that they didn't match definitely
made coding more difficult.
2021-07-29 16:03:25 +01:00
Wayne Stambaugh
89b1fdabe9 Pass COLOR4D object by reference instead of on the stack. 2021-07-26 13:28:56 -04:00
Wayne Stambaugh
cb72da294a More NULL expunging. 2021-07-16 16:13:41 -04:00