@@ -1007,23 +1007,23 @@ static int borderDash (lv_State *L) {
10071007}
10081008
10091009#pragma -mark clipsToBounds
1010- // static int clipsToBounds(lv_State *L) {
1011- // LVUserDataView * user = (LVUserDataView *)lv_touserdata(L, 1);
1012- // if( user ){
1013- // UIView* view = (__bridge UIView *)(user->view );
1014- // if( view ){
1015- // if( lv_gettop(L)>=2 ) {
1016- // BOOL yes = lvL_checkbool(L, 2);
1017- // view.clipsToBounds = yes;
1018- // return 0;
1019- // } else {
1020- // lv_pushnumber(L, view.clipsToBounds );
1021- // return 1;
1022- // }
1023- // }
1024- // }
1025- // return 0;
1026- // }
1010+ static int clipsToBounds (lv_State *L) {
1011+ LVUserDataInfo * user = (LVUserDataInfo *)lv_touserdata (L, 1 );
1012+ if ( user ){
1013+ UIView* view = (__bridge UIView *)(user->object );
1014+ if ( view ){
1015+ if ( lv_gettop (L)>=2 ) {
1016+ BOOL yes = lvL_checkbool (L, 2 );
1017+ view.clipsToBounds = yes;
1018+ return 0 ;
1019+ } else {
1020+ lv_pushnumber (L, view.clipsToBounds );
1021+ return 1 ;
1022+ }
1023+ }
1024+ }
1025+ return 0 ;
1026+ }
10271027
10281028static int adjustSize (lv_State *L) {
10291029 LVUserDataInfo * user = (LVUserDataInfo *)lv_touserdata (L, 1 );
@@ -1539,6 +1539,7 @@ static int invalidate (lv_State *L) {
15391539 {" isShow" , isShow },
15401540
15411541 {" enabled" , userInteractionEnabled },
1542+ {" clipsToBounds" , clipsToBounds },
15421543
15431544 {" backgroundColor" , backgroundColor },
15441545
0 commit comments