* Draw the cached links or part of them into the given area. * @param dpi Area to be drawn to. */
| 274 | * @param dpi Area to be drawn to. |
| 275 | */ |
| 276 | void LinkGraphOverlay::DrawLinks(const DrawPixelInfo *dpi) const |
| 277 | { |
| 278 | int width = ScaleGUITrad(this->scale); |
| 279 | for (const auto &i : this->cached_links) { |
| 280 | if (!Station::IsValidID(i.first)) continue; |
| 281 | Point pta = this->GetStationMiddle(Station::Get(i.first)); |
| 282 | for (const auto &j : i.second) { |
| 283 | if (!Station::IsValidID(j.first)) continue; |
| 284 | Point ptb = this->GetStationMiddle(Station::Get(j.first)); |
| 285 | if (!this->IsLinkVisible(pta, ptb, dpi, width + 2)) continue; |
| 286 | this->DrawContent(pta, ptb, j.second); |
| 287 | } |
| 288 | } |
| 289 | } |
| 290 | |
| 291 | /** |
| 292 | * Draw one specific link. |
no test coverage detected