Bug 803207 - Kill GetDevicePixelsPerMetaViewportPixel and use widget scaling correctly on Fennec. r=mbrubeck

This commit is contained in:
Kartikaya Gupta
2013-07-04 09:02:29 -04:00
parent a276d21633
commit 884dc7b83e
10 changed files with 42 additions and 73 deletions

View File

@@ -781,9 +781,19 @@ AndroidGeckoEvent::MakeTouchEvent(nsIWidget* widget)
const nsIntPoint& offset = widget->WidgetToScreenOffset();
event.touches.SetCapacity(endIndex - startIndex);
for (int i = startIndex; i < endIndex; i++) {
// In this code branch, we are dispatching this event directly
// into Gecko (as opposed to going through the AsyncPanZoomController),
// and the Points() array has points in CSS pixels, which we need
// to convert.
nsIntPoint pt(
(Points()[i].x * widget->GetDefaultScale()) - offset.x,
(Points()[i].y * widget->GetDefaultScale()) - offset.y);
nsIntPoint radii(
PointRadii()[i].x * widget->GetDefaultScale(),
PointRadii()[i].y * widget->GetDefaultScale());
nsRefPtr<Touch> t = new Touch(PointIndicies()[i],
Points()[i] - offset,
PointRadii()[i],
pt,
radii,
Orientations()[i],
Pressures()[i]);
event.touches.AppendElement(t);