Symbol Editor: All of the real numbers in the symbol library truncated to integers on save
Hi,
While updating some of the symbols in my project I've seen that some of my existing and unchanged symbols became looking disintegrated. Please see the attached screenshot.
I believe I found a serious bug.
The problem occurred after I converted my library to the new format, started working with nightlies.
As far as I know I have no direct impact on this case because I don't remember touching some of the effected symbols after the conversion. Hence I don't know how that happened or when.
After a quick inspection with a text editor revealed the underlying problem. Symbol editor got lost decimal information from all of the coordinates and truncated values to integers completely. Asyou can guess, this has created a massive mess in my symbol library. Since the information has been lost permanently there is no quick cure. Thinking to copy the existing library somewhere else, revert the library back to 5.1 branch state (fortunately I'm tracking it in git) and then copy the newly generated symbols from broken one to the newly converted one.
But one thing is confusing. Some of the effected symbols were drawn with nightly version, not converted. That means this should've been happened after the library conversion. (I wish I'd taken a git snapshot right after conversion).
Let's investigate one of the effected symbols.
(symbol "ventura:TPS22919DCKR" (in_bom yes) (on_board yes)
(property "Reference" "U" (id 0) (at -6 6 0)
(effects (font (size 1 1)))
)
(property "Value" "TPS22919DCKR" (id 1) (at 2 6 0)
(effects (font (size 1 1)))
)
(property "Footprint" "ventura:SOT-23-6" (id 2) (at 1 -20 0)
(effects (font (size 1 1)) hide)
)
(property "Datasheet" "https://www.digikey.com/en/products/detail/texas-instruments/TPS22919DCKR/10434801" (id 3) (at 1 -17 0)
(effects (font (size 1 1)) hide)
)
(property "StockCode" "ICT-000064" (id 4) (at 1 -25 0)
(effects (font (size 1 1)) hide)
)
(property "Description" "IC PWR SWITCH P-CH 1.5A HIGH SIDE 1:1 ACTIVE HIGH SOT23-6 [TI:TPS22919DCKR]" (id 5) (at 0 -22 0)
(effects (font (size 1 1)) hide)
)
(property "Variants" "Std" (id 6) (at 1 -27 0)
(effects (font (size 1 1)) hide)
)
(property "ki_keywords" "high-side power distribution switch" (id 7) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "ki_description" "1.6V to 5.5V, 1.5A, Ultra-Low Leakage Load Switch, SOT23-6" (id 8) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "ki_fp_filters" "SOT?23*" (id 9) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(symbol "TPS22919DCKR_0_1"
(rectangle (start -7 5) (end 7 -5)
(stroke (width 0.1)) (fill (type background))
)
(rectangle (start -7.62 5.08) (end 7.62 -5.08)
(stroke (width 0.1)) (fill (type none))
)
)
(symbol "TPS22919DCKR_1_1"
(pin power_in line (at -10 2 0) (length 2)
(name "VIN" (effects (font (size 1 1))))
(number "1" (effects (font (size 1 1))))
)
(pin power_in line (at 0 -7 90) (length 2)
(name "GND" (effects (font (size 1 1))))
(number "2" (effects (font (size 1 1))))
)
(pin input line (at -10 -2 0) (length 2)
(name "ON" (effects (font (size 1 1))))
(number "3" (effects (font (size 1 1))))
)
(pin unconnected non_logic (at -10 0 0) (length 2)
(name "NC" (effects (font (size 1 1))))
(number "4" (effects (font (size 1 1))))
)
(pin open_collector line (at 10 0 180) (length 2)
(name "QOD" (effects (font (size 1 1))))
(number "5" (effects (font (size 1 1))))
)
(pin power_out line (at 10 2 180) (length 2)
(name "VOUT" (effects (font (size 1 1))))
(number "6" (effects (font (size 1 1))))
)
)
)
As you can see none of the coordinates have decimal part. They are complete integers, except one part:
(rectangle (start -7.62 5.08) (end 7.62 -5.08)
(stroke (width 0.1)) (fill (type none))
)
This is a simple rectangle I added right before reporting this bug to see the behavior of the actual code. This is the expected outcome as my grid is set for 1.27mm distance.
The version information belongs to current nightly but I've seen this issue at least for 2-3 days.
Cheers,
Application: Symbol Editor
Version: 5.99.0-unknown-f19440f72~106~ubuntu20.04.1, release build
Libraries:
wxWidgets 3.0.4
libcurl/7.68.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3
Platform: Linux 5.4.0-52-generic x86_64, 64 bit, Little endian, wxGTK, ubuntu, x11
Build Info:
Date: Nov 18 2020 10:17:59
wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
Boost: 1.71.0
OCC: 7.3.0
Curl: 7.68.0
ngspice: 31
Compiler: GCC 9.3.0 with C++ ABI 1013
Build settings:
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_PYTHON3=ON
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
KICAD_SCRIPTING_ACTION_MENU=ON
KICAD_USE_OCC=ON
KICAD_SPICE=ON