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

Function GetScaledSpriteSize

src/widget.cpp:68–75  ·  view source on GitHub ↗

* Scale sprite size for GUI. * Offset is ignored. */

Source from the content-addressed store, hash-verified

66 * Offset is ignored.
67 */
68Dimension GetScaledSpriteSize(SpriteID sprid)
69{
70 Point offset;
71 Dimension d = GetSpriteSize(sprid, &offset, ZoomLevel::Normal);
72 d.width -= offset.x;
73 d.height -= offset.y;
74 return ScaleGUITrad(d);
75}
76
77/**
78 * Scale sprite size for GUI, as a square.

Callers 15

UpdateWidgetSizeMethod · 0.85
UpdateWidgetSizeMethod · 0.85
DrawEditBoxMethod · 0.85
GetCaretPositionMethod · 0.85
GetBoundingRectMethod · 0.85
GetCharAtPositionMethod · 0.85
ClickEditBoxMethod · 0.85
UpdateWidgetSizeMethod · 0.85
OnInitMethod · 0.85
ComputeGroupInfoSizeMethod · 0.85
UpdateWidgetSizeMethod · 0.85
UpdateWidgetSizeMethod · 0.85

Calls 2

GetSpriteSizeFunction · 0.85
ScaleGUITradFunction · 0.70

Tested by

no test coverage detected