<commit_before>#include "textdraw.hpp"
#include "../glx.hpp"
#include "../sys_uniform_value.hpp"
#include "../gameloophelper.hpp"

namespace rs {
	namespace util {
		// ---------------------- TextHUD ----------------------
		const IdValue TextHUD::U_Text = GLEffect::GlxId::GenUnifId("mText");
		TextHUD::TextHUD(IdValue idTech):
			Text(idTech),
			_coordType(Coord::Window),
			_offset(0),
			_scale(1),
			_depth(1)
		{}
		spn::Mat33 TextHUD::_makeMatrix() const {
			float rx, ry,
				  ox, oy,
				  diry;
			auto lkb = sharedbase.lock();
			auto s = lkb->screenSize;
			rx = spn::Rcp22Bit(s.width/2);
			ry = spn::Rcp22Bit(s.height/2);
			if(_coordType == Coord::Window) {
				ox = -1.f;
				oy = 1.f;
				diry = -1.f;
			} else {
				ox = oy = 0.f;
				diry = 1.f;
			}
			auto& ofs = _offset;
			return spn::Mat33(rx*_scale.x,		0,						0,
							0,					ry*_scale.y,			0,
							ox + ofs.x*rx,		oy + ofs.y*ry*diry,		1);
		}
		void TextHUD::setWindowOffset(const spn::Vec2& ofs) {
			_coordType = Coord::Window;
			_offset = ofs;
		}<commit_msg>TextHUD: スケーリングの修正<commit_after>#include "textdraw.hpp"
#include "../glx.hpp"
#include "../sys_uniform_value.hpp"
#include "../gameloophelper.hpp"

namespace rs {
	namespace util {
		// ---------------------- TextHUD ----------------------
		const IdValue TextHUD::U_Text = GLEffect::GlxId::GenUnifId("mText");
		TextHUD::TextHUD(IdValue idTech):
			Text(idTech),
			_coordType(Coord::Window),
			_offset(0),
			_scale(1),
			_depth(1)
		{}
		spn::Mat33 TextHUD::_makeMatrix() const {
			float rx, ry,
				  ox, oy,
				  diry;
			auto lkb = sharedbase.lock();
			auto s = lkb->screenSize;
			rx = spn::Rcp22Bit(s.width/2);
			ry = spn::Rcp22Bit(s.height/2);
			auto ofs = _offset;
			if(_coordType == Coord::Window) {
				ox = -1.f;
				oy = 1.f;
				diry = -1.f;
				ofs.x *= rx;
				ofs.y *= ry;
			} else {
				ox = oy = 0.f;
				diry = 1.f;
			}
			return spn::Mat33(rx*_scale.x,		0,						0,
							0,					ry*_scale.y,			0,
							ox + ofs.x,			oy + ofs.y*diry,		1);
		}
		void TextHUD::setWindowOffset(const spn::Vec2& ofs) {
			_coordType = Coord::Window;
			_offset = ofs;
		}
{'fraction_non_alphanumeric': 0.2079625292740047, 'fraction_numerical': 0.022482435597189696, 'mean_word_length': 2.2912172573189524, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6912813', 'n_tokens_mistral': 1096, 'n_tokens_neox': 900, 'n_words': 165}