bug 1249162 - Fix unwanted thumb shifts when starting APZ drag r=botond
Fix thumb position determination in these places: - nsSliderFrame::StartAPZDrag() -- Constrain sliderTrack using GetXULClientRect() to match dimensions used in SetCurrentThumbPosition() and DoXULLayout(). This is what caused the scaling/offset mismatch. - nsSliderFrame::StartAPZDrag() -- Adjust nonsensical calculation of cssSliderTrack. Should be sliderFrame + scrollbarFramePosition - compositionBoundsPosition, to get coordinates relative to the same region as that of APZ event coordinates. - AsyncDragMetrics -- Make mScrollTrack and mScrollbarDragOffset float instead of int coordinates. - AsyncPanZoomController::HandleDragEvent() -- Use GetAxisLength(scrollTrack) instead of GetAxisEnd(scrollTrack) in calculation of scrollMax. - AsyncPanZoomController::HandleDragEvent() -- Only change position on MOUSE_MOVE. Additional refactors: - Rename HitTestingTreeNode::GetScrollSize() to GetScrollThumbLength(), along with related functions/variables. - Rename AsyncPanZoomController::GetAxisSize() to GetAxisLength(). - Rename cf to scrollFrame in nsSliderFrame::StartAPZDrag(). MozReview-Commit-ID: CIsU8Pj6qfa
This commit is contained in:
@@ -423,7 +423,7 @@ public:
|
||||
return mLayer->GetScrollbarTargetContainerId();
|
||||
}
|
||||
|
||||
int32_t GetScrollbarSize() const
|
||||
int32_t GetScrollThumbLength() const
|
||||
{
|
||||
if (GetScrollbarDirection() == Layer::VERTICAL) {
|
||||
return mLayer->GetVisibleRegion().GetBounds().height;
|
||||
|
||||
Reference in New Issue
Block a user