Changeset View
Changeset View
Standalone View
Standalone View
source/gui/CGUIText.cpp
Show First 20 Lines • Show All 424 Lines • ▼ Show 20 Lines | if (j == static_cast<int>(string.m_Words.size()) - 2) | ||||
done = true; | done = true; | ||||
} | } | ||||
return done; | return done; | ||||
} | } | ||||
void CGUIText::Draw(CGUI& pGUI, CCanvas2D& canvas, const CGUIColor& DefaultColor, const CVector2D& pos, CRect clipping) const | void CGUIText::Draw(CGUI& pGUI, CCanvas2D& canvas, const CGUIColor& DefaultColor, const CVector2D& pos, CRect clipping) const | ||||
{ | { | ||||
OGL_SCOPED_DEBUG_GROUP("Draw GUI text"); | |||||
vladislavbelov: I'd prefer single name macro instead of duplicating. And the `group` word is too common and… | |||||
vladislavbelovUnsubmitted Not Done Inline ActionsShould be removed, the GUI code shouldn't have GL related stuff. The same for other GUI changes. vladislavbelov: Should be removed, the GUI code shouldn't have GL related stuff. The same for other GUI changes. | |||||
bool isClipped = clipping != CRect(); | bool isClipped = clipping != CRect(); | ||||
if (isClipped) | if (isClipped) | ||||
{ | { | ||||
// Make clipping rect as small as possible to prevent rounding errors | // Make clipping rect as small as possible to prevent rounding errors | ||||
clipping.top = std::ceil(clipping.top); | clipping.top = std::ceil(clipping.top); | ||||
clipping.bottom = std::floor(clipping.bottom); | clipping.bottom = std::floor(clipping.bottom); | ||||
clipping.left = std::ceil(clipping.left); | clipping.left = std::ceil(clipping.left); | ||||
clipping.right = std::floor(clipping.right); | clipping.right = std::floor(clipping.right); | ||||
Show All 33 Lines |
Wildfire Games · Phabricator
I'd prefer single name macro instead of duplicating. And the group word is too common and might be used in the code.