zoukankan      html  css  js  c++  java
  • iPhone中判断是否点击在某个圆形内

    1. - (BOOL) pointInside:(CGPoint)point withEvent:(UIEvent *)event   
    2. {  
    3. CGPoint pt;  
    4. float HALFSIDE = SIDELENGTH / 2.0f;  
    5. // normalize with centered origin  
    6. pt.x = (point.x - HALFSIDE) / HALFSIDE;  
    7. pt.y = (point.y - HALFSIDE) / HALFSIDE;  
    8. // x^2 + y^2 = radius  
    9. float xsquared = pt.x * pt.x;  
    10. float ysquared = pt.y * pt.y;  
    11. // If the radius < 1, the point is within the clipped circle  
    12. if ((xsquared + ysquared) < 1.0return YES;  
    13. return NO;  
    14. }  

    id 博主 = [[KILONET.CNBLOGS.COM alloc] initWithValue:@"天堂向右,我依然向左"

                  网名:@"老舟"

                  兴趣:@"影音,阅读"

                  动态:@"系统架构设计,Android通信模块开发"

                  网址:@"http://kilonet.cnblogs.com"
                  签名:@"--------------------------------------------------

                                  Stay Hungry , Stay Foolish

                                  求  知  若  渴,处  事  若  愚

                              --------------------------------------------------"

                  ];         // Never Release

  • 相关阅读:
    css-博客样式初体验
    CSS-3D动画笔记
    Postman-断言
    CSS-2D动画笔记
    CSS-服务器端字体笔记
    CSS-宽度自适应和浏览器兼容笔记
    CSS-图片整合笔记
    CSS-锚点笔记
    Html-元素类型笔记
    Scrapy爬虫大战京东商城
  • 原文地址:https://www.cnblogs.com/KiloNet/p/1807320.html
Copyright © 2011-2022 走看看