Bug 803207 - Kill GetDevicePixelsPerMetaViewportPixel and use widget scaling correctly on Fennec. r=mbrubeck
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user