Re: AXPosition origin?
Re: AXPosition origin?
- Subject: Re: AXPosition origin?
- From: James Dempsey <email@hidden>
- Date: Tue, 27 May 2014 08:02:52 -0700
The Cocoa accessibility API uses the AppKit coordinate system with 0,0 in the lower-left.
The framework automatically flips the coordinates before sending the value to AX clients.
James
On May 27, 2014, at 7:18 AM, Nick Kocharhook <email@hidden> wrote:
> Hi A-D!
>
> The documentation about AXPosition couldn’t be clearer:
>
> "kAXPositionAttribute
> The global screen position of the top-left corner of an element.
> Value: An AXValueRef with type kAXValueCGPointType. 0,0 is the top-left corner of the screen that displays the menu bar. The value of the horizontal axis increases to the right. The value of the vertical axis increases downward. Units are pixels."
>
> And yet! I find that when I override AXPosition and return a value with a higher Y, the view or cell in question actually moves upward, toward the menu bar. Example:
>
>
> - (id)accessibilityAttributeValue:(NSString *)attribute
> {
> if ([attribute isEqualToString:NSAccessibilityPositionAttribute])
> {
> NSPoint originalPoint = [[super accessibilityAttributeValue:NSAccessibilityPositionAttribute] pointValue];
>
> originalPoint.y += 10;
>
> return [NSValue valueWithPoint:originalPoint];
> }
>
> return [super accessibilityAttributeValue:attribute];
> }
>
> This will move the the widget 10 points (20px on Retina) closer to the menu bar.
>
> So the documentation is wrong, correct? Or am I overlooking something?
>
> Thanks,
> -Nick
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Accessibility-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden