mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-09-27 20:44:13 +02:00
cd27912605
elementGeometry(folio, uuid) x, y, rotation, left, top, right, bottom insertFolio(position) The API could set an element's position but never read it, so a script could not lay one thing out relative to another, or check that a move had landed; verification had to go through the saved file. elementGeometry returns the origin (what setElementPosition sets), the rotation, and the box the element occupies on the folio -- its drawn extent, which sits at the element's hotspot from the origin and, once rotated, is the rotated extent. Measured on a coil whose hotspot is (17, 32): placed at (200, 300) the box is 183..223 by 268..328, exactly that far from the origin; a move of (+50, -20) shifts both together; a 90 degree turn swaps the box to 60 by 40 about an unchanged origin and 180 turns it back; and the origin agrees with the saved file (x=250 y=280, orientation 2 for 180 degrees). insertFolio puts a folio at a position (0 first, folioCount() last) through QETProject::addNewDiagram(pos), undoable. The position is checked in the binding: QETProject::addDiagram() hands it straight to QList::insert(), which is undefined past the end, so -1 and anything above the count are refused with a reason. Verified: first, middle and last insertions land in the right order, and undo and redo of an insertion restore the order. Folio reordering itself still needs the application's project view. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>