diff --git a/src/viewport.cpp b/src/viewport.cpp index 8095d1a1e7..6df6440b99 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -197,7 +197,7 @@ struct LineSnapPoint : Point { typedef SmallVector LineSnapPoints; ///< Set of snapping points /** Coordinates of a polyline track made of 2 connected line segments. */ -struct Polyline { +struct PolylineInfo { Point start; ///< The point where the first segment starts (as given in LineSnapPoint). Direction first_dir; ///< Direction of the first line segment. uint first_len; ///< Length of the first segment - number of track pieces. @@ -4051,7 +4051,7 @@ Trackdir PointDirToTrackdir(const Point &pt, Direction dir) return ret; } -static bool FindPolyline(const Point &pt, const LineSnapPoint &start, Polyline *ret) +static bool FindPolyline(const Point &pt, const LineSnapPoint &start, PolylineInfo *ret) { /* relative coordinats of the mouse point (offset against the snap point) */ int x = pt.x - start.x; @@ -4157,7 +4157,7 @@ static inline uint SqrDist(const Point &a, const Point &b) return (b.x - a.x) * (b.x - a.x) + (b.y - a.y) * (b.y - a.y); } -static LineSnapPoint *FindBestPolyline(const Point &pt, LineSnapPoint *snap_points, uint num_points, Polyline *ret) +static LineSnapPoint *FindBestPolyline(const Point &pt, LineSnapPoint *snap_points, uint num_points, PolylineInfo *ret) { /* Find the best polyline (a pair of two lines - the white one and the blue * one) led from any of saved snap points to the mouse cursor. */ @@ -4166,7 +4166,7 @@ static LineSnapPoint *FindBestPolyline(const Point &pt, LineSnapPoint *snap_poin for (int i = 0; i < (int)num_points; i++) { /* try to fit a polyline */ - Polyline polyline; + PolylineInfo polyline; if (!FindPolyline(pt, snap_points[i], &polyline)) continue; // skip non-matching snap points /* check whether we've found a better polyline */ if (best_snap_point != NULL) { @@ -4395,7 +4395,7 @@ static HighLightStyle CalcPolyrailDrawstyle(Point pt, bool dragging) } /* find the best track */ - Polyline line; + PolylineInfo line; bool lock_snapping = dragging && snap_mode == RSM_SNAP_TO_RAIL; if (!lock_snapping) _current_snap_lock.x = -1;