Affects Version/s: 3.0.4, 3.1
Fix Version/s: None
Affected Branches:MOODLE_30_STABLE, MOODLE_31_STABLE
Pull from Repository:
Pull Master Branch:MDL-54815-master
Pull Master Diff URL:
It is currently possible to add annotations in the PDF editor outside of the page's bounds. However, when the annotated PDF is downloaded, the out of bounds annotations are not included.
With this, it might be better to limit the addition of annotations inside the the page's bounds only.
Here is what I observed:
- We don't allow annotations that are already inside of the page's bounds to be moved outside of the bounds.
- However, part of the annotation can still go out of bounds since the logic only checks if the mouse pointer's position is still in the page's bounds. It does not adjust for the annotation's width/height.
- It is also possible to create an annotation that is out of bounds by starting from the outside of the page's bounds (i.e. add a rectangle shape and drag from outside the page's bounds).
Below are the things that might need to be tackled on for this issue:
- Do not allow the user to insert annotations from outside of the page's bounds.
- Compensate for the annotation's width and height so that part of it won't go outside the page's bounds.
- For existing annotated submissions that have out of bounds annotations, adjust their position when loaded so that they fall within the page's bounds.
- It might also be nice if we could render the out of bounds region to grey to help distinguish what part of the annotated PDF will be printed out.