Benoit Socias 0665bce6d8 [FIX] web_editor: fix border width options on zoomed browser
When the browser is zoomed, the value of the `border-width` CSS
properties obtained through `getComputedStyle` are impacted by the
zoom. Because of this, entering a "10px" border in a Chrome zoomed at
125% turns it into "9.6px" when leaving the input field.

This commit neutralizes the zoom effect by rounding the value up.
The rounding operation was empirically determined by observing values,
see table below.

When zoomed out this does not always work: e.g. at 50% zoom, a value
of 11px becomes 10px. But zooming out is an unxpected use case, that
situation is therefore not handled by this fix.

Observed values of the border-width property:
Set value => `getComputedStyle`
```
Value  Chrome 125%  Firefox 120%
  1px        0.8px     0.83333px
  2px        1.6px     1.66667px
  3px        2.4px     2.50000px
  4px        4.0px     3.33333px
  5px        4.8px     5.00000px
  6px        5.6px     5.83333px
  7px        6.4px     6.66667px
  8px        8.0px     7.50000px
  9px        8.8px     8.33333px
 10px        9.6px    10.00000px
 11px       10.4px    10.83333px
 12px       12.0px    11.66667px
```

Steps to reproduce:
- Drop a "Text - Image" block.
- Select the text column.
- Zoom with ctrl+mouse wheel or ctrl-plus.
- Set a 10px border.
- Leave input field.

=> Border option field displayed a different size.

task-3172235

closes odoo/odoo#125107

X-original-commit: 6398b0c75b9e14b7cecb1526fe5a950101d534ad
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2023-06-15 09:05:13 +02:00
…
2023-06-10 16:50:55 +02:00
…
…
…
…
…

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%