Bug 912166 - Make nsIWidget::GetDefaultScale return a typed scale value. r=roc

This commit is contained in:
Mina Almasry
2013-09-17 20:45:19 -04:00
parent b24ba49fb9
commit 44fe7870d8
17 changed files with 103 additions and 83 deletions

View File

@@ -757,12 +757,13 @@ AndroidGeckoEvent::MakeTouchEvent(nsIWidget* widget)
// into Gecko (as opposed to going through the AsyncPanZoomController),
// and the Points() array has points in CSS pixels, which we need
// to convert.
CSSToLayoutDeviceScale scale = widget->GetDefaultScale();
nsIntPoint pt(
(Points()[i].x * widget->GetDefaultScale()) - offset.x,
(Points()[i].y * widget->GetDefaultScale()) - offset.y);
(Points()[i].x * scale.scale) - offset.x,
(Points()[i].y * scale.scale) - offset.y);
nsIntPoint radii(
PointRadii()[i].x * widget->GetDefaultScale(),
PointRadii()[i].y * widget->GetDefaultScale());
PointRadii()[i].x * scale.scale,
PointRadii()[i].y * scale.scale);
nsRefPtr<Touch> t = new Touch(PointIndicies()[i],
pt,
radii,