mirror of https://github.com/OpenRCT2/OpenRCT2.git
Apply requested changes
This commit is contained in:
parent
a65192b141
commit
fcfa4ffcc2
|
@ -214,7 +214,7 @@ extern "C"
|
|||
_legacyPaint.Alignment = TextAlignment::LEFT;
|
||||
_legacyPaint.SpriteBase = gCurrentFontSpriteBase;
|
||||
|
||||
auto layout = StaticLayout(buffer, _legacyPaint, width);
|
||||
StaticLayout layout(buffer, _legacyPaint, width);
|
||||
layout.Draw(dpi, x, y);
|
||||
|
||||
return layout.GetHeight();
|
||||
|
@ -232,7 +232,7 @@ extern "C"
|
|||
_legacyPaint.Alignment = TextAlignment::CENTRE;
|
||||
_legacyPaint.SpriteBase = gCurrentFontSpriteBase;
|
||||
|
||||
auto layout = StaticLayout(buffer, _legacyPaint, width);
|
||||
StaticLayout layout(buffer, _legacyPaint, width);
|
||||
|
||||
// The original tried to vertically centre the text, but used line count - 1
|
||||
sint32 lineCount = layout.GetLineCount();
|
||||
|
|
|
@ -17,11 +17,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "../common.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "drawing.h"
|
||||
}
|
||||
#include "drawing.h"
|
||||
|
||||
enum class TextAlignment
|
||||
{
|
||||
|
@ -47,6 +43,9 @@ private:
|
|||
sint32 _lineHeight;
|
||||
sint32 _maxWidth;
|
||||
|
||||
StaticLayout();
|
||||
StaticLayout(const StaticLayout &);
|
||||
|
||||
public:
|
||||
StaticLayout(utf8string source, TextPaint paint, sint32 width);
|
||||
void Draw(rct_drawpixelinfo * dpi, sint32 x, sint32 y);
|
||||
|
|
Loading…
Reference in New Issue