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.Alignment = TextAlignment::LEFT;
|
||||||
_legacyPaint.SpriteBase = gCurrentFontSpriteBase;
|
_legacyPaint.SpriteBase = gCurrentFontSpriteBase;
|
||||||
|
|
||||||
auto layout = StaticLayout(buffer, _legacyPaint, width);
|
StaticLayout layout(buffer, _legacyPaint, width);
|
||||||
layout.Draw(dpi, x, y);
|
layout.Draw(dpi, x, y);
|
||||||
|
|
||||||
return layout.GetHeight();
|
return layout.GetHeight();
|
||||||
|
@ -232,7 +232,7 @@ extern "C"
|
||||||
_legacyPaint.Alignment = TextAlignment::CENTRE;
|
_legacyPaint.Alignment = TextAlignment::CENTRE;
|
||||||
_legacyPaint.SpriteBase = gCurrentFontSpriteBase;
|
_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
|
// The original tried to vertically centre the text, but used line count - 1
|
||||||
sint32 lineCount = layout.GetLineCount();
|
sint32 lineCount = layout.GetLineCount();
|
||||||
|
|
|
@ -17,11 +17,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "../common.h"
|
#include "../common.h"
|
||||||
|
#include "drawing.h"
|
||||||
extern "C"
|
|
||||||
{
|
|
||||||
#include "drawing.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
enum class TextAlignment
|
enum class TextAlignment
|
||||||
{
|
{
|
||||||
|
@ -47,6 +43,9 @@ private:
|
||||||
sint32 _lineHeight;
|
sint32 _lineHeight;
|
||||||
sint32 _maxWidth;
|
sint32 _maxWidth;
|
||||||
|
|
||||||
|
StaticLayout();
|
||||||
|
StaticLayout(const StaticLayout &);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
StaticLayout(utf8string source, TextPaint paint, sint32 width);
|
StaticLayout(utf8string source, TextPaint paint, sint32 width);
|
||||||
void Draw(rct_drawpixelinfo * dpi, sint32 x, sint32 y);
|
void Draw(rct_drawpixelinfo * dpi, sint32 x, sint32 y);
|
||||||
|
|
Loading…
Reference in New Issue