Goals
- Pin Reference Images
- Integrate Crop functionality.
- Sync/update the reference image with hard drive image.
Introduction & Limitation :
- Document transformation such as zoom & rotation affects the KoShape .
- Reference images are repainted when shape/selection is moved at the new position of shapes .
Implementation
Pin Reference Images -
- This feature will disable the transformation of the reference images with canvas transformation . The added transformation will be added as a choice with present implementaion .
- UI wise it will be an options to toggle the transformation per reference image . This would be stored inside each KisReferenceImage .
- Introduce the new notifyReference() for reference images layer which can invoked after applying any transformations through KisDocument.
- notifyReference() will invert the applied transformation and set the KoShape to the previous position.
Integrate Crop - Allow to crop the reference images (like this )
- Use the shape selection anchor to crop the reference image .
- Store the original image and copy image of reference and use the copy img to paint on canvas .
- Store the offsets and width/height according to the change in the KoShape size() and update the copy image from it .(QImage::copy) .
- Paint the copy image inside the shape and update the offsets and parameters.
Update the reference image from hard drive
- Reference images external file path is stored in ToolReferenceImage. and extends KisExternalLayer already.
- Reload the new image in resetCache() on the basis of the last modification
- Use FileSystemWatchWrapper to track the last modification of the image and load the updated image in ToolReferenceImage.
- Remove the previous image and paint the new image in the corresponding KoShape .