[go: nahoru, domu]

Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
[iOS] Don't rescale corner-radius because some animation may animate …
Browse files Browse the repository at this point in the history
…width/height from zero to some value, but scaling generates zero factor if width/height is zero. (#2112)
  • Loading branch information
wqyfavor authored and doumafang committed Feb 12, 2019
1 parent a3111ee commit c30032d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ios/sdk/WeexSDK/Sources/Display/WXRoundedRect.mm
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,17 @@ - (instancetype)initWithRect:(CGRect)rect
if (self = [super init]) {
_rect = rect;
_radii = [[WXRadii alloc] initWithTopLeft:topLeft topRight:topRight bottomLeft:bottomLeft bottomRight:bottomRight];
[_radii scale:[self radiiConstraintScaleFactor]];
//[_radii scale:[self radiiConstraintScaleFactor]];
}

return self;
}

/*
We don't do this scaling because of this demo: http://dotwe.org/vue/594d43b10d8fb9847d8122bbd429f48b
The width of the animating object is zero and radiiConstraintScaleFactor generated 0 factor
which causes that no corner-radius is showing.
- (float)radiiConstraintScaleFactor
{
// Constrain corner radii using CSS3 rules:
Expand Down Expand Up @@ -116,5 +121,6 @@ - (float)radiiConstraintScaleFactor
WXAssert(factor <= 1, @"Wrong factor for radii constraint scale:%f", factor);
return factor;
}
*/

@end

0 comments on commit c30032d

Please sign in to comment.