889 Commits

Author SHA1 Message Date
Mark Roszko
22288e02a2 Fix cairo rendering on windows under wx 3.3 2025-09-08 12:32:12 -04:00
Seth Hillbrand
6dd03bc735 Fix screen scaling
We don't use wxWidget DPI (which is the screen DPI) for our on-screen
display.  Instead, we use 91 (?!?).  Make this configurable in advanced
config and use the set value in our scaling widget
2025-08-25 18:03:46 -07:00
Addo White
843eea259d Fix for Cursor rendering on Linux+EGL+Nvidia in accelerated graphics mode
EGL/NVidia can sometimes clip the cursor based on its plane regardless of the depth mask.  This avoids the issue by forcing the cursor up over the existing plane.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/12183
2025-08-25 14:35:33 -07:00
Seth Hillbrand
3ef862f7b6 Specialize the pad wall drawing
Avoids slowdown when zoom/pan with many THTs as everything remains
cached.  Still slow in Cairo but this is expected

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20506
2025-08-24 11:25:50 -07:00
Seth Hillbrand
71a6d26054 Disable depth testing for cursor
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12183
2025-08-24 09:45:00 -07:00
Seth Hillbrand
26f0c03e61 ADDED: support for 45 degree crosshairs
Fixes https://gitlab.com/kicad/code/kicad/-/issues/6047
2025-08-23 06:20:00 -07:00
Seth Hillbrand
d02358da2f Make fullscreen cursor actually fullscreen
Very wide screens could see the edge of the cursor :)
2025-08-23 06:20:00 -07:00
Seth Hillbrand
563489d612 Make 3d-viewer mouse controls standard
We should use the common panel preferences for 3d viewer as well

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20098
2025-08-11 15:55:58 -07:00
dsa-t
7616b7aed8 Fix DPI value in Cairo printing on MSW.
Linux will need a different fix.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20477 on MSW


(cherry picked from commit 2a36da6723c4ed33a917783887e13cf24ec42cc1)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2025-07-29 17:08:13 +03:00
Seth Hillbrand
66f37beff7 Move canvas selection to common
Makes all canvases obey the same rendering parameter.  Also keeps the
canvas selection with the anti-alias selection, which makes logical
sense.  Reduce the antialias selection to a single choice rather than
two different choices for different canvases
2025-07-27 20:22:59 -07:00
Jeff Young
da57c4aa74 Formatting. 2025-07-14 13:17:53 +01:00
Jeff Young
66921b5026 Fix copy/pastas. 2025-07-12 16:39:40 +01:00
Jeff Young
c09fc59ba5 It's too late to flag these at render time.
(And we don't control what kind of nonsense fonts
have either.)
2025-07-12 16:08:45 +01:00
Jeff Young
8dc62e1db5 Don't choke on degenerate polygons.
It's a bit late to be asserting during drawing.
We'd need to know how the object was created to
do anything about it.
2025-07-02 23:10:10 -06:00
Alex Shvartzkop
50ce7d93fb Fix some warnings. 2025-06-30 06:52:16 +03:00
Jeff Young
ca1db93013 Iterator safety. 2025-06-16 11:46:18 +01:00
Alex Shvartzkop
d928e3c4fe Support wxCursorBundle on wx 3.3+
See https://gitlab.com/kicad/code/kicad/-/issues/16231
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16224
2025-06-15 10:24:49 +03:00
Seth Hillbrand
8e97a98fef Fix small segment render
Small segments, not just zero-length ones need to be drawn as circles to
avoid being dropped

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21083
2025-06-06 15:54:50 -07:00
Michal Suchanek
8110347844 Define GL_SILENCE_DEPRECATION globally on OS X 2025-05-11 15:50:10 +00:00
Michal Suchanek
ca54db2db4 windows: Fix build on case sensitive filesystem 2025-05-11 15:50:10 +00:00
Seth Hillbrand
e75076ab41 Revert "Replace glew with epoxy"
This reverts merge request !2217
2025-04-22 15:16:58 -07:00
Michal Suchánek
0c36e16292 Replace glew with epoxy
Glew has the problem that it has to be selected at build time if GLX or
EGL is supported by the library, and this in not encoded in the library
name, nor ABI, nor anything.

Then it's easy to get into the situation that a binary is built but
cannot run because glew supports an API different from the one used by
wxWidgets, or the binary fails to link in the end after all objects are
compiled.

epoxy can support both with the same library avoiding this problem.

epoxy is not initialized explicitly, replaced initialization with
version check where one was not done already.

It seems to be available as vcpkg https://vcpkg.link/ports/libepoxy

There are problems related to GL context switching on Windows which does
not seem to be used in kicad
https://github.com/anholt/libepoxy#known-issues-when-running-on-windows
There is also a problem related to multithreaded rendering on Windows
https://github.com/anholt/libepoxy/pull/265 It's harder to tell if
threading is used for rendering but it does not look like kicad is doing
anything complex enough to warrant using multiple rendering threads.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20630
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12543
2025-04-22 12:54:39 -07:00
JamesJCode
a5be581b1b Add char_traits<T> specialisations for wxUniChar and NANODBC_SQLCHAR
when building on Apple with Clang >= 17.

These specialisations are not strictly required by the C++ standard,
and have been removed from LLVM.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20631
2025-04-15 20:57:23 +01:00
Wayne Stambaugh
5c8f4697ca Common folder housekeeping part 1. 2025-01-12 12:06:45 -05:00
John Beard
3b490cdd3b Eeschema: yeet wire-with-plus icon
This icon was only used for auto-starting a wire, which was
inconsistent with auto-starting a bus or graphic line.

