summaryrefslogtreecommitdiff
path: root/include/JSystem/J2DGraph/J2DTextBox.h
diff options
context:
space:
mode:
authorLagoLunatic <LagoLunatic@users.noreply.github.com>2023-12-02 05:44:43 -0500
committerLagoLunatic <LagoLunatic@users.noreply.github.com>2023-12-02 05:44:43 -0500
commit08feb48be32bc4a8b60980ab621bb071b38517be (patch)
treeb267da32c07d0cd0ceb9322f8be662d3abc9d052 /include/JSystem/J2DGraph/J2DTextBox.h
parent93adecbfb4426e0286af75dc3da2f1324bbecb89 (diff)
f_pc_manager almost matches
Diffstat (limited to 'include/JSystem/J2DGraph/J2DTextBox.h')
-rw-r--r--include/JSystem/J2DGraph/J2DTextBox.h29
1 files changed, 14 insertions, 15 deletions
diff --git a/include/JSystem/J2DGraph/J2DTextBox.h b/include/JSystem/J2DGraph/J2DTextBox.h
index 417a2eb3..f1bec69f 100644
--- a/include/JSystem/J2DGraph/J2DTextBox.h
+++ b/include/JSystem/J2DGraph/J2DTextBox.h
@@ -24,6 +24,11 @@ struct J2DTbxBlockHeader {
class J2DTextBox : public J2DPane {
public:
+ struct TFontSize {
+ /* 0x0 */ f32 mSizeX;
+ /* 0x4 */ f32 mSizeY;
+ };
+
J2DTextBox(const char*, const char*);
J2DTextBox(J2DPane*, JSURandomInputStream*);
J2DTextBox(u32, const JGeometry::TBox2<f32>&, const ResFONT*, const char*, J2DTextBoxHBinding,
@@ -32,21 +37,15 @@ public:
void initiate(const ResFONT*, const char*, J2DTextBoxHBinding, J2DTextBoxVBinding);
void setFont(JUTFont*);
void setFontSize(f32 sizeX, f32 sizeY) {
- f32 x;
- if (sizeX > 0.0f) {
- x = sizeX;
- } else {
- x = 0.0f;
- }
- mFontSizeX = x;
-
- f32 y;
- if (sizeY > 0.0f) {
- y = sizeY;
- } else {
- y = 0.0f;
- }
- mFontSizeY = y;
+ mFontSizeX = sizeX > 0.0f ? sizeX : 0.0f;
+ mFontSizeY = sizeY > 0.0f ? sizeY : 0.0f;
+ }
+ void setFontSize(TFontSize size) {
+ setFontSize(size.mSizeX, size.mSizeY);
+ }
+ void getFontSize(TFontSize& size) const {
+ size.mSizeX = mFontSizeX;
+ size.mSizeY = mFontSizeY;
}
void setCharColor(JUtility::TColor c) { mCharColor = c; }
void setGradColor(JUtility::TColor c) { mGradColor = c; }