Commit Graph

389 Commits

Author SHA1 Message Date
Kuba Sunderland-Ober 1edb9bb0ce Get rid of VECTOR2U. 2023-06-28 20:48:07 +00:00
Marek Roszko 6e468c5ce9 Fix more warnings
Needless const and out of order initializer
2023-05-29 23:01:58 -04:00
Marek Roszko 573b66d243 Fix a bunch of C5266 warnings (pointless const on bool/int returns)
warning C5266: 'const' qualifier on return type has no effect
Microsoft doesn't even document C5266
2023-05-18 21:35:06 -04:00
Ian McInerney 18ea3be3f2 Revert "Reintroduce constexpr to COLOR4D"
This reverts commit 33da9b2327 and the
following commit dc08c48f33.

C++17 changed the behavior of static class member variables that are
constexpr defined. Previously this definition/declaration split was
valid for constexpr members, but after C++17 the static constexpr member
variables are automatically inlined, so the declaration is no longer
exported in some compilers (GCC 9/10/11 seem to have problems).

An alternate way of constexpr member variables is putting the
initialization in the class definition, but we can't init a COLOR4D
object when defining the COLOR4D class.

For now, revert this change until we can figure out the proper way of
architecting these colors.
2023-04-06 20:18:31 +01:00
Wayne Stambaugh b05de51a8d Fix a few Coverity issues. 2023-04-06 08:48:02 -04:00
Ian McInerney 33da9b2327 Reintroduce constexpr to COLOR4D
This fixes the initialization-order fiasco in the color initialization
sequence, which was originally fixed by making COLOR4D constexpr, but
was then reintroduced when the assert was changed to wxASSERT (wxASSERT
is not compatible with constexpr).
2023-04-05 14:07:01 +01:00
Wayne Stambaugh c3e6825d62 Add hashing to and unit tests for some low level objects. 2023-04-04 15:28:34 -04:00
Wayne Stambaugh 28776f5745 Text attributes object improvements.
* Add compare method to COLOR4D object.
* Add unit test to validate COLOR4D comparison method.
* Add missing color test in text attribute comparison method.
* Add unit test for text attribute object.
* Remove unnecessary headers from text attribute header.
* Move text attribute code into separate source file.
2023-03-29 12:53:45 -04:00
Jon Evans 43d3a18b86 Improve HiDPI handling of appearance/layer controls 2023-02-22 09:20:36 -05:00
Ian McInerney be19e967dc Remove WX_COMPATIBILITY flag
Some classes had been originally designed to be usable separate from wx,
but over time our uses of the classes have become entertwined with wx
features (e.g. colors), and various changes have also leaked wx into the
classes unguarded. So just remove the option to hide wx in those classes
to simplify the code.
2023-02-22 01:44:06 +00:00
Ian McInerney 0ba116a3ee Remove unused functions from COLOR4D 2023-02-22 01:44:06 +00:00
Seth Hillbrand a206f6717d Desaturate the symbols in DNP for print/plot
The desaturation should match screen display

Fixes https://gitlab.com/kicad/code/kicad/issues/13481
2023-01-11 13:44:08 -08:00
Seth Hillbrand 1cc9792cdb Fix snapping dist when disabling grid
The disable grid hotkey should allow the snap scale to be completely
determined by the snapSize and world scale.  This prevents snapRange
from overriding in the case where grid is disabled.

Additionally, we disallow grid snapping when the grid scale is not
visible.  This means that when zoomed out sufficiently to not show the
minor ticks, these minor ticks will not override a snap

Fixes https://gitlab.com/kicad/code/kicad/issues/12303
2022-12-21 17:47:45 -08:00
Alex dcb131c20d Improve canvas responsiveness by better swap interval management. 2022-11-18 00:32:25 +05:00
Alex 399aa7e418 Implement SetSwapInterval on Windows. 2022-11-18 00:32:25 +05:00
Jeff Young c0a666507c Work around more instances of the wxWidgets color string locale bug.
Fixes https://gitlab.com/kicad/code/kicad/issues/12552
2022-09-30 20:56:25 +01:00
Alex 39089ad805 Allow GAL_DRAWING_CONTEXT dtor to throw exceptions.
These destructors are implicitly noexcept, which woudnt't allow
OpenGL errors to be caught in DoRePaint.