Also the plus sign is a little confusing as it could also be
interpreted as the origin marker (which is really bottom left),
which is also plus-shaped.
2025-01-11 00:34:48 +08:00
Seth Hillbrand
09e30adbb1 Move GL_CONTEXT_MGR into PGM_BASE singleton
This is the second try at 5326c36a5f.  The difference here is that we
have moved GL_CONTEXT_MGR into kicommon first which will hopefully
address some of the Windows linkage issues

The GL context lock needs to be shared across kifaces.  Otherwise, we
can end up blocking the lock from one kiface.  Unfortunately, I can't
find the issue in GitLab right now for where the footprint viewer shows
a blank screen after opening too many contexts.  But that's what this
fixes.
2025-01-09 09:03:08 -08:00
Seth Hillbrand
d48c40ba26 Move GL_CONTEXT_MANAGER to kicommon 2025-01-09 09:03:08 -08:00
Seth Hillbrand
452e69de85 Move thread pool into true singleton
Thread pool needs to be stored in a single location for all of KiCad
otherwise each kiface will spin up its own pool of persistent threads
2025-01-09 09:03:08 -08:00
Seth Hillbrand
074e6df3bc Revert "Move thread pool to singleton class"
This reverts commit 361f61a02380881efb59b1cebfdc3e73322b3d3c.
2025-01-03 21:22:44 -08:00
Seth Hillbrand
f38e661a02 Revert "Move GL Context into Singleton class"
This reverts commit 5326c36a5ff8a3a465d386cc31172aa90847a9e9.
2025-01-03 21:22:37 -08:00
Seth Hillbrand
5326c36a5f Move GL Context into Singleton class
The GL context lock needs to be shared across kifaces.  Otherwise, we
can end up blocking the lock from one kiface.  Unfortunately, I can't
find the issue in GitLab right now for where the footprint viewer shows
a blank screen after opening too many contexts.  But that's what this
fixes.
2025-01-03 17:26:23 -08:00
Seth Hillbrand
361f61a023 Move thread pool to singleton class
Having thread pool as its own singleton in the library meant that each
kiface had its own threadpool, leading to many multiples of the threads
being started.  Placing a singleton class in PGM_BASE ensures that all
kifaces use the same thread pool.

The singleton class can be extended to provide single instance
guarantee for any element across kifaces
2025-01-03 13:51:11 -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
jean-pierre charras
2cd28009ef Define MAX_LAYERS_FOR_VIEW to init GAL::Mxx_DEPTH and VIEW_MAX_LAYERS
These values MIN_DEPTH, MAX_DEPTH and VIEW_MAX_LAYERS are coupled, so to
avoid mismatch, it is better to derive these values from an unique value
2024-12-30 16:59:32 +01:00
John Beard
3219e87b3a GAL: update depth to avoid overflow with a higher VIEW_MAX_LAYERS 2024-12-30 20:23:16 +08:00
Jeff Young
7a4b3602b9 Reduce dependency on dynamic_cast.
(3DViewer crosses compile boundaries when run from
CvPCB.)
2024-12-05 18:17:02 +00:00
Alex Shvartzkop
55ca13e7cf Revert "Support hidpi in Cairo GAL canvas; performance improvements."
This reverts commit 8e90063258cb457f43db78334ba5bf52ad78e083.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19150
2024-12-02 22:44:20 +03:00
Seth Hillbrand
9e72d426db Remove C macro in favor of class template 2024-11-21 18:04:23 -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
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
Mike Williams
53022ab347 mouse settings: add reverse zoom option
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18583
2024-09-23 17:09:44 +00:00
Marek Roszko
89a3b7baa5 Move some things starting from reporter to kicommon 2024-09-02 21:15:14 -04:00
Mark Roszko
c19aa8170b Revert "Move some things starting from reporter to kicommon"
This reverts commit 3d893254e9477ade449654be872f85c075485c5b
2024-08-28 01:21:40 +00:00
Marek Roszko
3d893254e9 Move some things starting from reporter to kicommon 2024-08-27 20:33:08 -04:00
Jeff Young
b549c4feec Drawing sheet can't share glyph cache entries with editors.
(They use different internal units.)

Also fixes a fialure of CAIRO_GAL to reset the fill
and stroke after drawing outline glyphs.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18579
2024-08-22 12:23:21 -06:00
Alex Shvartzkop
e5a5b59ac1 Don't try to clear empty bitmap cache.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18310
2024-07-01 18:23:19 +03:00
Alex Shvartzkop
0acc4dc286 If we didn't use all reserved vertices in OpenGL GAL, show the error to user.
It will cause graphical artifacts, and it's not clear to what's happening if the message is never shown.

See https://gitlab.com/kicad/code/kicad/-/issues/18298
2024-06-28 23:15:47 +03:00
Alex Shvartzkop
73a3b880a6 Slightly optimize GPU_CACHED_MANAGER::DrawIndices. 2024-06-12 16:04:47 +03:00
Alex Shvartzkop
d40bbed591 Cairo GAL: improve alignment between arcs and segments and of odd-width lines.
(cherry picked from commit f60b76696a8bb40aa0df6e35c552e8533eec491e)
2024-06-10 21:26:17 +03:00
Alex Shvartzkop
4b96bb5d8f Support touchscreen gestures (zoom/pan/rotate) in 3D viewer.
Though rotate doesn't work yet on MSW due to a wxWidgets bug.
2024-06-08 21:13:16 +03:00