Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/rendering/StarTextPainter.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-06-29 02:42:05 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-06-29 02:42:05 +1000
commita78102c2a949ec979778cd7ed160a283a959a9d4 (patch)
tree98d44b6fd09e27ac3b7c6ad143b32a190b2ec42c /source/rendering/StarTextPainter.cpp
parent306494bd2d84625971f81167daf41a3d93018f46 (diff)
Update StarTextPainter.cpp
Diffstat (limited to 'source/rendering/StarTextPainter.cpp')
-rw-r--r--source/rendering/StarTextPainter.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/rendering/StarTextPainter.cpp b/source/rendering/StarTextPainter.cpp
index d6bb9be..b7526bb 100644
--- a/source/rendering/StarTextPainter.cpp
+++ b/source/rendering/StarTextPainter.cpp
@@ -502,7 +502,7 @@ RectF TextPainter::doRenderLine(StringView text, TextPositioning const& position
pos.hAnchor = HorizontalAnchor::LeftAnchor;
} else if (pos.hAnchor == HorizontalAnchor::HMidAnchor) {
StringView trimmedString = charLimit ? text.substr(0, *charLimit) : text;
- pos.pos[0] -= std::floorf((float)stringWidth(trimmedString) / 2);
+ pos.pos[0] -= floor((float)stringWidth(trimmedString) / 2);
pos.hAnchor = HorizontalAnchor::LeftAnchor;
}
@@ -545,11 +545,11 @@ RectF TextPainter::doRenderGlyph(String::Char c, TextPositioning const& position
if (position.hAnchor == HorizontalAnchor::RightAnchor)
hOffset = -width;
else if (position.hAnchor == HorizontalAnchor::HMidAnchor)
- hOffset = -std::floorf((float)width / 2);
+ hOffset = -floor((float)width / 2);
float vOffset = 0;
if (position.vAnchor == VerticalAnchor::VMidAnchor)
- vOffset = -std::floorf((float)m_fontSize / 2);
+ vOffset = -floor((float)m_fontSize / 2);
else if (position.vAnchor == VerticalAnchor::TopAnchor)
vOffset = -(float)m_fontSize;