use std::array instead of c-style array

This commit is contained in:
jrkb 2023-04-22 11:55:04 +02:00
parent 2f506000ab
commit 0eab1db037

View file

@ -146,7 +146,7 @@ struct GlyphIdentity {
struct GlyphAppearance { struct GlyphAppearance {
uint32_t charcode; uint32_t charcode;
glm::vec4 color; std::array <float, 4> color;
float fontSize_px; float fontSize_px;
}; };
} }
@ -1057,27 +1057,27 @@ class Font {
bb.multiply(node.getGlobalTransformMatrix()); bb.multiply(node.getGlobalTransformMatrix());
int32_t base = static_cast <int32_t>(vertices.size()); int32_t base = static_cast <int32_t>(vertices.size());
const glm::vec4 & color = variationTextAppearance[i].color; const std::array <float, 4> & color = variationTextAppearance[i].color;
vertices.push_back(BufferVertex{bb.p0.x, bb.p0.y, bb.u0, bb.v0, bb.bufferIndex, vertices.push_back(BufferVertex{bb.p0.x, bb.p0.y, bb.u0, bb.v0, bb.bufferIndex,
color.r, color[0],
color.g, color[1],
color.b, color[2],
color.a}); color[3]});
vertices.push_back(BufferVertex{bb.p1.x, bb.p1.y, bb.u1, bb.v0, bb.bufferIndex, vertices.push_back(BufferVertex{bb.p1.x, bb.p1.y, bb.u1, bb.v0, bb.bufferIndex,
color.r, color[0],
color.g, color[1],
color.b, color[2],
color.a}); color[3]});
vertices.push_back(BufferVertex{bb.p2.x, bb.p2.y, bb.u1, bb.v1, bb.bufferIndex, vertices.push_back(BufferVertex{bb.p2.x, bb.p2.y, bb.u1, bb.v1, bb.bufferIndex,
color.r, color[0],
color.g, color[1],
color.b, color[2],
color.a}); color[3]});
vertices.push_back(BufferVertex{bb.p3.x, bb.p3.y, bb.u0, bb.v1, bb.bufferIndex, vertices.push_back(BufferVertex{bb.p3.x, bb.p3.y, bb.u0, bb.v1, bb.bufferIndex,
color.r, color[0],
color.g, color[1],
color.b, color[2],
color.a}); color[3]});
indices.insert(indices.end(), {base, base + 1, base + 2, base + 2, base + 3, base}); indices.insert(indices.end(), {base, base + 1, base + 2, base + 2, base + 3, base});