Skip to content

Commit

Permalink
Stop using deprecated FontMetrics.getAverageCharWidth
Browse files Browse the repository at this point in the history
  • Loading branch information
akurtakov committed Jun 9, 2024
1 parent 4ea5b98 commit dfa6642
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2006 IBM Corporation and others.
* Copyright (c) 2000, 2024 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -56,7 +56,7 @@ public void fill(Composite parent) {
GC gc = new GC(parent);
gc.setFont(parent.getFont());
FontMetrics fm = gc.getFontMetrics();
widthHint = fm.getAverageCharWidth() * charWidth;
widthHint = (int) (fm.getAverageCharacterWidth() * charWidth);
heightHint = fm.getHeight();
gc.dispose();
}
Expand Down

0 comments on commit dfa6642

Please sign in to comment.