[core] Update shaders.

Implements 'icon-pitch-alignment' (issue #9345)
Fixes issue #9456 (map-aligned point label regression)
This commit is contained in:
Chris Loer
2017-07-11 11:22:39 -07:00
committed by Chris Loer
parent af10e2d3be
commit e8657becc5
23 changed files with 458 additions and 118 deletions

View File

@@ -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>;

View File

@@ -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>);

View File

@@ -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;