Fixes https://gitlab.com/kicad/code/kicad/issues/12117
2022-09-30 02:47:30 +03:00
Jeff Young be5fb2c7b8 Provide a default (non-optimized) version of DrawGlyphs.
(We could possibly implement an optimized version for CALLBACK_GAL,
but not having an impl at all was breaking DRC and the DRC tests.)
2022-09-15 02:25:00 +01:00
dsa-t bd8b737c44 GAL: Do better job at reserving vertices. 2022-09-14 16:07:47 +00:00
Jeff Young 9188838e50 RIP EDA_RECT. 2022-08-31 23:57:24 +01:00
Mike Williams 3669cb4673 PCB Editor: Add User Background Images 2022-07-14 11:23:23 +00:00
Fabien Corona 976670e987 Move 3D controls to a new class 2022-06-21 23:38:22 +00:00
jean-pierre charras bf4b3a1ff8 Fix a compil warning (due to a bug in code after last change) 2022-05-14 16:32:04 +02:00
Marek Roszko 8288f24264 Move all the shaders to glsl files (and fix the processor more) 2022-05-12 23:37:44 -04:00
Marek Roszko 1f8d101b1d Fix color4d distance return type 2022-02-06 21:05:44 -05:00
Jeff Young e84c574830 Some more EDA_ANGLE cleanup. 2022-01-16 19:16:18 +00:00
Jeff Young 93229c37bb Fix compile issue on Mac.
See https://kicad.zulipchat.com/#narrow/stream/216775-core-team/topic/Compile.20error
2022-01-14 20:53:25 +00:00
Mark Roszko 3aff953c9c Quietly put the missing [] in the shared_ptr 2022-01-13 13:50:57 +00:00
Marek Roszko 15dc1b3a38 Remove no longer used boost header 2022-01-13 07:12:13 -05:00
Marek Roszko 9965748795 Use std::shared_ptr in place of boost::shared_array
It works the same here
2022-01-13 07:10:47 -05:00
Jeff Young 8f7d2dd06a More VECTOR2D -> VECTOR2I and wxPoint cleanup. 2022-01-11 14:20:14 +00:00
Jeff Young 04c76f10e9 Performance enhancements for fonts. 2022-01-08 16:47:45 +00:00
Ola Rinta-Koski 9b406c1da4 Outline font support. 2022-01-08 16:47:45 +00:00
Jeff Young 8e4a4306c7 Go back to using inter-character spacing from the stroke font.
Fixes https://gitlab.com/kicad/code/kicad/issues/1078
2022-01-04 00:46:08 +00:00
Mike Williams 404659d275 Gerbview: Fix diff mode issues with OpenGL transparency
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/10121
2022-01-02 23:15:36 +00:00
Jeff Young 89c0f8e297 Move to new font engine. 2022-01-02 14:57:03 +00:00
Jeff Young dd6cd7d184 Pull some more improvements in from rockola/kicad-strokefont.
This one is primarily about pushing TEXT_ATTRIBUTES in to the GAL
API, but it also includes adding EDA_ANGLE signatures to some trig
routines to ease integration.
2021-12-29 17:32:19 +00:00
Jeff Young 86cb57f4a7 Cherry-pick TEXT_ATTRIBUTES and EDA_ANGLE from rockola/kicad-strokefont 2021-12-28 22:15:20 +00:00
Seth Hillbrand 78ff9a857a Jerry-rig HTML-format alpha parsing
On wx3.0, the HTML format #RRGGBBAA cannot handle the alpha channel.
Instead, we route this through a COLOR4D routine when we need to use
these colors

Fixes https://gitlab.com/kicad/code/kicad/issues/9963
2021-12-13 16:04:40 -08:00
Tomasz Wlostowski 2c6e9778a1 GAL: OpenGL draw calls pooling/splitting
Improves rendering performance, esp. for large designs by:
- using a separate glDrawArrays calls() for large buffers of contiguous vertices (e.g. large zone fills)
- pooling smaller items into a small-sized index buffer held in system RAM (has to be DMAed to the GPU by the driver anyway)
2021-11-29 23:30:10 +01:00
Tomasz Wlostowski 569c39ac37 GAL: runtime profiling for CACHED_CONTAINER 2021-11-29 23:30:10 +01:00
Tomasz Wlostowski b59ee13fcc GAL: made Begin/EndDrawing calls public to have more control over timing of rendering context creation/destruction 2021-11-29 23:30:10 +01:00
Ian McInerney 961c127ebe Convert mouse coordinates to native pixesl in the 3D viewer
All operations in the camera are done using the native pixel sizes,
so we need to ensure the mouse coordinates are converted to native
pixels to make the mouse operations line up with the view.

Fixes https://gitlab.com/kicad/code/kicad/issues/2561
Fixes https://gitlab.com/kicad/code/kicad/issues/8410
2021-10-10 17:52:12 +01:00
Seth Hillbrand 9a8d1246cc We don't keep a CHANGELOG.TXT
Direct interested readers to AUTHORS.TXT instead.
2021-10-05 19:46:53 -07:00
Jeff Young 0dce303c49 Prefer wxASSERT to assert.
The former gives warning when not running under a debugger; the latter
does not.
2021-10-02 23:39:45 +01:00
Jeff Young 6197717251 Avoid poor choices for point colors.
Also adjusts the point size to account for the fact that it now has a border.
2021-09-16 14:17:52 +01:00
jean-pierre charras 56374ffa26 Try to fix a compil issue that does not happen on my computers. 2021-09-06 18:36:27 +02:00
jean-pierre charras 36048fa436 OPENGL_GAL::DrawArcSegment(): use a better number of segm to approximate the arc.
Previously, the count of segments used a magic number optimized for Pcbnew.
This is not good, and does not work well on Gerbview.
The count uses now a max error acceptable is approximation (5 microns in Gerbview and Pcbnew).
Fixes #9101
https://gitlab.com/kicad/code/kicad/issues/9101
2021-09-06 16:36:47 +02:00
Jeff Young e58671e2da Move color picker from CSS to HTML format for colors.
This is an attempt to remove the decimal separator from the equation,
which appears to be causing trouble on MSW.

Fixes https://gitlab.com/kicad/code/kicad/issues/9043
2021-08-31 18:56:38 +01:00
Mike Williams 30987cebfe Gerbview: fix cairo negative items and implement real differential mode
Layers with negative objects need to be drawn in a subsurface before
copying so they don't _CLEAR the draw items below them when a negative
object is drawn.

Differential layers are basically the same thing only they use a
different copying operation onto the layers below.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/1863
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4495
2021-08-31 12:43:53 +00:00