Convert a position in the plot's NDC to pixels
| 1184 | |
| 1185 | // Convert a position in the plot's NDC to pixels |
| 1186 | ImVec2 NDCToPixels(const ImPlot3DPlot& plot, const ImPlot3DPoint& point) { |
| 1187 | ImVec2 center = plot.PlotRect.GetCenter(); |
| 1188 | ImPlot3DPoint point_pix = plot.GetViewScale() * (plot.Rotation * point); |
| 1189 | point_pix.y *= -1.0f; // Invert y-axis |
| 1190 | point_pix.x += center.x; |
| 1191 | point_pix.y += center.y; |
| 1192 | |
| 1193 | return ImVec2((float)point_pix.x, (float)point_pix.y); |
| 1194 | } |
| 1195 | |
| 1196 | // Convert a position in the plot's coordinate system to the plot's normalized device coordinate system (NDC) |
| 1197 | ImPlot3DPoint PlotToNDC(const ImPlot3DPlot& plot, const ImPlot3DPoint& point) { |
no test coverage detected