MCPcopy Create free account
hub / github.com/MyGUI/mygui / setTagColour

Method setTagColour

MyGUIEngine/src/MyGUI_TextIterator.cpp:123–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121 }
122
123 bool TextIterator::setTagColour(const Colour& _colour)
124 {
125 if (mCurrent == mEnd)
126 return false;
127 clearTagColour();
128 if (mCurrent == mEnd)
129 return false;
130
131 const size_t SIZE = 16;
132 wchar_t buff[SIZE];
133
134#ifdef __MINGW32__
135 swprintf(
136 buff,
137 L"#%.2X%.2X%.2X\0",
138 (int)(_colour.red * 255),
139 (int)(_colour.green * 255),
140 (int)(_colour.blue * 255));
141#else
142 swprintf(
143 buff,
144 SIZE,
145 L"#%.2X%.2X%.2X\0",
146 (int)(_colour.red * 255),
147 (int)(_colour.green * 255),
148 (int)(_colour.blue * 255));
149#endif
150 UString tmpStr = UString(buff);
151 insert(mCurrent, tmpStr.asUTF32());
152
153 return true;
154 }
155
156 bool TextIterator::setTagColour(const UString::utf32string& _colour)
157 {

Callers 3

_setTextColourMethod · 0.80
insertTextMethod · 0.80
eraseTextMethod · 0.80

Calls 3

UStringFunction · 0.85
sizeMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected