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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intcomputeOff(int pixel) getIndex(int pixel) Get the index of the layout at the given positionintgetPixel(BigInteger index) Get the top of the layout with the given indexvoidlayoutsChanged(List<AnchoredLayout> layouts)
-
Constructor Details
-
VerticalLayoutPixelIndexMap
public VerticalLayoutPixelIndexMap()
-
-
Method Details
-
getPixel
Description copied from interface:LayoutPixelIndexMapGet 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:
getPixelin 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:LayoutPixelIndexMapGet 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:
getIndexin interfaceLayoutPixelIndexMap- Parameters:
pixel- the vertical position of the pixel, relative to the main panel's viewport- Returns:
- the index of the layout
-
layoutsChanged
-