clarify comment for gestures as well

This commit is contained in:
Justin R. Miller
2014-04-22 15:02:44 -07:00
parent cf5fefca20
commit a324929ba3

View File

@@ -187,13 +187,13 @@ void Transform::setScale(double new_scale, double cx, double cy, double duration
new_scale = max_scale;
}
// Zoom in on the center if we don't have click anchor coordinates.
// Zoom in on the center if we don't have click or gesture anchor coordinates.
if (cx < 0 || cy < 0) {
cx = width / 2;
cy = height / 2;
}
// Account for the x/y offset from the center (= where the user clicked)
// Account for the x/y offset from the center (= where the user clicked or pinched)
const double factor = new_scale / scale;
const double dx = (cx - width / 2) * (1.0 - factor);
const double dy = (cy - height / 2) * (1.0 - factor);