mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-09 21:54:13 +02:00
0795281d79
PartLine and PartPolygon keep their rotation in m_rot, which nothing sets until setRotation() is called. rotation() reads it, and setRotation() computes the difference from it, so the first rotate of a freshly drawn line or polygon in the element editor starts from garbage: qRound(m_rot * 100.0) on an arbitrary value is undefined behaviour, and the angle stored afterwards is arbitrary too. PartRectangle and PartEllipse already start at 0. Give m_rot a default value of 0 in both headers, as PartEllipse has. Only the two headers change. No file-format change, and no change for a part loaded from a file or rotated once, since both set m_rot before reading it. Tests: none of their own; an uninitialised read is what a sanitizer finds, and this one is the same kind as the BorderTitleBlock and ConductorProfile fixes (#1358, #1359). ctest on macOS, and all example projects through --resave and --export-svg, unchanged. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Beat Hangartner <beat@hangartners.ch>