Add a horizontal underline or strikethrough line to the vertex array
| 49 | { |
| 50 | // Add a horizontal underline or strikethrough line to the vertex array |
| 51 | void addLineHorizontal(sf::VertexArray& vertices, |
| 52 | float lineLeft, |
| 53 | float lineRight, |
| 54 | float lineTop, |
| 55 | sf::Color color, |
| 56 | float offset, |
| 57 | float thickness, |
| 58 | float outlineThickness = 0) |
| 59 | { |
| 60 | const float top = std::floor(lineTop + offset - (thickness / 2) + 0.5f); |
| 61 | const float bottom = top + std::floor(thickness + 0.5f); |
| 62 | |
| 63 | vertices.append({{lineLeft - outlineThickness, top - outlineThickness}, color, {1.0f, 1.0f}}); |
| 64 | vertices.append({{lineRight + outlineThickness, top - outlineThickness}, color, {1.0f, 1.0f}}); |
| 65 | vertices.append({{lineLeft - outlineThickness, bottom + outlineThickness}, color, {1.0f, 1.0f}}); |
| 66 | vertices.append({{lineLeft - outlineThickness, bottom + outlineThickness}, color, {1.0f, 1.0f}}); |
| 67 | vertices.append({{lineRight + outlineThickness, top - outlineThickness}, color, {1.0f, 1.0f}}); |
| 68 | vertices.append({{lineRight + outlineThickness, bottom + outlineThickness}, color, {1.0f, 1.0f}}); |
| 69 | } |
| 70 | |
| 71 | // Add a vertical strikethrough line to the vertex array |
| 72 | void addLineVertical(sf::VertexArray& vertices, |
no test coverage detected