diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/mbgl/style/conversion/make_property_setters.hpp | 1 | ||||
-rw-r--r-- | include/mbgl/style/layers/symbol_layer.hpp | 4 | ||||
-rw-r--r-- | include/mbgl/util/size.hpp | 4 |
3 files changed, 9 insertions, 0 deletions
diff --git a/include/mbgl/style/conversion/make_property_setters.hpp b/include/mbgl/style/conversion/make_property_setters.hpp index 1c26aeb5e4..f29d5f5b6f 100644 --- a/include/mbgl/style/conversion/make_property_setters.hpp +++ b/include/mbgl/style/conversion/make_property_setters.hpp @@ -45,6 +45,7 @@ auto makeLayoutPropertySetters() { result["icon-padding"] = &setProperty<V, SymbolLayer, PropertyValue<float>, &SymbolLayer::setIconPadding>; result["icon-keep-upright"] = &setProperty<V, SymbolLayer, PropertyValue<bool>, &SymbolLayer::setIconKeepUpright>; result["icon-offset"] = &setProperty<V, SymbolLayer, DataDrivenPropertyValue<std::array<float, 2>>, &SymbolLayer::setIconOffset>; + result["icon-pitch-alignment"] = &setProperty<V, SymbolLayer, PropertyValue<AlignmentType>, &SymbolLayer::setIconPitchAlignment>; result["text-pitch-alignment"] = &setProperty<V, SymbolLayer, PropertyValue<AlignmentType>, &SymbolLayer::setTextPitchAlignment>; result["text-rotation-alignment"] = &setProperty<V, SymbolLayer, PropertyValue<AlignmentType>, &SymbolLayer::setTextRotationAlignment>; result["text-field"] = &setProperty<V, SymbolLayer, DataDrivenPropertyValue<std::string>, &SymbolLayer::setTextField>; diff --git a/include/mbgl/style/layers/symbol_layer.hpp b/include/mbgl/style/layers/symbol_layer.hpp index 8158f267c9..f4d0322dc7 100644 --- a/include/mbgl/style/layers/symbol_layer.hpp +++ b/include/mbgl/style/layers/symbol_layer.hpp @@ -98,6 +98,10 @@ public: DataDrivenPropertyValue<std::array<float, 2>> getIconOffset() const; void setIconOffset(DataDrivenPropertyValue<std::array<float, 2>>); + static PropertyValue<AlignmentType> getDefaultIconPitchAlignment(); + PropertyValue<AlignmentType> getIconPitchAlignment() const; + void setIconPitchAlignment(PropertyValue<AlignmentType>); + static PropertyValue<AlignmentType> getDefaultTextPitchAlignment(); PropertyValue<AlignmentType> getTextPitchAlignment() const; void setTextPitchAlignment(PropertyValue<AlignmentType>); 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; |