Class VerticalLayoutPixelIndexMap
java.lang.Object
ghidra.app.decompiler.component.margin.VerticalLayoutPixelIndexMap
- All Implemented Interfaces:
LayoutPixelIndexMap
An implementation of
LayoutPixelIndexMap
for vertical coordinates
This class implements getIndex(int)
in log time and getPixel(BigInteger)
in
constant time.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected int
computeOff
(int pixel) getIndex
(int pixel) Get the index of the layout at the given positionint
getPixel
(BigInteger index) Get the top of the layout with the given indexvoid
layoutsChanged
(List<AnchoredLayout> layouts)
-
Constructor Details
-
VerticalLayoutPixelIndexMap
public VerticalLayoutPixelIndexMap()
-
-
Method Details
-
getPixel
Description copied from interface:LayoutPixelIndexMap
Get the top of the layout with the given indexGets the minimum y coordinate of any pixel occupied by the layout having the given index. In essence, this maps from layout index to vertical position, relative to the main panel's viewport. This accounts for scrolling and non-uniform height among the layouts.
- Specified by:
getPixel
in interfaceLayoutPixelIndexMap
- Parameters:
index
- the index of the layout- Returns:
- the top of the layout, relative to the main panel's viewport
-
computeOff
protected int computeOff(int pixel) -
getIndex
Description copied from interface:LayoutPixelIndexMap
Get the index of the layout at the given positionGet the index of the layout occupying the line of pixels in the main panel having the given y coordinate. In essence, this maps from vertical position, relative to the main panel's viewport, to layout index. This accounts for scrolling and non-uniform height among the layouts.
- Specified by:
getIndex
in interfaceLayoutPixelIndexMap
- Parameters:
pixel
- the vertical position of the pixel, relative to the main panel's viewport- Returns:
- the index of the layout
-
layoutsChanged
-