respect style background color
This commit is contained in:
@@ -113,9 +113,15 @@ struct FillProperties {
|
||||
};
|
||||
|
||||
struct BackgroundClass {
|
||||
Color fill_color = {{ 0, 0, 0, 0 }};
|
||||
Color color = {{ 1, 1, 1, 1 }};
|
||||
};
|
||||
|
||||
|
||||
struct BackgroundProperties {
|
||||
Color color = {{ 1, 1, 1, 1 }};
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -52,6 +52,7 @@ public:
|
||||
// This are applied settings.
|
||||
std::set<std::string> appliedClasses;
|
||||
struct {
|
||||
BackgroundProperties background;
|
||||
std::map<std::string, FillProperties> fills;
|
||||
std::map<std::string, LineProperties> lines;
|
||||
std::map<std::string, PointProperties> points;
|
||||
|
||||
@@ -114,10 +114,8 @@ void Painter::prepareClippingMask() {
|
||||
}
|
||||
|
||||
void Painter::drawClippingMask(const mat4& matrix, uint8_t clip_id) {
|
||||
Color fill_color = {{ 1, 1, 1, 1 }};
|
||||
|
||||
plainShader->setMatrix(matrix);
|
||||
plainShader->setColor(fill_color);
|
||||
plainShader->setColor(style.computed.background.color);
|
||||
|
||||
glStencilFunc(GL_ALWAYS, clip_id, 0xFF);
|
||||
glDrawArrays(GL_TRIANGLES, 0, (GLsizei)tileStencilBuffer.index());
|
||||
|
||||
@@ -74,6 +74,9 @@ void Style::cascade(float z) {
|
||||
point.opacity = layer.opacity(z);
|
||||
point.image = layer.image;
|
||||
}
|
||||
|
||||
// Cascade background
|
||||
computed.background.color = sheetClass.background.color;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -562,7 +565,7 @@ BackgroundClass loadBackgroundClassJSON(const rapidjson::Value& value) {
|
||||
BackgroundClass klass;
|
||||
|
||||
if (value.HasMember("color")) {
|
||||
klass.fill_color = parseColor(value["color"]);
|
||||
klass.color = parseColor(value["color"]);
|
||||
}
|
||||
|
||||
return klass;
|
||||
|
||||
Reference in New Issue
Block a user