Bug 839957 - Followup for review comment.

This commit is contained in:
Cameron McCormack 2013-04-10 23:04:28 +10:00
parent e87c79516e
commit ab44f481ad

View File

@ -4599,20 +4599,22 @@ nsSVGTextFrame2::DoGlyphPositioning()
if (!deltas.IsEmpty()) { if (!deltas.IsEmpty()) {
mPositions[0].mPosition += deltas[0]; mPositions[0].mPosition += deltas[0];
} }
double factor = cssPxPerDevPx / mFontSizeScaleFactor;
for (uint32_t i = 1; i < mPositions.Length(); i++) { for (uint32_t i = 1; i < mPositions.Length(); i++) {
// Fill in unspecified x position. // Fill in unspecified x position.
if (!mPositions[i].IsXSpecified()) { if (!mPositions[i].IsXSpecified()) {
nscoord d = charPositions[i].x - charPositions[i - 1].x; nscoord d = charPositions[i].x - charPositions[i - 1].x;
mPositions[i].mPosition.x = mPositions[i].mPosition.x =
mPositions[i - 1].mPosition.x + mPositions[i - 1].mPosition.x +
presContext->AppUnitsToGfxUnits(d) * cssPxPerDevPx / mFontSizeScaleFactor; presContext->AppUnitsToGfxUnits(d) * factor;
} }
// Fill in unspecified y position. // Fill in unspecified y position.
if (!mPositions[i].IsYSpecified()) { if (!mPositions[i].IsYSpecified()) {
nscoord d = charPositions[i].y - charPositions[i - 1].y; nscoord d = charPositions[i].y - charPositions[i - 1].y;
mPositions[i].mPosition.y = mPositions[i].mPosition.y =
mPositions[i - 1].mPosition.y + mPositions[i - 1].mPosition.y +
presContext->AppUnitsToGfxUnits(d) * cssPxPerDevPx / mFontSizeScaleFactor; presContext->AppUnitsToGfxUnits(d) * factor;
} }
// Add in dx/dy. // Add in dx/dy.
if (i < deltas.Length()) { if (i < deltas.Length()) {