[core] Use PropertyValue<T> for Annotation line/fill
This commit is contained in:
@@ -24,11 +24,8 @@ void Painter::renderFill(PaintParameters& parameters,
|
||||
Color fillColor = properties.fillColor;
|
||||
float opacity = properties.fillOpacity;
|
||||
|
||||
Color strokeColor = properties.fillOutlineColor;
|
||||
bool isOutlineColorDefined = strokeColor.a >= 0;
|
||||
if (!isOutlineColorDefined) {
|
||||
strokeColor = fillColor;
|
||||
}
|
||||
const bool isOutlineColorDefined = !properties.fillOutlineColor.isUndefined();
|
||||
Color strokeColor = isOutlineColorDefined? properties.fillOutlineColor : fillColor;
|
||||
|
||||
auto worldSize = util::convert<GLfloat>(frame.framebufferSize);
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ public:
|
||||
PaintProperty<bool> fillAntialias { true };
|
||||
PaintProperty<float> fillOpacity { 1 };
|
||||
PaintProperty<Color> fillColor { { 0, 0, 0, 1 } };
|
||||
PaintProperty<Color> fillOutlineColor { { 0, 0, 0, -1 } };
|
||||
PaintProperty<Color> fillOutlineColor { {} };
|
||||
PaintProperty<std::array<float, 2>> fillTranslate { {{ 0, 0 }} };
|
||||
PaintProperty<TranslateAnchorType> fillTranslateAnchor { TranslateAnchorType::Map };
|
||||
PaintProperty<std::string, CrossFadedPropertyEvaluator> fillPattern { "" };
|
||||
|
||||
@@ -39,8 +39,12 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool isUndefined() const {
|
||||
return values.find(ClassID::Default) == values.end();
|
||||
}
|
||||
|
||||
const PropertyValue<T>& get() const {
|
||||
return values.at(ClassID::Default);
|
||||
return isUndefined() ? values.at(ClassID::Fallback) : values.at(ClassID::Default);
|
||||
}
|
||||
|
||||
void set(const PropertyValue<T>& value_, const optional<std::string>& klass) {
|
||||
|
||||
Reference in New Issue
Block a user