summaryrefslogtreecommitdiffstats
path: root/src/render/Font.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-11-11 09:37:10 +0100
committeraap <aap@papnet.eu>2020-11-11 09:38:33 +0100
commit48d0653331c8b1debc9d985131c9ea31a0e0c97f (patch)
treeaadeefe2bf09efd2dde21fefed5a8cf0ed553518 /src/render/Font.cpp
parentmove stuff into define (diff)
parentMerge pull request #771 from theR4K/miamiDev (diff)
downloadre3-48d0653331c8b1debc9d985131c9ea31a0e0c97f.tar
re3-48d0653331c8b1debc9d985131c9ea31a0e0c97f.tar.gz
re3-48d0653331c8b1debc9d985131c9ea31a0e0c97f.tar.bz2
re3-48d0653331c8b1debc9d985131c9ea31a0e0c97f.tar.lz
re3-48d0653331c8b1debc9d985131c9ea31a0e0c97f.tar.xz
re3-48d0653331c8b1debc9d985131c9ea31a0e0c97f.tar.zst
re3-48d0653331c8b1debc9d985131c9ea31a0e0c97f.zip
Diffstat (limited to 'src/render/Font.cpp')
-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 787a0c40..78a8599e 100644
--- a/src/render/Font.cpp
+++ b/src/render/Font.cpp
@@ -268,8 +268,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();
@@ -646,7 +646,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);
@@ -726,8 +733,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;