Merge pull request #123 from squidpunch/auto-clip-on-corner-radius

Default clipToBounds true if corner_radius given
This commit is contained in:
Todd Werth
2014-09-28 19:44:01 -07:00
2 changed files with 3 additions and 2 deletions

View File

@@ -371,6 +371,7 @@ module RubyMotionQuery
end
def corner_radius=(value = 2)
@view.clipsToBounds = true
@view.layer.cornerRadius = value
end

View File

@@ -56,7 +56,7 @@ class SyleSheetForUIViewStylerTests < RubyMotionQuery::Stylesheet
st.scale = 1.5
st.rotation = 45
st.tint_color = color.blue
st.layer.cornerRadius = 5
st.corner_radius = 5
st.alpha = 1.0
end
@@ -176,7 +176,7 @@ describe 'ui_view_styler' do
it 'should set attributes onto the view' do
view = @vc.rmq.append(@view_klass, :ui_view_kitchen_sink).get
view.clipsToBounds.should == false
view.clipsToBounds.should == true
view.isHidden.should == true
view.contentMode.should == UIViewContentModeBottomLeft
view.tintColor.class.should == UIColor.blueColor.class