Skip to content

Ghidra is a software reverse engineering (SRE) framework

Merge remote-tracking branch 'origin/patch'

ghidra10f09cedffd6a
diff --cc Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/BitFieldPlacementComponent.java
index 38d786f9ac,122c21b825..9eb469c3a1
--- 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
@@@ -418,11 -371,8 +418,11 @@@ public class BitFieldPlacementComponen
repaint();
}
- void applyBitField(DataType baseDataType, String fieldName, boolean deleteConflicts,
- CompositeChangeListener listener) {
+ void applyBitField(DataType baseDataType, String fieldName, String fieldComment,
+ boolean deleteConflicts, CompositeChangeListener listener) {
+ if (!editUseEnabled) {
+ throw new IllegalStateException("component not constructed for edit use");
+ }
if (composite == null) {
throw new IllegalStateException("Composite not loaded");
}
@@@ -686,12 -652,14 +688,15 @@@
DataTypeComponent prevDtc = null;
BitAttributes prevAttrs = null;
- // start close to the left clip bounds
- Rectangle clipBounds = g.getClipBounds();
- int maxX = clipBounds.x + clipBounds.width - 1;
+ // Limit rendered bits to those contained within the visible view port
+ // of this scrolled component.
+
+ JViewport viewPort = (JViewport) getParent();
+ Rectangle bounds = viewPort.getViewRect();
+ int maxX = bounds.x + bounds.width - 1;
int width = bitAttributes[0].rectangle.width;
- int startIndex = (clipBounds.x / (bitAttributes[0].rectangle.width)) -
- int startIndex = bounds.x / (bitAttributes[0].rectangle.width);
++ int startIndex = (bounds.x / (bitAttributes[0].rectangle.width)) -
+ (8 * bitFieldAllocation.leftChopBytes);
x += startIndex * width;
int bitIndex;