**Goals**
- Pin Reference Images
- Integrate Crop functionality.
- Sync/update the reference image with hard drive image.
**Implementation**
Pin Reference Images -
- This feature would 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 would be present with options to toggle the transformation for Zoom , Rotation and Pan Tool per reference image and global toggle as well. This would be stored inside KisReferenceImage.
- Currently KisReferenceImages::drawDecoration() recalculates and repaints the new transformation in shape if viewSize or transform changes .
- These options would need different transformation of reference images inside KisReferenceImages::drawDecoration() to & KisReferenceImages::updateBuffer() based on the modifications (translation , scaling & rotation) .
- Apply the transformation for the outline rectangle of reference images .
Integrate Crop
- This would allow to crop the reference images (non destructively) similar to crop tool .
- It needs some initial discussion on activation of the Crop on reference image inside Tool options docker.
- Implement paintOutlineWithHandles() to paint the crop rectangle on reference image .
- Reimplement beginPrimaryAction() &continuePrimaryAction() in ToolReferenceImages for user actions .
- Implement KisReferenceImageResizeCommand extending KUndo2Command (similar to KisImageResizeCommand) for implementing non destructive crop .
Update the reference image from hard drive
- Store references to the File path and in KisReferenceImage .
- Set KisSafeDocumentLoader with correct path in KisReferenceImage and connect it with the existing loading code.
- KisReferenceImagesLayer needs to extend from KisExternalLayer and implement resetCache()
- Reload the new image in resetCache() with KisSafeDocumentLoader.reloadImage() .
- Implement loading of reference images in KisSafeDocumentLoader::delayedLoadStart() .