Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ public Font getFont(FontData fontData, int zoom) {
}

private Font registerFont(FontData fontData, Font font) {
fontsMap.put(fontData, font);
FontData clonedFontData = new FontData(fontData.toString());
fontsMap.put(clonedFontData, font);
return font;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,9 @@ public Font getFont(FontData fontData, int zoom) {
if (customFontsKeyMap.containsKey(fontData)) {
container = customFontsKeyMap.get(fontData);
} else {
container = new ScaledCustomFontContainer(fontData);
customFontsKeyMap.put(fontData, container);
FontData clonedFontData = new FontData(fontData.toString());
container = new ScaledCustomFontContainer(clonedFontData);
customFontsKeyMap.put(clonedFontData, container);
}
return container.getScaledFont(zoom);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public void test_ConstructorLjava_lang_String() {
FontData fd = new FontData(SwtTestUtil.testFontName, 10, SWT.NORMAL);
FontData reconstructedFontData = new FontData(fd.toString());
assertEquals(fd, reconstructedFontData);
assertEquals(fd.hashCode(), reconstructedFontData.hashCode());
}

@Test
Expand Down
Loading