From 70c1412bb2eae6d5a59d2ef8c94b544abc88e3e4 Mon Sep 17 00:00:00 2001 From: Antoine Guenet Date: Mon, 23 Jan 2023 11:33:26 +0000 Subject: [PATCH] [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 --- addons/web_editor/static/src/js/backend/convert_inline.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_editor/static/src/js/backend/convert_inline.js b/addons/web_editor/static/src/js/backend/convert_inline.js index 44a8c189221..bb7955fec2b 100644 --- a/addons/web_editor/static/src/js/backend/convert_inline.js +++ b/addons/web_editor/static/src/js/backend/convert_inline.js @@ -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'));