Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
X_86_64 the hardcoded inset value was 1.It is retained as such.Since
aarch64 was introduced at a very later time the new table format was
introduced with extra paddings.So the appropriate value to get the same
font would be 8.
  • Loading branch information
elsazac committed Jan 17, 2024
1 parent 3e43811 commit 99d3dc1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ public class List extends Scrollable {

static final int CELL_GAP = 1;

/* Vertical cell padding for list item */
static final int VERTICAL_CELL_PADDING= 8;

/**
* Constructs a new instance of this class given its parent
* and a style value describing its behavior and appearance.
Expand Down Expand Up @@ -1179,7 +1182,7 @@ void setFont (NSFont font) {
super.setFont (font);
double ascent = font.ascender ();
double descent = -font.descender () + font.leading ();
((NSTableView)view).setRowHeight ((int)Math.ceil (ascent + descent) + 1);
((NSTableView)view).setRowHeight ((int)Math.ceil (ascent + descent) + VERTICAL_CELL_PADDING);
setScrollWidth();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ public class Table extends Composite {
static final int TEXT_GAP = 2;
static final int CELL_GAP = 1;

/* Vertical cell padding for table item */
static final int VERTICAL_CELL_PADDING= 8;

/**
* Constructs a new instance of this class given its parent
* and a style value describing its behavior and appearance.
Expand Down Expand Up @@ -2822,7 +2825,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) + VERTICAL_CELL_PADDING;
Rectangle bounds = image != null ? image.getBounds () : imageBounds;
if (bounds != null) {
imageBounds = bounds;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ public class Tree extends Composite {
static final int TEXT_GAP = 2;
static final int CELL_GAP = 1;

/* Vertical cell padding for tree item */
static final int VERTICAL_CELL_PADDING= 8;

/**
* Constructs a new instance of this class given its parent
* and a style value describing its behavior and appearance.
Expand Down Expand Up @@ -3170,7 +3173,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) + VERTICAL_CELL_PADDING;
Rectangle bounds = image != null ? image.getBounds () : imageBounds;
if (bounds != null) {
imageBounds = bounds;
Expand Down

0 comments on commit 99d3dc1

Please sign in to comment.