Use GAL_DRAWING_CONTEXT as this unlocks the context in its destructor,
so that when an exception is thrown inside the `try` block, it should
automatically unlock before we switch backend.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10840
(cherry picked from commit 1b6fe615e5)
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
(cherry picked from commit d5a2059c21)
gcc doesn't need it and computes during compile regardless, but experimenting in godbolt, both clang and MSVC actually do need it or else it's partially computed at runtime
(cherry picked from commit ca7840334c)
WxString does not allocate space for wide strings needed during
conversion unless the string is explicitly wide. This can cause buffer
over/underflow
Fixes https://gitlab.com/kicad/code/kicad/issues/10605
Ctrl-A moves cursor to beginning of current line in text box.
Ctrl-E moves cursor to the end of the line.
This change makes navigation in Scintilla text boxes consistent
with other text boxes in KiCad.
Fixes https://gitlab.com/kicad/code/kicad/issues/9996
(cherry picked from commit 23fdbe4b21)
We were checking for duplicate tracks by looking to see if the two
tracks had two shared points. A null track always matched this case,
which removed the valid track. We solve this by avoiding null tracks in
the duplicate checker. They are removed separately in the null track
stage.
This also fixes a GTK-specific tree issue where we require the
BeforeReset()/AfterReset() calls instead of Cleared() to prevent GTK
from dereferencing a parent after freeing
Fixes https://gitlab.com/kicad/code/kicad/issues/10624
The zoom selection should only change when requested by the user, not in
response to UI updates. This can cause unexpected zoom shifts when the
calculated zoom is within a range of one of the presets. It also adds
unneeded calls during the UI update cycle
Fixes https://gitlab.com/kicad/code/kicad/issues/10498
DrawEllipse seems to work fine using transparent bg for all DCs except
printing (which is the only one we use now) Use two arcs to draw a
transparent fill for the circle instead as a workaround until we
implement Cairo printing
Fixes https://gitlab.com/kicad/code/kicad/issues/10431
Rather than skipping our endEdit() call in libedit, we need to
parameterize whether we want the shape open/closed. Closed will remove
the last segment if it lands on the first point. We don't want that
but we do want to remove the last point if it duplicates the second to
last (in the case of double-clicking)
Fixes https://gitlab.com/kicad/code/kicad/issues/10334
A long-standing issue with multiple workarounds
(https://gitlab.com/kicad/code/kicad/-/issues/1877) prevented eeschema
printouts with multiple images or images in both the worksheet and the
schematic.
We worked around this by ordering the bitmap printing to be the first
step in the printing process. This partially worked but didn't get
everything correct. The primary difficulty in debugging this was that
the wxPrintPreview that we generate looked correct. Only the actual
printout was incorrect.
The fix is to explicitly clip bitmap drawing to the bitmap area,
regardless of how large the bitmap is.
Starting in be8327bd54, we assume that all
exceptions in DoRePaint() are caused by OpenGL. But many calls in
UpdateItems() will throw if there are internal errors such as
std::out_of_range. Here, we catch those errors and simply skip ahead
rather than falling back to Cairo
This is particularly important when reading legacy projects as 0 is
what signals the painter to use the old algorithm (1/2 pin name/number
size).
Fixes https://gitlab.com/kicad/code/kicad/issues/10100
(cherry picked from commit f089cf44a7)
Our baseline script to generate the font seems to shift the tilde down
by half a cell. Unclear why but we shouldn't be changing the position
between versions.
Reference https://gitlab.com/kicad/code/kicad/-/issues/4396