AddSameSizeConstraint constraints the location of the view |
|||||
Issue descriptionAddSameSizeConstraint not only constrains the size of the view, but also constraints the position of the view.
,
Sep 28 2016
Reassigning owner - please close if done. Thanks!
,
Apr 13 2017
jif@ what view is this referring to?
,
Apr 14 2017
,
Apr 18 2017
#3> It's referring to the view on which constraints are added.
Another way to state the problem is that: either the name of the method is wrong, or the implementation is wrong.
---------------------
void AddSameSizeConstraint(UIView* view1, UIView* view2) {
[NSLayoutConstraint activateConstraints:@[
[view1.leadingAnchor constraintEqualToAnchor:view2.leadingAnchor],
[view1.trailingAnchor constraintEqualToAnchor:view2.trailingAnchor],
[view1.topAnchor constraintEqualToAnchor:view2.topAnchor],
[view1.bottomAnchor constraintEqualToAnchor:view2.bottomAnchor]
]];
}
should be changed to either:
void AddSameSizeConstraint(UIView* view1, UIView* view2) {
[NSLayoutConstraint activateConstraints:@[
[view1.widthAnchor constraintEqualToAnchor:view2.widthAnchor],
[view1.heightAnchor constraintEqualToAnchor:view2.heightAnchor]
]];
}
or (more easily because it's used in a bunch of places) renamed to:
void AddSameSizeAndPositionConstraint(UIView* view1, UIView* view2) {
---------------------
Because this method's name is misleading, people are doing:
AddSameCenterConstraints(foo, bar);
AddSameSizeConstraint(foo, bar); // <= this is already done by the current AddSameCenterConstraints
,
Apr 18 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/4682940d4a09ec69b133c495731b8b86d678dffa commit 4682940d4a09ec69b133c495731b8b86d678dffa Author: jif <jif@chromium.org> Date: Tue Apr 18 17:23:44 2017 Rename |AddSameSizeConstraint| to |AddSameConstraints|. The name of the function |AddSameSizeConstraint| was misleading. This CL also remove extraneous calls to |AddSameCenterConstraints|. BUG= 623949 Review-Url: https://codereview.chromium.org/2823263002 Cr-Commit-Position: refs/heads/master@{#465271} [modify] https://crrev.com/4682940d4a09ec69b133c495731b8b86d678dffa/ios/chrome/browser/payments/cells/autofill_profile_item.mm [modify] https://crrev.com/4682940d4a09ec69b133c495731b8b86d678dffa/ios/chrome/browser/ui/authentication/signin_promo_item.mm [modify] https://crrev.com/4682940d4a09ec69b133c495731b8b86d678dffa/ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_article_item.mm [modify] https://crrev.com/4682940d4a09ec69b133c495731b8b86d678dffa/ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_footer_item.mm [modify] https://crrev.com/4682940d4a09ec69b133c495731b8b86d678dffa/ios/chrome/browser/ui/elements/activity_overlay_coordinator.mm [modify] https://crrev.com/4682940d4a09ec69b133c495731b8b86d678dffa/ios/chrome/browser/ui/favicon/favicon_view.mm [modify] https://crrev.com/4682940d4a09ec69b133c495731b8b86d678dffa/ios/chrome/browser/ui/history/favicon_view.mm [modify] https://crrev.com/4682940d4a09ec69b133c495731b8b86d678dffa/ios/chrome/browser/ui/history/history_entry_item.mm [modify] https://crrev.com/4682940d4a09ec69b133c495731b8b86d678dffa/ios/chrome/browser/ui/reading_list/reading_list_toolbar.mm [modify] https://crrev.com/4682940d4a09ec69b133c495731b8b86d678dffa/ios/chrome/browser/ui/side_swipe/card_side_swipe_view.mm [modify] https://crrev.com/4682940d4a09ec69b133c495731b8b86d678dffa/ios/chrome/browser/ui/uikit_ui_util.h [modify] https://crrev.com/4682940d4a09ec69b133c495731b8b86d678dffa/ios/chrome/browser/ui/uikit_ui_util.mm
,
Apr 18 2017
The following revision refers to this bug: https://chrome-internal.googlesource.com/chrome/ios_internal.git/+/e87a5199596aad03763619dda16ee6426daddabd commit e87a5199596aad03763619dda16ee6426daddabd Author: mahmadi <mahmadi@google.com> Date: Tue Apr 18 20:12:38 2017
,
Apr 19 2017
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by jif@chromium.org
, Jun 28 2016