mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-09-27 20:44:13 +02:00
fc41cf9f5d
images() addImage() setImageScale() setImageRotation() deleteImage() addImage reads a file the way the "add image" tool does after its file dialog and pushes the same AddGraphicsObjectCommand. The pixels are copied into the project, which DiagramImageItem::toXml writes inline, so the saved file does not refer to the original path: verified by moving the source file away and reloading, where the image and its scale came back. The price is that the project grows by about the size of the image, so files over 10 MB are refused; so are unreadable files, non-images and missing paths, each with its own reason. Scaling sets both axes as one undo step. Images are addressed by index in a position-sorted listing like texts and shapes, by the on-screen bounding box -- so because an image turns and scales about its centre, scaling or rotating one can change where it sorts, and the header says to re-list after either. Observed: a 2x scale moved a listed top-left from (100,100) to (68,84), which is that, not a displacement. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>