mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-09-28 04:54:13 +02:00
528d33792d
The comment on elementTerminals() said the order of Element::terminals() "also comes from the definition", which reads as file order and is wrong. Element::parseTerminal() re-sorts the list on every insertion, top to bottom then left to right on each terminal's local position, so index 0 is the topmost terminal whatever order the .elmt lists them in. bobine_ka_a_remanence.elmt writes A2 (y=20) before A1 (y=-20) and index 0 is A1. Measured by placing 400 shipped elements and reading the real order back: a top-to-bottom, left-to-right prediction matched all 400, while file order matched only the 100 where the two happen to coincide. Of the 837 shipped elements with distinct named terminals, 619 list them in a different order than QElectroTech indexes them. Comment only. Two terminals at one point tie and the sort is not stable; the comment says so. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>