mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 01:48:05 +00:00
Bug 317213 magnification loses focus of text element and moves to the
top of the application patch by evan.yan@sun.com r=aaronleventhal sr=roc
This commit is contained in:
parent
87fe312b51
commit
cc652fabee
@ -729,23 +729,25 @@ NS_IMETHODIMP nsAccessibleText::GetCharacterExtents(PRInt32 aOffset,
|
||||
rc->GetFontMetrics(fm);
|
||||
NS_ENSURE_TRUE(fm, NS_ERROR_FAILURE);
|
||||
|
||||
PRUnichar ch;
|
||||
if (NS_FAILED(GetCharacterAtOffset(aOffset, &ch))) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
float t2p = context->TwipsToPixels();
|
||||
|
||||
//Getting width
|
||||
nscoord tmpWidth;
|
||||
if (NS_SUCCEEDED(rc->GetWidth(ch, tmpWidth))) {
|
||||
*aWidth = NSTwipsToIntPixels(tmpWidth, t2p);
|
||||
}
|
||||
PRUnichar ch;
|
||||
if (NS_SUCCEEDED(GetCharacterAtOffset(aOffset, &ch))) {
|
||||
//Getting width
|
||||
nscoord tmpWidth;
|
||||
if (NS_SUCCEEDED(rc->GetWidth(ch, tmpWidth))) {
|
||||
*aWidth = NSTwipsToIntPixels(tmpWidth, t2p);
|
||||
}
|
||||
|
||||
//Getting height
|
||||
nscoord tmpHeight;
|
||||
if (NS_SUCCEEDED(fm->GetHeight(tmpHeight))) {
|
||||
*aHeight = NSTwipsToIntPixels(tmpHeight, t2p);
|
||||
//Getting height
|
||||
nscoord tmpHeight;
|
||||
if (NS_SUCCEEDED(fm->GetHeight(tmpHeight))) {
|
||||
*aHeight = NSTwipsToIntPixels(tmpHeight, t2p);
|
||||
}
|
||||
}
|
||||
else {
|
||||
//GetCharacterAtOffset() will fail when there is no text
|
||||
*aWidth = *aHeight = 0;
|
||||
}
|
||||
|
||||
//add the width of the string before current char
|
||||
|
Loading…
Reference in New Issue
Block a user