MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / adjustSize

Method adjustSize

examples/triage/byte.cpp:225–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

223
224
225void ByteView::adjustSize(int width, int height)
226{
227 m_render.setFont(getFont());
228
229 m_addrWidth = QString::number(m_data->GetEnd(), 16).size();
230 if (m_addrWidth < 8)
231 m_addrWidth = 8;
232 int cols = ((width - 4) / m_render.getFontWidth()) - ((int)m_addrWidth + 2);
233 if (cols < 1)
234 cols = 1;
235 if ((size_t)cols != m_cols)
236 {
237 m_cols = (size_t)cols;
238 if (m_topLine < m_lines.size())
239 setTopToAddress(m_lines[m_topLine].address);
240 else
241 setTopToAddress(m_cursorAddr);
242 refreshLines();
243 }
244 m_visibleRows = (size_t)((height - 4) / m_render.getFontHeight());
245 verticalScrollBar()->setPageStep((int)(m_visibleRows * m_cols / m_scrollBarMultiplier));
246 refreshAtCurrentLocation();
247 viewport()->update();
248}
249
250
251uint64_t ByteView::getContiguousOffsetForAddress(uint64_t addr)

Callers

nothing calls this directly

Calls 5

viewportFunction · 0.85
getFontFunction · 0.50
sizeMethod · 0.45
GetEndMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected