Merge branch 'master' into jgrpp
# Conflicts: # src/core/geometry_type.hpp # src/error_gui.cpp # src/rail_gui.cpp # src/tree_gui.cpp # src/vehicle_gui.cpp # src/widgets/dropdown.cpp
This commit is contained in:
@@ -761,7 +761,7 @@ void LinkGraphLegendWindow::DrawWidget(const Rect &r, int widget) const
|
||||
if (this->IsWidgetDisabled(widget)) return;
|
||||
CompanyID cid = (CompanyID)(widget - WID_LGL_COMPANY_FIRST);
|
||||
Dimension sprite_size = GetSpriteSize(SPR_COMPANY_ICON);
|
||||
DrawCompanyIcon(cid, (r.left + r.right + 1 - sprite_size.width) / 2, (r.top + r.bottom + 1 - sprite_size.height) / 2);
|
||||
DrawCompanyIcon(cid, CenterBounds(r.left, r.right, sprite_size.width), CenterBounds(r.top, r.bottom, sprite_size.height));
|
||||
}
|
||||
if (IsInsideMM(widget, WID_LGL_SATURATION_FIRST, WID_LGL_SATURATION_LAST + 1)) {
|
||||
uint8 colour = LinkGraphOverlay::LINK_COLOURS[_settings_client.gui.linkgraph_colours][widget - WID_LGL_SATURATION_FIRST];
|
||||
@@ -775,14 +775,14 @@ void LinkGraphLegendWindow::DrawWidget(const Rect &r, int widget) const
|
||||
str = STR_LINKGRAPH_LEGEND_SATURATED;
|
||||
}
|
||||
if (str != STR_NULL) {
|
||||
DrawString(r.left, r.right, (r.top + r.bottom + 1 - FONT_HEIGHT_SMALL) / 2, str, GetContrastColour(colour) | TC_FORCED, SA_HOR_CENTER);
|
||||
DrawString(r.left, r.right, CenterBounds(r.top, r.bottom, FONT_HEIGHT_SMALL), str, GetContrastColour(colour) | TC_FORCED, SA_HOR_CENTER);
|
||||
}
|
||||
}
|
||||
if (IsInsideMM(widget, WID_LGL_CARGO_FIRST, WID_LGL_CARGO_LAST + 1)) {
|
||||
if (this->IsWidgetDisabled(widget)) return;
|
||||
CargoSpec *cargo = CargoSpec::Get(widget - WID_LGL_CARGO_FIRST);
|
||||
GfxFillRect(r.left + 2, r.top + 2, r.right - 2, r.bottom - 2, cargo->legend_colour);
|
||||
DrawString(r.left, r.right, (r.top + r.bottom + 1 - FONT_HEIGHT_SMALL) / 2, cargo->abbrev, GetContrastColour(cargo->legend_colour, 73), SA_HOR_CENTER);
|
||||
DrawString(r.left, r.right, CenterBounds(r.top, r.bottom, FONT_HEIGHT_SMALL), cargo->abbrev, GetContrastColour(cargo->legend_colour, 73), SA_HOR_CENTER);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user