| 127 | } |
| 128 | |
| 129 | void appendLoopFill(const PointsAnnotation& pa, std::vector<float>& out) { |
| 130 | if (pa.topology != AnnotationTopology::kLineLoop || pa.fill_color.a == 0 || pa.points.size() < 3) { |
| 131 | return; |
| 132 | } |
| 133 | const Point2& p0 = pa.points[0]; |
| 134 | for (size_t i = 1; i + 1 < pa.points.size(); ++i) { |
| 135 | pushVertex(out, p0.x, p0.y, pa.fill_color); |
| 136 | pushVertex(out, pa.points[i].x, pa.points[i].y, pa.fill_color); |
| 137 | pushVertex(out, pa.points[i + 1].x, pa.points[i + 1].y, pa.fill_color); |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | void appendCircleStroke(const CircleAnnotation& circle, double image_px_per_screen_px, std::vector<float>& out) { |
| 142 | if (circle.color.a == 0 || circle.radius <= 0.0) { |