Featured post
cocoa - NSWindow Content Border messing with CALayer's geometry -
i have nswindow 32px bottom content border. inside window's view, have 2 custom subviews. each of them layer backed, , i'm tracking mouse nstrackingarea. part of i'm doing mouseover effects coreanimation. not problem in general, noticed kind of strange , wondered if knows why happening.
when setting trackingarea , mouseover method, hittest root layer , log layer's name can see if geometry of various sublayers hold water when resize window. internally, seem (and look) fine. visually, in right place, when move mouse, notice though mouse physically on layer, hittest returning whatever layer 32 px above it. however, if remove content border, works expect , correct layer returned.
i need content border, have simple workaround involves offsetting hittest point 32px. works fine, seems weird presence of content border seems skewing co-ordinate system of these subviews. know why happening?
nsevent
returns mouse locations relative window's coordinate system, not targeted view's. need call convertrect:fromview:
correct coordinates.
- Get link
- X
- Other Apps
Comments
Post a Comment