Pass {Duration,TimePoint} by const ref if possible
This commit is contained in:
@@ -116,12 +116,12 @@ void Map::setGestureInProgress(bool inProgress) {
|
||||
|
||||
#pragma mark - Position
|
||||
|
||||
void Map::moveBy(double dx, double dy, Duration duration) {
|
||||
void Map::moveBy(double dx, double dy, const Duration& duration) {
|
||||
transform->moveBy(dx, dy, duration);
|
||||
update();
|
||||
}
|
||||
|
||||
void Map::setLatLng(LatLng latLng, Duration duration) {
|
||||
void Map::setLatLng(LatLng latLng, const Duration& duration) {
|
||||
transform->setLatLng(latLng, duration);
|
||||
update();
|
||||
}
|
||||
@@ -140,12 +140,12 @@ void Map::resetPosition() {
|
||||
|
||||
#pragma mark - Scale
|
||||
|
||||
void Map::scaleBy(double ds, double cx, double cy, Duration duration) {
|
||||
void Map::scaleBy(double ds, double cx, double cy, const Duration& duration) {
|
||||
transform->scaleBy(ds, cx, cy, duration);
|
||||
update(Update::Zoom);
|
||||
}
|
||||
|
||||
void Map::setScale(double scale, double cx, double cy, Duration duration) {
|
||||
void Map::setScale(double scale, double cx, double cy, const Duration& duration) {
|
||||
transform->setScale(scale, cx, cy, duration);
|
||||
update(Update::Zoom);
|
||||
}
|
||||
@@ -154,7 +154,7 @@ double Map::getScale() const {
|
||||
return transform->getScale();
|
||||
}
|
||||
|
||||
void Map::setZoom(double zoom, Duration duration) {
|
||||
void Map::setZoom(double zoom, const Duration& duration) {
|
||||
transform->setZoom(zoom, duration);
|
||||
update(Update::Zoom);
|
||||
}
|
||||
@@ -163,12 +163,12 @@ double Map::getZoom() const {
|
||||
return transform->getZoom();
|
||||
}
|
||||
|
||||
void Map::setLatLngZoom(LatLng latLng, double zoom, Duration duration) {
|
||||
void Map::setLatLngZoom(LatLng latLng, double zoom, const Duration& duration) {
|
||||
transform->setLatLngZoom(latLng, zoom, duration);
|
||||
update(Update::Zoom);
|
||||
}
|
||||
|
||||
void Map::fitBounds(LatLngBounds bounds, EdgeInsets padding, Duration duration) {
|
||||
void Map::fitBounds(LatLngBounds bounds, EdgeInsets padding, const Duration& duration) {
|
||||
AnnotationSegment segment = {
|
||||
{bounds.ne.latitude, bounds.sw.longitude},
|
||||
bounds.sw,
|
||||
@@ -178,7 +178,7 @@ void Map::fitBounds(LatLngBounds bounds, EdgeInsets padding, Duration duration)
|
||||
fitBounds(segment, padding, duration);
|
||||
}
|
||||
|
||||
void Map::fitBounds(AnnotationSegment segment, EdgeInsets padding, Duration duration) {
|
||||
void Map::fitBounds(AnnotationSegment segment, EdgeInsets padding, const Duration& duration) {
|
||||
if (segment.empty()) {
|
||||
return;
|
||||
}
|
||||
@@ -243,12 +243,12 @@ uint16_t Map::getHeight() const {
|
||||
|
||||
#pragma mark - Rotation
|
||||
|
||||
void Map::rotateBy(double sx, double sy, double ex, double ey, Duration duration) {
|
||||
void Map::rotateBy(double sx, double sy, double ex, double ey, const Duration& duration) {
|
||||
transform->rotateBy(sx, sy, ex, ey, duration);
|
||||
update();
|
||||
}
|
||||
|
||||
void Map::setBearing(double degrees, Duration duration) {
|
||||
void Map::setBearing(double degrees, const Duration& duration) {
|
||||
transform->setAngle(-degrees * M_PI / 180, duration);
|
||||
update();
|
||||
}
|
||||
@@ -416,12 +416,12 @@ std::vector<std::string> Map::getClasses() const {
|
||||
return data->getClasses();
|
||||
}
|
||||
|
||||
void Map::setDefaultTransitionDuration(Duration duration) {
|
||||
void Map::setDefaultTransitionDuration(const Duration& duration) {
|
||||
data->setDefaultTransitionDuration(duration);
|
||||
update(Update::DefaultTransitionDuration);
|
||||
}
|
||||
|
||||
Duration Map::getDefaultTransitionDuration() {
|
||||
Duration Map::getDefaultTransitionDuration() const {
|
||||
return data->getDefaultTransitionDuration();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user