mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 19:42:36 +02:00
GT-3238 corrected bitfield component scroll unit/block increment
This commit is contained in:
parent
03b0625a75
commit
e52a4a3ffa
1 changed files with 28 additions and 1 deletions
|
@ -30,7 +30,7 @@ import ghidra.util.exception.AssertException;
|
|||
import ghidra.util.layout.VerticalLayout;
|
||||
import resources.icons.ColorIcon;
|
||||
|
||||
public class BitFieldPlacementComponent extends JPanel {
|
||||
public class BitFieldPlacementComponent extends JPanel implements Scrollable {
|
||||
|
||||
private static final int CELL_HEIGHT = 25;
|
||||
private static final int ZERO_BIT_WIDTH = 3;
|
||||
|
@ -145,6 +145,33 @@ public class BitFieldPlacementComponent extends JPanel {
|
|||
init(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getPreferredScrollableViewportSize() {
|
||||
return getPreferredSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) {
|
||||
// NOTE: consider forcing visibleRect edge alignment to byte boundary based upon direction
|
||||
return byteWidth;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction) {
|
||||
// NOTE: consider forcing visibleRect edge alignment to byte boundary based upon direction
|
||||
return visibleRect.width;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getScrollableTracksViewportWidth() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getScrollableTracksViewportHeight() {
|
||||
return true;
|
||||
}
|
||||
|
||||
private class MyMouseWheelListener implements MouseWheelListener {
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue