Skip to content

Fix PreviewDropdown viewBox only for non-rotated elements

Erwan Rouchet requested to merge half-fix-preview-dropdown into master

This fixes the most common cases for #969 (closed): elements without a rotation angle or mirroring will now be displayed properly.

image

However, for rotated elements, the viewBox will not be set correctly and the image will be cropped.

image

Fixing this will require refactoring the boundingBox helper to make it aware of the element's rotation_angle and mirroring, and adding an option to take them into account when computing image bounds:

boundingBox(this.element, { margin: Infinity, imageBounds: true, rotated: true })

Note that this makes a change to ElementImage, which is also used in the element creation modal, element edition modal and transcription edition modal. All of those will still work properly with both rotated and non-rotated elements:

image

Merge request reports

Loading