Is there a way to know if a pixel is out of the screen on round devices?

Looking for:

isVisible(dc, x, y) as Boolean

that returns true only if the pixel is visible (in the sense whether it's inside the round part of the screen or not outside, in a "corner" like {0,0} [aka not interested in notifications over my pixel])

I guess that for any full-screen app this can be calculated knowing the width and height. Bonus: the same that also works on a non full-screen datafield Slight smile 

I don't see any function similar to this in the SDK, but maybe I missed it or someone already made it and would share.

  • I use this function to check whether a point [x,y] is inside a circle or not.
    circle_x / circle_y are the origins of the circle and rad its radius. If you pass/adjust these parameters for the respective display size it should work for your needs:

    function inCircle(points, circle_x, circle_y, rad){
        var x = points[0];
        var y = points[1];
        return((x - circle_x) * (x - circle_x) + (y - circle_y) * (y - circle_y) <= rad * rad); // returns bool
    }