Bug 513502 - Don't allow fractional sizes for the length of the scrollbar thumb. r=roc

--HG--
extra : rebase_source : 5f297336e5acd0ffedea5944745db92f28770840
This commit is contained in:
Markus Stange 2009-09-04 09:34:31 +12:00
Родитель 58e696ea10
Коммит 4c8ab6a1c7
1 изменённых файлов: 5 добавлений и 0 удалений

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

@ -416,6 +416,11 @@ nsSliderFrame::DoLayout(nsBoxLayoutState& aState)
thumbLength = PR_MAX(thumbLength, NSToCoordRound(availableLength * ratio));
}
// Round the thumb's length to device pixels.
nsPresContext* presContext = PresContext();
thumbLength = presContext->DevPixelsToAppUnits(
presContext->AppUnitsToDevPixels(thumbLength));
// mRatio translates the thumb position in app units to the value.
mRatio = (minPos != maxPos) ? float(availableLength - thumbLength) / float(maxPos - minPos) : 1;