diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2016-07-01 11:51:54 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2016-07-01 12:38:33 +0200 |
commit | 77e784675687d13439a8104c97c5bb0a9ccd8b01 (patch) | |
tree | ac5fe39c7c1d0db0923fec2b00b56291ef0f548e /include | |
parent | da863c6e52f656bd35c3d3346093a24d747d0bbd (diff) | |
download | qtlocation-mapboxgl-77e784675687d13439a8104c97c5bb0a9ccd8b01.tar.gz |
[core] code style cleanups
- puts function definitions in a namespace ... {} rather than using namespace ...;
- remove trailing whitespace
- add trailing newline
- protect SQL statements from being formatted by clang-format
Diffstat (limited to 'include')
-rw-r--r-- | include/mbgl/gl/gl.hpp | 6 | ||||
-rw-r--r-- | include/mbgl/map/camera.hpp | 26 | ||||
-rw-r--r-- | include/mbgl/util/geo.hpp | 8 |
3 files changed, 20 insertions, 20 deletions
diff --git a/include/mbgl/gl/gl.hpp b/include/mbgl/gl/gl.hpp index 0f54b96110..d033fef549 100644 --- a/include/mbgl/gl/gl.hpp +++ b/include/mbgl/gl/gl.hpp @@ -45,9 +45,9 @@ namespace gl { GLsizei length, const GLchar *message, const void *userParam); - + template <class... Args> void mbx_trapExtension(const char *name, Args... args); - + void mbx_trapExtension(const char *); void mbx_trapExtension(const char *, GLint, const char *); void mbx_trapExtension(const char *, GLsizei, GLuint *); @@ -58,7 +58,7 @@ namespace gl { void mbx_trapExtension(const char *, GLuint, GLuint, GLuint, GLuint, GLint, const char *, const void*); void mbx_trapExtension(const char *name, GLuint array); #endif - + struct Error : ::std::runtime_error { Error(GLenum err, const std::string &msg) : ::std::runtime_error(msg), code(err) {}; const GLenum code; diff --git a/include/mbgl/map/camera.hpp b/include/mbgl/map/camera.hpp index 3f39ca2dc9..1c389577f0 100644 --- a/include/mbgl/map/camera.hpp +++ b/include/mbgl/map/camera.hpp @@ -14,23 +14,23 @@ namespace mbgl { struct CameraOptions { /** Coordinate at the center of the map. */ optional<LatLng> center; - + /** Padding around the interior of the view that affects the frame of reference for `center`. */ optional<EdgeInsets> padding; - + /** Point of reference for `zoom` and `angle`, assuming an origin at the top-left corner of the view. */ optional<ScreenCoordinate> anchor; - + /** Zero-based zoom level. Constrained to the minimum and maximum zoom levels. */ optional<double> zoom; - + /** Bearing, measured in radians counterclockwise from true north. Wrapped to [−π rad, π rad). */ optional<double> angle; - + /** Pitch toward the horizon measured in radians, with 0 rad resulting in a two-dimensional map. */ optional<double> pitch; @@ -42,33 +42,33 @@ struct CameraOptions { struct AnimationOptions { /** Time to animate to the viewpoint defined herein. */ optional<Duration> duration; - + /** Average velocity of a flyTo() transition, measured in screenfuls per second, assuming a linear timing curve. - + A <i>screenful</i> is the visible span in pixels. It does not correspond to a fixed physical distance but rather varies by zoom level. */ optional<double> velocity; - + /** Zero-based zoom level at the peak of the flyTo() transition’s flight path. */ optional<double> minZoom; - + /** The easing timing curve of the transition. */ optional<mbgl::util::UnitBezier> easing; - + /** A function that is called on each frame of the transition, just before a screen update, except on the last frame. The first parameter indicates the elapsed time as a percentage of the duration. */ std::function<void(double)> transitionFrameFn; - + /** A function that is called once on the last frame of the transition, just before the corresponding screen update. */ std::function<void()> transitionFinishFn; - + /** Creates an animation with no options specified. */ AnimationOptions() {} - + /** Creates an animation with the specified duration. */ AnimationOptions(Duration d) : duration(d) {} diff --git a/include/mbgl/util/geo.hpp b/include/mbgl/util/geo.hpp index a68058048d..9dca10eb84 100644 --- a/include/mbgl/util/geo.hpp +++ b/include/mbgl/util/geo.hpp @@ -191,12 +191,12 @@ public: double left = 0; ///< Number of pixels inset from the left edge. double bottom = 0; ///< Number of pixels inset from the bottom edge. double right = 0; ///< Number of pixels inset from the right edge. - + EdgeInsets() {} - + EdgeInsets(const double t, const double l, const double b, const double r) : top(t), left(l), bottom(b), right(r) {} - + explicit operator bool() const { return !(std::isnan(top) || std::isnan(left) || std::isnan(bottom) || std::isnan(right)) && (top || left || bottom || right); @@ -214,7 +214,7 @@ public: top + o.top, left + o.left, bottom + o.bottom, right + o.right, }; } - + ScreenCoordinate getCenter(uint16_t width, uint16_t height) const; }; |