Skip to content

Commit

Permalink
Fixes: eclipse-platform#677 A new
Browse files Browse the repository at this point in the history
function named as getInset() is created in Table.java.This function
calculates the inset value of a cell in a table for aarch64
architecture. The inset value of a row in a table is calculated by
subtracting the height of a cell from a frame.This calculated inset
value is added to the height in setItemHeight() function.The inset value
of 1 is retained for x86_64 architecture.
  • Loading branch information
elsazac committed Aug 18, 2023
1 parent 0cc66f1 commit 29535b9
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1218,6 +1218,16 @@ void drawInteriorWithFrame_inView (long id, long sel, NSRect rect, long view) {
}
}

int getInset() {
if (OS.IS_X86_64) return 1;

NSTableView widget = (NSTableView) this.view;
NSSize contentSize = super.cellSize(dataCell.id, OS.sel_cellSize);
NSRect cellRect = widget.frameOfCellAtColumn(0, 0);
int inset = ((int) ((cellRect.height - contentSize.height)));
return inset;
}

@Override
void drawWithExpansionFrame_inView (long id, long sel, NSRect cellFrame, long view) {
drawExpansion = true;
Expand Down Expand Up @@ -2823,7 +2833,7 @@ void setItemHeight (Image image, NSFont font, boolean set) {
if (font == null) font = getFont ().handle;
double ascent = font.ascender ();
double descent = -font.descender () + font.leading ();
int height = (int)Math.ceil (ascent + descent) + 1;
int height = (int)Math.ceil (ascent + descent) + getInset();
Rectangle bounds = image != null ? image.getBounds () : imageBounds;
if (bounds != null) {
imageBounds = bounds;
Expand Down

0 comments on commit 29535b9

Please sign in to comment.