locationtech / udig-platform

uDig parent project containing all core components. More plugins can be found in community repos: http://github.com/uDig-Community
http://udig.refractions.net
189 stars 133 forks source link

Replace deprecated method with newer method instead #618

Closed sschulz92 closed 2 years ago

sschulz92 commented 2 years ago

This PR will solve the deprecated use of getAverageCharWidth().

Note that I needed to use Math.round() because the newer method is returning a double instead of an int.

Double to int conversion done like this:

(int) Math.round(gc.getFontMetrics().getAverageCharacterWidth())