233 Commits

Author SHA1 Message Date
Seth Hillbrand
4aa2047f45 Replace alg::delete and alg::delete_if with std c++20 2025-08-04 09:03:16 -07:00
Seth Hillbrand
d538f8d848 Avoid unmapped layers
ViewGetLayers returns the item layer even if it is invalid.  We filter
this out at the base and skip items that cannot be displayed in the
view.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21368
2025-07-24 13:41:09 -07:00
Jeff Young
be1e79ccd8 Debugging. 2025-07-12 15:46:07 +01:00
Jeff Young
0375985d58 Debugging for removing items not in the view. 2025-07-03 20:45:11 -06:00
Jeff Young
e2808846ce Formatting. 2025-06-24 11:52:29 -06:00
Jeff Young
92b9997948 Nullptr safety. 2025-06-08 16:33:05 +01:00
Wayne Stambaugh
e09b095533 Common folder housekeeping part 3. 2025-01-16 11:50:08 -05: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
Alex Shvartzkop
bc6b620b8f gerbview: Sort layer maps after reordering view layers.
Otherwise we get previous freed pointers in m_orderedLayers.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19394
Fixes KICAD-P65
2024-12-30 21:29:35 +05:00
Jon Evans
c77426cc12 Fix a few issues with via and pad rendering
The refactor of VIEW::SortLayers broke it, but this
was hard to notice until my recent changes.
2024-12-28 12:42:52 -05:00
Seth Hillbrand
e9bc8cfe9d Give Clipper1 a Viking funeral
Clears out the last spot where we were only using Clipper1 (how'd I
miss that?) and remove all calls to the Clipper1 structures
2024-12-23 17:12:09 -08:00
Seth Hillbrand
ab3f597871 Fix ReorderLayerData to handle sparse maps
aReorderMap might only have a few layers needing changing, so preserve
existing map if it doesn't exist in the new map

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19185
2024-12-02 09:01:34 -08:00
Seth Hillbrand
d7137c4a05 Cleanup VIEW class
Ununsed m_dynamic class variable
2024-11-21 18:59:48 -08:00
Seth Hillbrand
76176274cf Improve function naming
Having sortLayers and SortLayers in the same class was confusing.  Also
removed the asserting calls in view updates
2024-11-21 18:04:23 -08:00
Seth Hillbrand
9c08354485 More VIEW refactoring
Move m_layers into map, add layer existence checks.  Skip layer sorting
overhead for OpenGL display b/c we use z-level for it anyway
2024-11-21 15:41:56 -08:00
Seth Hillbrand
9dfcb6a362 Cleanup ViewGetLayers()
Old style c-array replaced with vector returns
2024-11-21 13:18:36 -08:00
Seth Hillbrand
b1093f1daf Fix some signed/unsigned comparisons 2024-07-08 13:38:11 -07:00
Alex Shvartzkop
a866c46d3b Store VIEW_ITEM index to avoid std::find in removal.
-280 ms on https://gitlab.com/kicad/code/kicad/-/issues/18148
2024-07-03 20:32:37 +03:00
Alex Shvartzkop
340c84c54a Allow leaving nullptr values in VIEW::m_allItems, then defragmenting later when removing items.
Gives -1 s performance boost when reverting a commit.
2024-07-03 16:27:03 +00:00
Jeff Young
7fef6e8d83 Use view's RTree for redrawing netnames. 2024-06-14 00:20:37 +01:00
Alex Shvartzkop
865e3a9f3c Improvements when working closer to 32-bit integer limits.
- Changes BOX2 size to extended coordinates.
- Adds BOX2ISafe to construct a BOX2I that will fit in int32.
- Adds more checks.
- Safer computations.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17670
2024-04-23 16:34:07 +00:00
Jeff Young
b285545aee Don't take too long worrying about very small exposed areas.
(And in particular, don't take forever if the min / 10 results
in step being 0.)
2024-03-21 18:14:29 +00:00
Yon Uriarte
464f185387 Performance
Cache VIEW_ITEM's bbox in VIEW_TREE for faster removals.

