mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-17 11:39:11 +00:00
Cleanup: Remove unnecessary pressed button offset code.
This commit is contained in:
@@ -961,7 +961,7 @@ struct PaymentRatesGraphWindow : BaseGraphWindow {
|
||||
/* Redraw frame if lowered */
|
||||
if (lowered) DrawFrameRect(line, COLOUR_BROWN, FR_LOWERED);
|
||||
|
||||
const Rect text = line.Shrink(WidgetDimensions::scaled.framerect).Translate(lowered ? WidgetDimensions::scaled.pressed : 0, lowered ? WidgetDimensions::scaled.pressed : 0);
|
||||
const Rect text = line.Shrink(WidgetDimensions::scaled.framerect);
|
||||
|
||||
/* Cargo-colour box with outline */
|
||||
const Rect cargo = text.WithWidth(this->legend_width, rtl);
|
||||
@@ -1209,9 +1209,8 @@ struct PerformanceRatingDetailWindow : Window {
|
||||
if (IsInsideMM(widget, WID_PRD_COMPANY_FIRST, WID_PRD_COMPANY_LAST + 1)) {
|
||||
if (this->IsWidgetDisabled(widget)) return;
|
||||
CompanyID cid = (CompanyID)(widget - WID_PRD_COMPANY_FIRST);
|
||||
int offset = (cid == this->company) ? WidgetDimensions::scaled.pressed : 0;
|
||||
Dimension sprite_size = GetSpriteSize(SPR_COMPANY_ICON);
|
||||
DrawCompanyIcon(cid, CenterBounds(r.left, r.right, sprite_size.width) + offset, CenterBounds(r.top, r.bottom, sprite_size.height) + offset);
|
||||
DrawCompanyIcon(cid, CenterBounds(r.left, r.right, sprite_size.width), CenterBounds(r.top, r.bottom, sprite_size.height));
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user