Bug 369821 all get (x,y) call which has aCoordType from atk side should consider coor type r=aaronleventhal a=mconnor

This commit is contained in:
ginn.chen@sun.com 2007-09-17 22:50:21 -07:00
Родитель 8265d52d8a
Коммит 3547488a7b
2 изменённых файлов: 18 добавлений и 4 удалений

Просмотреть файл

@ -72,9 +72,13 @@ refAccessibleAtPointCB(AtkComponent *aComponent,
if (!accWrap || nsAccessibleWrap::MustPrune(accWrap))
return nsnull;
// or ATK_XY_SCREEN what is definition this in nsIAccessible ???
// nsIAccessible getChildAtPoint (x,y) is in screen pixels.
if (aCoordType == ATK_XY_WINDOW) {
/* deal with the coord type */
nsCOMPtr<nsIDOMNode> domNode;
accWrap->GetDOMNode(getter_AddRefs(domNode));
nsIntPoint winCoords = nsAccUtils::GetScreenCoordsForWindow(domNode);
aAccX += winCoords.x;
aAccY += winCoords.y;
}
nsCOMPtr<nsIAccessible> pointAcc;

Просмотреть файл

@ -69,8 +69,18 @@ getImagePositionCB(AtkImage *aImage, gint *aAccX, gint *aAccY,
return;
PRInt32 width, height; // dummy
image->GetImageBounds(aAccX, aAccY, &width, &height);
// TODO: translate (x,y) accroding aCoordType. see bug 369821
// Returned in screen coordinates
nsresult rv = image->GetImageBounds(aAccX, aAccY, &width, &height);
if (NS_FAILED(rv))
return;
if (aCoordType == ATK_XY_WINDOW) {
nsCOMPtr<nsIDOMNode> domNode;
accWrap->GetDOMNode(getter_AddRefs(domNode));
nsIntPoint winCoords = nsAccUtils::GetScreenCoordsForWindow(domNode);
*aAccX -= winCoords.x;
*aAccY -= winCoords.y;
}
}
const gchar *