Skip to content

Commit

Permalink
Merge branch 'rm-constraints'
Browse files Browse the repository at this point in the history
  • Loading branch information
kirevdokimov committed Jan 1, 2020
2 parents 1148b2c + f18b557 commit c2276bf
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
5 changes: 0 additions & 5 deletions UiRoundedCorners/ImageWithIndependentRoundedCorners.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,10 @@ private void RecalculateProps(Vector2 size){

private void Refresh(){
var rect = ((RectTransform) transform).rect;
ValidateConstraints(rect);
RecalculateProps(rect.size);
material.SetVector(prop_rect2props, rect2props);
material.SetVector(prop_halfSize, rect.size * .5f);
material.SetVector(prop_radiuses, r);
}

private void ValidateConstraints(Rect rect){
// TODO Constraints
}

}
7 changes: 0 additions & 7 deletions UiRoundedCorners/ImageWithRoundedCorners.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@ private void OnValidate(){

private void Refresh(){
var rect = ((RectTransform) transform).rect;
ValidateConstraints(rect);
material.SetVector(Props, new Vector4(rect.width, rect.height, radius, 0));
}

private void ValidateConstraints(Rect rect){
if (radius > rect.width) radius = rect.width;
if (radius > rect.height) radius = rect.height;
if (radius < 0) radius = 0;
}
}

0 comments on commit c2276bf

Please sign in to comment.