mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
test(common): test rounding problems in image distortion detection (#49889)
Due to assertNoImageDistortion using clientWidth and clientHeight, and these properties returning integers, rounding errors occur that exceed the aspect ratio tolerance. Increasing the tolerance could hide actual distortion so correcting the calculation to use floats would be best and could even allow for a lower tolerance. PR Close #49889
This commit is contained in:
parent
857cf7ea23
commit
f9cee4db83
3 changed files with 4 additions and 0 deletions
|
|
@ -44,6 +44,7 @@ http_server(
|
|||
"e2e/b.png",
|
||||
"e2e/logo-1500w.jpg",
|
||||
"e2e/logo-500w.jpg",
|
||||
"e2e/white-607x3.png",
|
||||
"index.html",
|
||||
],
|
||||
deps = [
|
||||
|
|
|
|||
|
|
@ -58,6 +58,9 @@ import {Component} from '@angular/core';
|
|||
<img ngSrc="/e2e/a.png" width="25" height="25" style="padding: 1px 2px 5px 10px; box-sizing: content-box; height: 25px; width: auto">
|
||||
<img ngSrc="/e2e/a.png" width="25" height="25" style="padding: 1px 2px 5px 10px; box-sizing: border-box; height: 25px; width: auto">
|
||||
<br>
|
||||
<!-- autoscale with large difference between width and height resulting in rounding -->
|
||||
<img ngSrc="/e2e/white-607x3.png" width="607" height="3" style="width: auto; height: 2px">
|
||||
<br>
|
||||
`,
|
||||
})
|
||||
export class ImageDistortionPassingComponent {
|
||||
|
|
|
|||
BIN
packages/core/test/bundling/image-directive/e2e/white-607x3.png
Normal file
BIN
packages/core/test/bundling/image-directive/e2e/white-607x3.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 135 B |
Loading…
Reference in a new issue