Fixed sign flip on shift bug

This commit is contained in:
Willem Cazander 2022-03-14 02:48:35 +01:00
parent c1b75d96ad
commit 38d9a514c8
6 changed files with 18 additions and 70 deletions

View file

@ -24,7 +24,7 @@ import love.distributedrebirth.unicode4d.atlas.FontAtlasStoreGlyph;
public class VrGem4Unicode4DServiceImpl implements VrGem4Unicode4DService {
private final FontAtlas masterFontAtlas;
private final Map<Character, FontAtlasStoreGlyph> unicodeMap;
private final Map<Integer, FontAtlasStoreGlyph> unicodeMap;
@Reference
private SystemGdxLog log;
@ -54,11 +54,11 @@ public class VrGem4Unicode4DServiceImpl implements VrGem4Unicode4DService {
log.info(this, "Master font atlas size: {}", masterFontAtlas.getStores().size());
for (FontAtlasStore fontStore:masterFontAtlas.getStores()) {
log.info(this,"Map unicode: {}", fontStore.getName());
log.info(this,"Map unicode: {} size: {}", fontStore.getName(), fontStore.getGlyphs().size());
for (FontAtlasStoreGlyph glyph: fontStore.getGlyphs()) {
int unicode = CodePointᶻᴰ.INSTANCE.searchUnicode(glyph.getTongs());
if (unicode > 0) {
unicodeMap.put(Character.valueOf((char) unicode), glyph);
unicodeMap.put(unicode, glyph);
}
}
}
@ -76,7 +76,7 @@ public class VrGem4Unicode4DServiceImpl implements VrGem4Unicode4DService {
}
@Override
public FontAtlasStoreGlyph getGlyphForUnicode(char unicode) {
public FontAtlasStoreGlyph getGlyphForUnicode(int unicode) {
return unicodeMap.get(unicode);
}
}

View file

@ -7,5 +7,5 @@ public interface VrGem4Unicode4DService {
FontAtlas getMasterFontAtlas();
FontAtlasStoreGlyph getGlyphForUnicode(char unicode);
FontAtlasStoreGlyph getGlyphForUnicode(int unicode);
}