mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-09-28 04:54:13 +02:00
dd0c194a3c
Two fixes in the placement tool Ctrl+V starts. Paste appeared on top of the original, not under the cursor.55c2c0df9added the placement tool precisely so the copy would not land invisibly on top of what was copied, but53a0f07cathen warped the pointer to the group's grid-snapped origin -- which is the original's position -- so the copy reappeared exactly over the original until the mouse was moved. The start_pos the caller computes from the cursor was left unread: three mentions in the file, all declaration or comment. Reported on #913, where it reads as Ctrl+V pasting in place. Move the group to the cursor instead of the cursor to the group. Both put the copy under the pointer; only one of them takes the pointer away from where the user put it. start_pos is honoured, the items are translated once at construction, their conductors re-routed before anything is drawn, and the movement baseline is set there too rather than waiting for the first mouse move. That made the baseline sentinel matter, so it is now the m_baseline_captured flag the header already declared and nothing used, rather than m_initial_cursor.isNull() -- which cannot tell "not set yet" from a baseline that is legitimately scene (0,0). Separately: one Ctrl+V killed the folio's right-click menu for the rest of the session. init() sets Qt::NoContextMenu so a right click cancels the placement instead of opening a menu over it, and nothing ever set it back, taking "Coller ici", "Collage multiple", the folio properties and add/remove column/row with it. Every other DiagramEvent* class restores the policy in its destructor; this one did not. Confirmed against an unmodified master build: the menu opens before a paste and not after one. It matters here because "use the right-click menu instead" is the answer people are given when Ctrl+V does not place where they wanted. Verified on a built binary driven through a virtual X display, against examples/741.qet and convertisseur.qet: - the pointer does not move across Ctrl+V (1300,870 before and after; on master it jumps to the original at 798,455), and the copy is under it - a multi-element selection keeps its layout and its conductors re-route - Escape and right-click both cancel, leaving nothing behind and nothing on the undo stack; click and Return both commit; one undo removes the whole paste and redo restores it - with the pointer outside the viewport the copy lands at the viewport centre, visible, and follows correctly once the mouse enters - pasting into a different folio from the one copied from works - the context menu opens before a paste, after a cancelled one, and after a committed one, with "Coller ici" present ctest 9/9. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>