BROptionsButton icon indicating copy to clipboard operation
BROptionsButton copied to clipboard

self.openedStateImage center y is incorrect in setupSubviews method.

Open peng90 opened this issue 11 years ago • 2 comments

It should be openedImageView.center.y + (closedImageView.frame.size.height * 2)) instead of openedImageView.center.y + (closedImageView.frame.size.height)). The center y is referenced from - (void)setCurrentState:(BROptionsButtonState)state animated:(BOOL)animated method.

peng90 avatar Jul 21 '15 18:07 peng90

@peng90, thanks for your collaboration. Can you please explain why it should be multiplied by 2 ?

BasheerSience avatar Oct 06 '15 08:10 BasheerSience

I think it's mostly a consistency issue. Because the center y for openedStateImage you have in - (void)setCurrentState:(BROptionsButtonState)state animated:(BOOL)animated method has (self.openedStateImage.frame.size.height * 2) as the delta distance, if the center y in setupSubviews does not have it, the openedStateImage's center y will be off (inconsistent) after - (void)setCurrentState:(BROptionsButtonState)state animated:(BOOL)animated is called.

peng90 avatar Oct 06 '15 13:10 peng90