From c960a59d3b7f561df055a23126bb9306438b0ae7 Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Mon, 21 Sep 2026 21:41:24 +0000 Subject: [PATCH] Match tiInputForm helper methods --- src/keyboard/tiInputForm.cpp | 37 ++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/keyboard/tiInputForm.cpp b/src/keyboard/tiInputForm.cpp index 74507c14..1c054d92 100644 --- a/src/keyboard/tiInputForm.cpp +++ b/src/keyboard/tiInputForm.cpp @@ -1,6 +1,8 @@ #include "keyboard/tiInputForm.h" #include "keyboard/tiManager.h" +#include + namespace textinput { namespace inputform { @@ -79,6 +81,31 @@ void Base::limitStringLength(u32 limitStringLength) { muLimitStringLength = limitStringLength; } +void Base::makeUpCursorPos(CursorPos* cursorPos, u32 pos, s32 startLine, s32 endLine) { + u32 wordWrapCounter = muWordWrapCounter; + muWordWrapCounter = pos; + textdrawer::Base::makeUpCursorPos(cursorPos, pos, startLine, endLine); + muWordWrapCounter = wordWrapCounter; +} + +void Base::setFont(const nw4r::ut::Font& font) { + textdrawer::Base::setFont(font); +} + +void Base::clear() { + static_cast(this)->clearSender(); + mpString->clear(); +} + +nw4r::math::VEC2 Base::getGlobalLeftTopPos() const { + nw4r::math::VEC3 position; + position.x = mRect.left; + position.y = mRect.bottom; + position.z = 0.0f; + PSMTXMultVec(mMtx, position, position); + return nw4r::math::VEC2(position.x, -position.y); +} + void Base::doAfterDrawProcess(const wchar_t*, u32, const DrawInfo&) {} void Base::finishDraw(u32) {} @@ -146,6 +173,16 @@ void LayoutByNW4R::visibleSeparator(bool flag) { unk_0x2C0[0x0E] = flag; } +void LayoutByNW4R::setRootPaneScaleFor16x9() { + nw4rmanager::Layout::setRootPaneScaleFor16x9(); + textdrawer::Base::setAspectRatio(false); +} + +void LayoutByNW4R::setRootPaneScaleFor4x3() { + nw4rmanager::Layout::setRootPaneScaleFor4x3(); + textdrawer::Base::setAspectRatio(true); +} + } } -- 2.49.1