summaryrefslogtreecommitdiff
path: root/include/mbgl/util
diff options
context:
space:
mode:
authorChris Loer <chris.loer@gmail.com>2017-07-11 11:22:39 -0700
committerChris Loer <chris.loer@mapbox.com>2017-07-12 14:14:09 -0700
commite8657becc56c2aee5b070357092da028e752d461 (patch)
tree21a877d6adacfc468b4d2c0223bffec49ea3f5dc /include/mbgl/util
parentaf10e2d3be5f24c1887622c63332a3cf67bc19d5 (diff)
downloadqtlocation-mapboxgl-e8657becc56c2aee5b070357092da028e752d461.tar.gz
[core] Update shaders.
Implements 'icon-pitch-alignment' (issue #9345) Fixes issue #9456 (map-aligned point label regression)
Diffstat (limited to 'include/mbgl/util')
-rw-r--r--include/mbgl/util/size.hpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/mbgl/util/size.hpp b/include/mbgl/util/size.hpp
index 45c303969c..12c0ad056b 100644
--- a/include/mbgl/util/size.hpp
+++ b/include/mbgl/util/size.hpp
@@ -15,6 +15,10 @@ public:
constexpr uint32_t area() const {
return width * height;
}
+
+ constexpr float aspectRatio() const {
+ return static_cast<float>(width) / static_cast<float>(height);
+ }
constexpr bool isEmpty() const {
return width == 0 || height == 0;