From 9fe8efb7e3d1820cd7ce8f99332f35534ecc9519 Mon Sep 17 00:00:00 2001 From: Andrew Comminos Date: Thu, 18 Jun 2015 12:57:00 -0400 Subject: [PATCH] Bug 1171696 - Don't resize scrollbar thumb when updating its position. r=mstange --- layout/xul/nsSliderFrame.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/layout/xul/nsSliderFrame.cpp b/layout/xul/nsSliderFrame.cpp index a5f51c07012..01d35470b97 100644 --- a/layout/xul/nsSliderFrame.cpp +++ b/layout/xul/nsSliderFrame.cpp @@ -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);