| 1349 | } |
| 1350 | |
| 1351 | static Rect ExpandRectWithViewportSignMargins(Rect r, ZoomLevel zoom) |
| 1352 | { |
| 1353 | const int fh = std::max(GetCharacterHeight(FS_NORMAL), GetCharacterHeight(FS_SMALL)); |
| 1354 | const int max_tw = _viewport_sign_maxwidth / 2 + 1; |
| 1355 | const int expand_y = ScaleByZoom(WidgetDimensions::scaled.fullbevel.top + fh + WidgetDimensions::scaled.fullbevel.bottom, zoom); |
| 1356 | const int expand_x = ScaleByZoom(WidgetDimensions::scaled.fullbevel.left + max_tw + WidgetDimensions::scaled.fullbevel.right, zoom); |
| 1357 | |
| 1358 | r.left -= expand_x; |
| 1359 | r.right += expand_x; |
| 1360 | r.top -= expand_y; |
| 1361 | r.bottom += expand_y; |
| 1362 | |
| 1363 | return r; |
| 1364 | } |
| 1365 | |
| 1366 | /** |
| 1367 | * Add town strings to a viewport. |
no test coverage detected