diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/BitFieldPlacementComponent.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/BitFieldPlacementComponent.java index 34bccd9cff..0c8e094bf3 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/BitFieldPlacementComponent.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/BitFieldPlacementComponent.java @@ -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