Break the non-PCB-specfic parts of PCB_REFERENCE_IMAGE out
to a common REFERENCE_IMAGE class, which is then composed into
the PCB_REFERENCE_IMAGE. This will make it easier to bring the
transform origin logic to eeschema without repetition.
IsCopperLayer( int aLayer ) can be ::IsCopperLayer( int aLayer ) or
PNS_KICAD_IFACE_BASE::IsCopperLayer( int aLayer ) in pns_kicad_iface.cpp
This is error prone.
So, to avoid mistakes, PNS_KICAD_IFACE_BASE uses now 2 functions:
- IsPNSCopperLayer( int aPNSLayer )
- IsKicadCopperLayer( PCB_LAYER_ID aPcbnewLayer )
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18800
PCB_SHAPE::Normalize() normalized a graphic segment by (sometimes) swapping
start and end points. But it creates an issue when flipping a segment: the
reference point can be changed.
This normalization was made for DRC purpose when comparing 2 footprints.
Now, PCB_SHAPE::Normalize() does not change end points of a segment, and a
specific PCB_SHAPE::NormalizeForCompare() normalize fct is used for DRC compare.
This has always been possible (especially through the properties
panel with large scales), but it's even easier if the transform
origin is near a manipulated corner.
Check and reject scales that result in an overflowed image box.
Previously, it was flipped using the shape anchor position. But for this
shape, the anchor (top left corner)) is reinitialized after flipping, so
flipping twice moves the shape.
Now the rectangle center is used as reference position to flip the shape
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18797
Need to be very careful when translating between PNS layers and board
layers. PNS layers are linear while board layers are not, so reaching
into the view will return a board layer (maybe we should proxy this
through the iface?)
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18708
This is stored as an offset from the image position,
which is the centre of the image. When interactively edited, the
transform origin stays in place. This makes it easier to scale an image
around some fixed feature in the image.
For now this is not saved out to the format, so it
reinitialises to (0, 0) each time. This means scale around
the midpoint, which is the current behaviour.
There was a gentle mish-mash of booleans, some with
true being left/right and some up/down, and some functions that
can flip in both axes (which is never actually done, and doesn't
really make geometric sense).
Replace all this with the FLIP_DIRECTION enum class, which makes
the intention completely unambiguous.
This also then allows a small scattering of simplifications,
because everything takes the same type and you don't have to
fiddle booleans to fit.
Beziers can extend outside the control point hull,
and can also be far inside the hull. Especially the latter
interferes with selection.
So use the approximated segments to determine.
Commit 83de056de9 broke loading legacy schematics that are not shared.
Legacy schematics do not contain instance data "AR Path=" entries when
the schematic file was not shared. The reference and unit information
was only stored in the symbol reference field and unit entries in the
symbol definition.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18779
This is a little more primitive than the pcbnew tool,
in the same way that the arc tool is also more primitive
(no interactive manager).
It works just about well enough to get the curves drawn,
but all these tools could do with some interactivity
in esschema and symbol editor.
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/8828
Adds the initial implementation of bezier overlay
(assistant) and geometry manager. This is only
implemented in Pcbnew - the code is common, but
eeschema doesn't currently use it for any shape.
Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/8828
Use grey for the main item, remove the endpoint circles.
Keep the blue highlight for the control handle line
(which is technically not where it goes on a single
bezier, but it is simpler that way).
Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/8828
Some shapes, like arcs and beziers have "lines" that
can be useful to see when editing, but aren't directly
editable and may not overlap the object's own lines.
So make it possible to, indepedently:
- Turn off the centre-point drag handle affordance
- Show the actual line segment on screen.
For some obscure reason on MINGW, using UCRT compiler version,
m_schema_validator.set_root_schema() hangs in French language.
So, on MINGW+UCRT (specific) switch to a LOCALE_IO before calling set_root_schema().
- better fix for PCB_VIA::SetLayerSet() than commit 0c959075.
- Ensure saved via from a board and pasted to another board have a layer pair
compatible with this board copper layer count (if not, skip it)
- workaround in PCB_VIA::GetLayerSet() that hang when a LAYER_RANGE has start
and end layers id not compatible with the copper layer count (bug in LAYER_RANGE?)