MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / IsPointVisible

Method IsPointVisible

src/linkgraph/linkgraph_gui.cpp:128–133  ·  view source on GitHub ↗

* Determine if a certain point is inside the given DPI, with some lee way. * @param pt Point we are looking for. * @param dpi Visible area. * @param padding Extent of the point. * @return If the point or any of its 'extent' is inside the dpi. */

Source from the content-addressed store, hash-verified

126 * @return If the point or any of its 'extent' is inside the dpi.
127 */
128inline bool LinkGraphOverlay::IsPointVisible(Point pt, const DrawPixelInfo *dpi, int padding) const
129{
130 return pt.x > dpi->left - padding && pt.y > dpi->top - padding &&
131 pt.x < dpi->left + dpi->width + padding &&
132 pt.y < dpi->top + dpi->height + padding;
133}
134
135/**
136 * Determine if a certain link crosses through the area given by the dpi with some lee way.

Callers 2

RebuildCacheMethod · 0.95
DrawStationDotsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected