Bug 1171696 - Don't resize scrollbar thumb when updating its position. r=mstange

This commit is contained in:
Andrew Comminos 2015-06-18 12:57:00 -04:00
parent b7bf2737b5
commit 9fe8efb7e3

View File

@ -727,15 +727,14 @@ nsSliderFrame::CurrentPositionChanged()
// avoid putting the scroll thumb at subpixel positions which cause needless invalidations
nscoord appUnitsPerPixel = PresContext()->AppUnitsPerDevPixel();
nsRect snappedThumbRect = ToAppUnits(newThumbRect.ToNearestPixels(appUnitsPerPixel), appUnitsPerPixel);
nsPoint snappedThumbLocation = ToAppUnits(
newThumbRect.TopLeft().ToNearestPixels(appUnitsPerPixel),
appUnitsPerPixel);
if (IsHorizontal()) {
newThumbRect.x = snappedThumbRect.x;
newThumbRect.width = snappedThumbRect.width;
newThumbRect.x = snappedThumbLocation.x;
} else {
newThumbRect.y = snappedThumbRect.y;
newThumbRect.height = snappedThumbRect.height;
newThumbRect.y = snappedThumbLocation.y;
}
newThumbRect = newThumbRect.Intersect(clientRect);
// set the rect
thumbFrame->SetRect(newThumbRect);