Count() returns unsigned values. Since, we subtract 1 from this value,
if the count is 0, we will underflow the unsigned value, creating an
extremely large value that we multiply by the interline spacing.
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.