MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / InputWidget_GetLastCol

Function InputWidget_GetLastCol

src/Widgets.c:1145–1159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1143}
1144
1145static char InputWidget_GetLastCol(struct InputWidget* w, int x, int y) {
1146 cc_string line; char lineBuffer[STRING_SIZE];
1147 char col;
1148 String_InitArray(line, lineBuffer);
1149
1150 for (; y >= 0; y--) {
1151 line.length = 0;
1152 InputWidget_FormatLine(w, y, &line);
1153
1154 col = Drawer2D_LastColor(&line, x);
1155 if (col) return col;
1156 if (y > 0) { x = w->lines[y - 1].length; }
1157 }
1158 return '\0';
1159}
1160
1161static void InputWidget_UpdateCaret(struct InputWidget* w) {
1162 static const cc_string caret = String_FromConst("_");

Callers 2

InputWidget_UpdateCaretFunction · 0.85

Calls 2

InputWidget_FormatLineFunction · 0.85
Drawer2D_LastColorFunction · 0.85

Tested by

no test coverage detected