mirror of
https://github.com/angular/angular.git
synced 2026-11-29 18:07:51 -05:00
The original code uses clientWidth and clientHeight which returns the width and height of the element including the padding. This results in the aspect ratio being determined incorrectly and the image distortion warning triggering. The new code uses getComputedStyle which returns the width and height without padding. Another advantage of using getComputedStyle is that, unlike clientWidth and clientHeight, the number returned is a decimal which provides greater accuracy. This could allow for lowering the ASPECT_RATIO_TOLERANCE. PR Close #49889
Angular
The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.
Usage information and reference details can be found in Angular documentation.
License: MIT