Skip to content

Commit

Permalink
[FlexibleHeader] use MDCEdgeInsetsEqualToEdgeInsets to compare insets…
Browse files Browse the repository at this point in the history
… when enforcing insets for scroll view.(#7807)

closes #7752.

This PR ensures that FlexibleHeader compares the insets by the Epsilon tolerance.
  • Loading branch information
wenyuzhang666 committed Jul 8, 2019
1 parent 43920ae commit bc07f0c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions components/FlexibleHeader/BUILD
Expand Up @@ -32,6 +32,7 @@ mdc_public_objc_library(
],
deps = [
"//components/private/Application",
"//components/private/Math",
"//components/private/UIMetrics",
"@material_text_accessibility_ios//:MDFTextAccessibility",
],
Expand Down
3 changes: 2 additions & 1 deletion components/FlexibleHeader/src/MDCFlexibleHeaderView.m
Expand Up @@ -16,6 +16,7 @@

#import "MDCFlexibleHeaderView+ShiftBehavior.h"
#import "MaterialApplication.h"
#import "MaterialMath.h"
#import "MaterialUIMetrics.h"
#import "private/MDCFlexibleHeaderMinMaxHeight.h"
#import "private/MDCFlexibleHeaderTopSafeArea.h"
Expand Down Expand Up @@ -643,7 +644,7 @@ - (CGFloat)fhv_enforceInsetsForScrollView:(UIScrollView *)scrollView {
insets.top += topInsetAdjustment;
info.injectedTopContentInset = desiredTopInset;
info.hasInjectedTopContentInset = YES;
if (!UIEdgeInsetsEqualToEdgeInsets(scrollView.contentInset, insets)) {
if (!MDCEdgeInsetsEqualToEdgeInsets(scrollView.contentInset, insets)) {
scrollView.contentInset = insets;
}

Expand Down

0 comments on commit bc07f0c

Please sign in to comment.