зеркало из https://github.com/mozilla/pjs.git
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:
Родитель
8265d52d8a
Коммит
3547488a7b
|
@ -72,9 +72,13 @@ refAccessibleAtPointCB(AtkComponent *aComponent,
|
||||||
if (!accWrap || nsAccessibleWrap::MustPrune(accWrap))
|
if (!accWrap || nsAccessibleWrap::MustPrune(accWrap))
|
||||||
return nsnull;
|
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) {
|
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;
|
nsCOMPtr<nsIAccessible> pointAcc;
|
||||||
|
|
|
@ -69,8 +69,18 @@ getImagePositionCB(AtkImage *aImage, gint *aAccX, gint *aAccY,
|
||||||
return;
|
return;
|
||||||
|
|
||||||
PRInt32 width, height; // dummy
|
PRInt32 width, height; // dummy
|
||||||
image->GetImageBounds(aAccX, aAccY, &width, &height);
|
// Returned in screen coordinates
|
||||||
// TODO: translate (x,y) accroding aCoordType. see bug 369821
|
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 *
|
const gchar *
|
||||||
|
|
Загрузка…
Ссылка в новой задаче