const Vector<GraphicsLayer*>& childLayers = contentsLayer->children();
for (size_t i = 0; i < childLayers.size(); ++i)
if (childLayers[i]->isScrollbar())
- toTextureMapperLayer(childLayers[i])->setScrollPositionDeltaIfNeeded(FloatSize(contentsLayer->boundsOrigin().x(), contentsLayer->boundsOrigin().y()));
+ toTextureMapperLayer(childLayers[i])->setScrollPositionDeltaIfNeeded(FloatSize(-contentsLayer->boundsOrigin().x(), -contentsLayer->boundsOrigin().y()));
#endif
- textureMapperLayer->setScrollPositionDeltaIfNeeded(FloatSize(-contentsLayer->boundsOrigin().x(), -contentsLayer->boundsOrigin().y()));
+ textureMapperLayer->setScrollPositionDeltaIfNeeded(FloatSize(contentsLayer->boundsOrigin() - contentsLayer->position()));
}
}
return false;
const IntSize contentLayerSize(contentsLayer->size().width(), contentsLayer->size().height());
- const IntRect boundaryRect(FloatRect(scrollingLayer->position(), scrollingLayer->size()));
- const IntRect visibleRect(FloatRect(contentsLayer->boundsOrigin(), scrollingLayer->size()));
+ const IntRect boundaryRect(FloatRect(FloatPoint(0, 0), scrollingLayer->size()));
+ const IntRect visibleRect(FloatRect(-contentsLayer->boundsOrigin().x(),
+ -contentsLayer->boundsOrigin().y(),
+ scrollingLayer->size().width(),
+ scrollingLayer->size().height()));
+
IntRect newVisibleRect = visibleRect;
newVisibleRect.moveBy(flooredIntPoint(offset));
if (visibleRect == newVisibleRect)
return false;
- contentsLayer->setBoundsOrigin(newVisibleRect.location());
+ contentsLayer->setBoundsOrigin(FloatPoint(-newVisibleRect.x(), -newVisibleRect.y()));
m_drawingAreaProxy->page()->process()->send(Messages::LayerTreeCoordinator::SetVisibleContentsRectAndTrajectoryVectorForLayer(id, visibleRect, offset), m_drawingAreaProxy->page()->pageID());