[HIDPI] element.setSize sets wrong editor's dimensions if border's width is in fraction of pixels
This come out from #14630.
There as a failing test:
Error details for tests/plugins/maximize/maximize
test maximize fire resize event with proper properties
Width should be restored.
Expected: 200 (number)
Actual: 202 (number)
When I started to investigate what's the cause of this - it took me all the way to setSize method, and then marginAndPaddingSize function.
The problem there was that resize plugin was setting editor size, using box model so that border width should be included as a part of with. But it did not consider that the width might ba a fraction of a pixel, as a result in mentioned test border width was something like ~0.9px - but it used it as 0px. Having width
attribute set to 200px (because border were skipped) and including the border, the actual width of the element was 202px.
The issue was reproducible on all browsers for me.
Change History (8)
Owner: |
set to Marek Lewandowski
|
Status: |
confirmed →
review
|
Description: |
modified (diff)
|
Status: |
review →
review_failed
|
Status: |
review_failed →
review
|
Resolution: |
→ fixed
|
Status: |
review →
closed
|
Summary: |
element.setSize doesn't play well with hdpi →
[HIDPI] element.setSize sets wrong editor's dimensions if border's width is in fraction of pixels.
|
Summary: |
[HIDPI] element.setSize sets wrong editor's dimensions if border's width is in fraction of pixels. →
[HIDPI] element.setSize sets wrong editor's dimensions if border's width is in fraction of pixels
|
Pushed to branch:t/16753.
I didn't create manual test for this, as it's hard to test with "eye" - instead the best way to test it is simply a unit test. However I don't think I'm able to stub hdpi settings, so I used explicitly border with a fraction of a pixel.
To test it it's nice to play around with different pixel ratio in OS - I've used 250%, 300% and 350%.