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

Method adjustSize

python/examples/triage/byte.py:222–238  ·  view source on GitHub ↗
(self, width, height)

Source from the content-addressed store, hash-verified

220 return render
221
222 def adjustSize(self, width, height):
223 self.addrWidth = max(len("%x" % self.data.end), 8)
224 render = self.createRenderContext()
225 cols = ((width - 4) // render.getFontWidth()) - (self.addrWidth + 2)
226 if cols < 1:
227 cols = 1
228 if cols != self.cols:
229 self.cols = cols
230 if self.topLine < len(self.lines):
231 self.setTopToAddress(self.lines[self.topLine].address)
232 else:
233 self.setTopToAddress(self.cursorAddr)
234 self.refreshLines()
235 self.visibleRows = (height - 4) // render.getFontHeight()
236 self.verticalScrollBar().setPageStep(self.visibleRows * self.cols // self.scrollBarMultiplier)
237 self.refreshAtCurrentLocation()
238 self.viewport().update()
239
240 def getContiguousOffsetForAddress(self, addr):
241 offset = 0

Callers 4

__init__Method · 0.95
updateFontsMethod · 0.95
resizeEventMethod · 0.95
__init__Method · 0.45

Calls 5

createRenderContextMethod · 0.95
setTopToAddressMethod · 0.95
refreshLinesMethod · 0.95
updateMethod · 0.45

Tested by

no test coverage detected