MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / GetLinePos

Method GetLinePos

Source/CodeEntry.cpp:1269–1283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1267}
1268
1269ofVec2f CodeEntry::GetLinePos(int lineNum, bool end, bool published /*= true*/)
1270{
1271 float x = mX - mScroll.x;
1272 float y = lineNum * mCharHeight + mY - mScroll.y;
1273
1274 if (end)
1275 {
1276 std::string str = published ? mPublishedString : mString;
1277 auto lines = ofSplitString(str, "\n");
1278 if (lineNum < (int)lines.size())
1279 x += lines[lineNum].length() * mCharWidth;
1280 }
1281
1282 return ofVec2f(x, y);
1283}
1284
1285ofVec2f CodeEntry::GetCaretCoords(int caret)
1286{

Callers 4

DrawModuleMethod · 0.80
DrawModuleUnclippedMethod · 0.80
DrawTimerMethod · 0.80
DrawMethod · 0.80

Calls 4

ofSplitStringFunction · 0.85
ofVec2fClass · 0.85
sizeMethod · 0.80
lengthMethod · 0.80

Tested by

no test coverage detected