Fixes https://gitlab.com/kicad/code/kicad/issues/16841
2024-03-02 00:03:46 +00:00
jean-pierre charras
9c05b61d7b VIEW::ReorderLayerData(): fix an issue that creates crash in Gerbview
Fixes #16558
https://gitlab.com/kicad/code/kicad/-/issues/16558
2024-01-09 15:13:57 +01:00
Jeff Young
d05675f673 Minor performance wins. 2024-01-04 16:26:32 +00:00
Ian McInerney
e6632bb983 Rename PCB IO classes/files 2023-12-24 01:22:21 +00:00
Jeff Young
87621817bf Fix typo. 2023-10-14 18:22:17 +01:00
Jeff Young
5f5113c80a Pick up current rule values when editing meanders. 2023-10-14 15:04:18 +01:00
Alex Shvartzkop
d7863b09c5 Move CORNER_STRATEGY out of SHAPE_POLY_SET. 2023-10-06 15:42:50 +03:00
Marek Roszko
7010f7963c EDA_ITEM does not belong in VIEW 2023-09-25 19:30:42 -04:00
Marek Roszko
7505fd0f37 Profile can live in core 2023-09-07 07:47:01 -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
Josue Huaroto
a8e18e2d8c
Flip Viewport when Flip board is enabled 2023-09-03 12:30:32 +00:00
Jeff Young
f5791f5dc6 Left some fixes out of previous commit. 2023-05-29 16:22:24 +01:00
Jeff Young
f72cc6dd51 Amend overly aggressive assert. 2023-04-18 17:31:22 +01:00
Jeff Young
6f59740953 Tighten up the lifecycle management of VIEW_ITEMs in
general, and the SYMBOL_VIEWER_FRAME's m_previewItem in
particular.

(Attempted fix for Sentry KICAD-G1.)
2023-04-16 14:21:23 +01:00
Marek Roszko
bfad8bb0d5 Prevent VIEW::UpdateItems and onShowTimer from firing repaints if GAL did not complete init
This appears to be a possible event race on startup

Fixes sentry KICAD-10A
2023-04-11 22:09:05 -04:00
Seth Hillbrand
0b54eb6edb Backout change unrelated to 19d0aceda37f125c13e878a315ad53e7c5560536 2023-03-24 12:28:03 -07: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
Jeff Young
99247adf15 Fix uninitialized variable. 2023-03-12 12:56:12 +00:00
Jeff Young
c9351dfd67 Drawing improvements for symbol & footprint diffs.
Moves forced-transparency setting down into VIEW_ITEM so that it can
be used to place forced-transparent objects in a different target.
This keeps EnableDepthTest() from equalizing the alpha values between
the two symbols (or two footprints).
2023-03-11 12:45:16 +00:00
Seth Hillbrand
9ad2e9f25d Standardize view checking
Uses wxCHECK* functions for mesage display and correct behavior when
encountering an invalid layer
2023-01-27 12:35:36 -08:00
jean-pierre charras
ff46b7b1e5 fix compil warnings 2023-01-27 18:25:09 +01:00
Seth Hillbrand
242b9855dd Protect VIEW against oddball items
Importing may have more view layers than we allocate.  In these cases,
we need to avoid accidentally writing to unallocated view layers

Fixes https://gitlab.com/kicad/code/kicad/issues/13638
2023-01-26 11:22:56 -08:00
Marek Roszko
d2c0f5fc2a More wxSing 2023-01-16 23:14:38 -05:00
Jeff Young
96819f6c01 Better cache invalidation for text objects with references.
Fixes https://gitlab.com/kicad/code/kicad/issues/13059
2022-12-04 11:51:44 +00:00
Alex
cda855fcd6 Fix build error. 2022-11-19 04:10:38 +05:00
Alex
d3aed6c408 Optimize hot loop in UpdateItems. 2022-11-19 04:02:05 +05:00
Alex
dc07ab9df1 Replace PROF_COUNTER with PROF_TIMER in some conditional places. 2022-09-27 14:07:47 +00:00