Bug in nightly PCB editor text rotation and 'keep upright' option?

I’ve just noticed what I consider a bug with rotated footprint text using the ‘keep upright’ option. Can someone confirm this behaviour? I hadn’t noticed this before until I started placing some footprints and rotating them.

The image below shows the original footprint in the top left.
Placing and rotating the footprint 2x 90 degrees results in the footprint in the bottom left. Notice the “B”, “C” and “REF**” text out of (expected) position. The same position change is noticed for 270 degree counter-clockwise rotation (rightmost).

I thought I could pin it down to the position of the text relative to the footprint anchor, but it doesn’t seem to be the case (“C”, “B” are below the footprint anchor, and “REF**” is above the footprint anchor, and these are affected, but “D”, “A”, and “TestKeepUpright_On” appear unaffected through all rotations.

Footprint is attached aswell for your rotational pleasure.
TestKeepUpright_On.kicad_mod (1.9 KB)

Application: KiCad PCB Editor (64-bit)

Version: (6.99.0-3254-g59e9225619), release build

wxWidgets 3.1.7
FreeType 2.11.1
HarfBuzz 4.2.0
FontConfig 2.14.0
libcurl/7.83.1-DEV Schannel zlib/1.2.12

Platform: Windows 10 (build 19044), 64-bit edition, 64 bit, Little endian, wxMSW

Build Info:
Date: Sep 7 2022 07:28:37
wxWidgets: 3.1.7 (wchar_t,wx containers)
Boost: 1.79.0
OCC: 7.6.0
Curl: 7.83.1-DEV
ngspice: 37
Compiler: Visual C++ 1929 without C++ ABI

Build settings:

Keep upright
is meant for when a component is flipped to the pcb under side.
Without it text will be upside down.

Works correctly with today’s 6.99 version master branch.
You might want to grab the most recent.

I also think there is no bug. “keep upright” retains text always readable from normal and readable from the right side of the pcb (for text on topside). To achieve this the text-string for 180°/270° rotation (which normally results in upside-down-text) is “back-rotated” and the alignment changes right<–>left. This occurs in respect to the text-anchor-point → therefore the text-position is not fixed but changes. The position-movement == the size of the text-height.
I have tried to compose an image wo compare the result of “keep upright” checked/unchecked:

case (“C”, “B” are below the footprint anchor, and “REF**” is above the footprint anchor, and these are affected, but “D”, “A”, and “TestKeepUpright_On” appear unaffected through all rotations

This is a misinterpretation caused by the fact that you only have 1 letter and the rectangle-lines disturb the view. in fact all 4 letters “A”-“D” are not in the correct rectangle.

modified footprint is also attached:
TestKeepUpright_On_1.kicad_mod (2.9 KB)

I’ll have to play a bit more with the text alignment options to achieve what I want (or rather expect), but even after your extensive explanations it feels as something is off. I’ll leave it up to you to decide whether it’s a bug or not.

Here’s how this came up, which might be the only argument I can provide.

Consider the footprint on the top left - this is the original library footprint.
The placement of the text is chosen for a reason :slight_smile: being legibility. Now, depending on how I rotate the component due to layout restrictions, I need to (remind myself to) manually fix the placement of the text. I assume if I use horizontal and vertical (it appears there is no vertical) center alignment of the refdes and value on silkscreen, then the position of the text ought not to change when rotated or flipped about the (rotationally symmetric) footprint center. Or perhaps more mathematically, if text is placed at +1 and -1 coordinates, then 180 degrees rotation should put the text at -1 and +1. It seems as if the result now becomes like -1 and +1.3.

My expectation for the top-left footprint, when rotated 180 degrees with the ‘keep upright’ option on, is simply that the 10k and R3 swap places (and the R3 on fab moves to the bottom side).

Maybe whatever happens mathematically to the text coordinates is correct, but due to (I guess) the bottom vertical alignment of the text, unexpected results occur. Maybe what I expect is the vertical bottom alignment to be flipped to top alignment?

In this simple case, I can swap the pins of the resistor in the schematic and retain my desired text placement that way, but this feels a bit of an extreme solution.

Select any component and hit the o key :sunglasses:

Select any component and hit the o key

Autoplace fields doesn’t works in the board-editor, only in the schematic-editor.