[FIX] web_editor: properly convert background image on retina display

The fix applied by commit [1] for retina displays was not applied in
convert_inline so the bug persisted.

[1]: https://github.com/odoo/odoo/pull/98796/commits/2ea902941221599d4707f5291642b37875bec8c1

opw-3114599

X-original-commit: 1e840ae3619b9d3909e5f8af74b8c48f8d91063c
Part-of: odoo/odoo#111778
This commit is contained in:
Antoine Guenet
2023-02-03 10:35:52 +01:00
parent a8e326e3b6
commit 70c1412bb2
@@ -634,7 +634,7 @@ async function toInline($editable, cssRules, $iframe) {
async function flattenBackgroundImages(editable) {
for (const backgroundImage of editable.querySelectorAll('*[style*=background-image]')) {
if (backgroundImage.parentElement) { // If the image was nested, we removed it already.
const canvas = await html2canvas(backgroundImage);
const canvas = await html2canvas(backgroundImage, { scale: 1 });
const image = document.createElement('img');
image.setAttribute('src', canvas.toDataURL('png'));
image.setAttribute('width', canvas.getAttribute('width'));