mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-06-02 18:26:53 +08:00
Fixed bug introduced by GP-6178
This commit is contained in:
@@ -1924,7 +1924,7 @@ public class FieldPanel extends JPanel
|
||||
// if the mouse is to the right of the last field, make the selection
|
||||
// include the last field
|
||||
Layout layout = getLayoutModel().getLayout(selectionEnd.getIndex());
|
||||
int width = layout.getCompressableWidth();
|
||||
int width = layout.getWidth();
|
||||
if (x > width) {
|
||||
selectionEnd =
|
||||
new FieldLocation(selectionEnd.getIndex().add(BigInteger.ONE));
|
||||
|
||||
@@ -185,6 +185,11 @@ public interface Layout {
|
||||
|
||||
int getEndRowFieldNum(int field2);
|
||||
|
||||
/**
|
||||
* {@Returns the actual width of the layout}
|
||||
*/
|
||||
int getWidth();
|
||||
|
||||
/**
|
||||
* Returns the smallest possible width of this layout that can display its full contents
|
||||
* @return the smallest possible width of this layout that can display its full contents
|
||||
|
||||
+5
@@ -70,6 +70,11 @@ public class AnchoredLayout implements Layout {
|
||||
return layout.getHeight();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWidth() {
|
||||
return layout.getWidth();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCompressableWidth() {
|
||||
return layout.getCompressableWidth();
|
||||
|
||||
+9
@@ -83,6 +83,15 @@ public class MultiRowLayout implements Layout {
|
||||
return heightAbove + heightBelow;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWidth() {
|
||||
int max = 0;
|
||||
for (Layout layout : layouts) {
|
||||
max = Math.max(max, layout.getWidth());
|
||||
}
|
||||
return max;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCompressableWidth() {
|
||||
//
|
||||
|
||||
+13
@@ -67,6 +67,19 @@ public class RowLayout implements Layout {
|
||||
return heightAbove + heightBelow;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWidth() {
|
||||
int startX = fields[0].getStartX();
|
||||
int rowWidth = startX;
|
||||
|
||||
for (int i = 0; i < fields.length; i++) {
|
||||
Field field = fields[i];
|
||||
int width = field.getWidth(); // layout manager width
|
||||
rowWidth += width;
|
||||
}
|
||||
return rowWidth;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCompressableWidth() {
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user