summaryrefslogtreecommitdiffstats
path: root/src/render/Font.cpp
diff options
context:
space:
mode:
authorerorcun <erorcunerorcun@hotmail.com.tr>2020-11-09 23:41:21 +0100
committererorcun <erorcunerorcun@hotmail.com.tr>2020-11-09 23:50:34 +0100
commit59f9c009efd3e149b83621c61716fa8da1ee1309 (patch)
tree46d3644183f9bd7b4297f9f3f675f0322665a703 /src/render/Font.cpp
parentRevert "Font: Fix text dimensions" (diff)
downloadre3-59f9c009efd3e149b83621c61716fa8da1ee1309.tar
re3-59f9c009efd3e149b83621c61716fa8da1ee1309.tar.gz
re3-59f9c009efd3e149b83621c61716fa8da1ee1309.tar.bz2
re3-59f9c009efd3e149b83621c61716fa8da1ee1309.tar.lz
re3-59f9c009efd3e149b83621c61716fa8da1ee1309.tar.xz
re3-59f9c009efd3e149b83621c61716fa8da1ee1309.tar.zst
re3-59f9c009efd3e149b83621c61716fa8da1ee1309.zip
Diffstat (limited to '')
-rw-r--r--src/render/Font.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/render/Font.cpp b/src/render/Font.cpp
index 719dffce..fbcc38e4 100644
--- a/src/render/Font.cpp
+++ b/src/render/Font.cpp
@@ -279,8 +279,8 @@ CFont::Initialise(void)
SetColor(CRGBA(0xFF, 0xFF, 0xFF, 0));
SetJustifyOff();
SetCentreOff();
- SetWrapx(SCREEN_STRETCH_X(DEFAULT_SCREEN_WIDTH));
- SetCentreSize(SCREEN_STRETCH_X(DEFAULT_SCREEN_WIDTH));
+ SetWrapx(SCREEN_WIDTH);
+ SetCentreSize(SCREEN_WIDTH);
SetBackgroundOff();
SetBackgroundColor(CRGBA(0x80, 0x80, 0x80, 0x80));
SetBackGroundOnlyTextOff();
@@ -701,7 +701,14 @@ CFont::GetNumberLines(float xstart, float ystart, wchar *s)
y = ystart;
while(*s){
+#ifdef FIX_BUGS
+ float f = Details.centre ? Details.centreSize :
+ Details.rightJustify ? xstart - Details.rightJustifyWrap :
+ Details.wrapX;
+#else
float f = (Details.centre ? Details.centreSize : Details.wrapX);
+#endif
+
#ifdef MORE_LANGUAGES
if (IsJapaneseFont())
f -= SCREEN_SCALE_X(21.0f * 2.0f);
@@ -781,8 +788,15 @@ CFont::GetTextRect(CRect *rect, float xstart, float ystart, wchar *s)
x = xstart;
y = ystart;
+#ifdef FIX_BUGS
+ float xEnd = Details.centre ? Details.centreSize :
+ Details.rightJustify ? xstart - Details.rightJustifyWrap :
+ Details.wrapX;
+#else
+ float xEnd = (Details.centre ? Details.centreSize : Details.wrapX);
+#endif
while(*s){
- if(x + GetStringWidth(s) > (Details.centre ? Details.centreSize : Details.wrapX)){
+ if(x + GetStringWidth(s) > xEnd){
// reached end of line
if(x > maxlength)
maxlength = x;