[core] s/Update::Zoom/Update/RecalculateStyle/

This commit is contained in:
Bruno de Oliveira Abinader
2016-03-06 16:25:55 +02:00
parent 4909169996
commit f736e46ca4
4 changed files with 14 additions and 14 deletions

View File

@@ -10,7 +10,7 @@ enum class Update : uint32_t {
Dimensions = 1 << 1,
DefaultTransition = 1 << 2,
Classes = 1 << 3,
Zoom = 1 << 4,
RecalculateStyle = 1 << 4,
RenderStill = 1 << 5,
Repaint = 1 << 6,
Annotations = 1 << 7,

View File

@@ -149,18 +149,18 @@ bool Map::isPanning() const {
void Map::jumpTo(const CameraOptions& camera) {
transform->jumpTo(camera);
update(camera.zoom ? Update::Zoom : Update::Repaint);
update(camera.zoom ? Update::RecalculateStyle : Update::Repaint);
}
void Map::easeTo(const CameraOptions& camera, const AnimationOptions& animation) {
transform->easeTo(camera, animation);
update(camera.zoom ? Update::Zoom : Update::Repaint);
update(camera.zoom ? Update::RecalculateStyle : Update::Repaint);
}
void Map::flyTo(const CameraOptions& camera, const AnimationOptions& animation) {
transform->flyTo(camera, animation);
update(Update::Zoom);
update(Update::RecalculateStyle);
}
#pragma mark - Position
@@ -196,7 +196,7 @@ void Map::resetPosition(optional<EdgeInsets> padding) {
camera.padding = padding;
camera.zoom = 0;
transform->jumpTo(camera);
update(Update::Zoom);
update(Update::RecalculateStyle);
}
@@ -204,12 +204,12 @@ void Map::resetPosition(optional<EdgeInsets> padding) {
void Map::scaleBy(double ds, optional<ScreenCoordinate> anchor, const Duration& duration) {
transform->scaleBy(ds, anchor, duration);
update(Update::Zoom);
update(Update::RecalculateStyle);
}
void Map::setScale(double scale, optional<ScreenCoordinate> anchor, const Duration& duration) {
transform->setScale(scale, anchor, duration);
update(Update::Zoom);
update(Update::RecalculateStyle);
}
double Map::getScale() const {
@@ -222,7 +222,7 @@ void Map::setZoom(double zoom, const Duration& duration) {
void Map::setZoom(double zoom, optional<EdgeInsets> padding, const Duration& duration) {
transform->setZoom(zoom, padding, duration);
update(Update::Zoom);
update(Update::RecalculateStyle);
}
double Map::getZoom() const {
@@ -235,7 +235,7 @@ void Map::setLatLngZoom(const LatLng& latLng, double zoom, const Duration& durat
void Map::setLatLngZoom(const LatLng& latLng, double zoom, optional<EdgeInsets> padding, const Duration& duration) {
transform->setLatLngZoom(latLng, zoom, padding, duration);
update(Update::Zoom);
update(Update::RecalculateStyle);
}
CameraOptions Map::cameraForLatLngBounds(const LatLngBounds& bounds, optional<EdgeInsets> padding) {

View File

@@ -150,7 +150,7 @@ void MapContext::loadStyleJSON(const std::string& json, const std::string& base)
// created but before a style is loaded
data.loading = true;
updateAsync(Update::DefaultTransition | Update::Classes | Update::Zoom | Update::Annotations);
updateAsync(Update::DefaultTransition | Update::Classes | Update::RecalculateStyle | Update::Annotations);
}
void MapContext::update() {
@@ -175,7 +175,7 @@ void MapContext::update() {
style->cascade();
}
if (updateFlags & Update::Classes || updateFlags & Update::Zoom) {
if (updateFlags & Update::Classes || updateFlags & Update::RecalculateStyle) {
style->recalculate(transformState.getZoom());
}
@@ -249,7 +249,7 @@ bool MapContext::renderSync(const TransformState& state, const FrameData& frame)
view.afterRender();
if (style->hasTransitions()) {
updateAsync(Update::Zoom);
updateAsync(Update::RecalculateStyle);
} else if (painter->needsAnimation()) {
updateAsync(Update::Repaint);
}

View File

@@ -114,7 +114,7 @@ void Transform::easeTo(const CameraOptions& camera, const AnimationOptions& anim
const double scale = state.zoomScale(zoom);
pitch = util::clamp(pitch, 0., util::PITCH_MAX);
Update update = state.getZoom() == zoom ? Update::Repaint : Update::Zoom;
Update update = state.getZoom() == zoom ? Update::Repaint : Update::RecalculateStyle;
// Minimize rotation by taking the shorter path around the circle.
angle = _normalizeAngle(angle, state.angle);
@@ -325,7 +325,7 @@ void Transform::flyTo(const CameraOptions &camera, const AnimationOptions &anima
if (padding) {
state.moveLatLng(frameLatLng, center);
}
return Update::Zoom;
return Update::RecalculateStyle;
}, duration);
}