mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
fix(common): Don't warn about image distortion is fill mode is enabled (#47824)
The image distortion warning (when rendered aspect ratio is noticeably different than intrinsic) doesn't make sense with fill mode, where the user may want the image to stretch, crop or letterbox. PR Close #47824
This commit is contained in:
@@ -367,9 +367,11 @@ export class NgOptimizedImage implements OnInit, OnChanges, OnDestroy {
|
||||
assertEmptyWidthAndHeight(this);
|
||||
} else {
|
||||
assertNonEmptyWidthAndHeight(this);
|
||||
// Only check for distorted images when not in fill mode, where
|
||||
// images may be intentionally stretched, cropped or letterboxed.
|
||||
assertNoImageDistortion(this, this.imgElement, this.renderer);
|
||||
}
|
||||
assertValidLoadingInput(this);
|
||||
assertNoImageDistortion(this, this.imgElement, this.renderer);
|
||||
if (!this.ngSrcset) {
|
||||
assertNoComplexSizes(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user