MCPcopy Create free account
hub / github.com/NanoMichael/MicroTeX / getBreakPosition

Method getBreakPosition

src/core/core.cpp:161–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159}
160
161int BoxSplitter::getBreakPosition(const sptr<HorizontalBox>& hb, int i) {
162 if (hb->_breakPositions.empty()) return -1;
163
164 if (hb->_breakPositions.size() == 1 && hb->_breakPositions[0] <= i)
165 return hb->_breakPositions[0];
166
167 size_t pos = 0;
168 for (; pos < hb->_breakPositions.size(); pos++) {
169 if (hb->_breakPositions[pos] > i) {
170 if (pos == 0) return -1;
171 return hb->_breakPositions[pos - 1];
172 }
173 }
174
175 return hb->_breakPositions[pos - 1];
176}
177
178/************************************* TeXEnvironment implementation ******************************/
179

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected