Skip to content

Commit

Permalink
Merge pull request #791 from AllenDang/fix-panic-and-font-alats
Browse files Browse the repository at this point in the history
Fix panic and font alats
  • Loading branch information
AllenDang authored May 3, 2024
2 parents 825a30a + 314daa2 commit d649def
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion FontAtlasProsessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ func (a *FontAtlas) rebuildFontAtlas() {
}

fonts := Context.IO().Fonts()
// fonts.Clear() /// TODO: I'm commenting this out, because it produces panic.
fonts.Clear()

var sb strings.Builder

Expand Down
2 changes: 2 additions & 0 deletions Keycode.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ const (
KeyMenu = Key(imgui.KeyMenu)
KeyWorld1 = Key(imgui.GLFWKeyWorld1)
KeyWorld2 = Key(imgui.GLFWKeyWorld2)
KeyUnknown = Key(-1)
)

// refer glfw3.h.
Expand Down Expand Up @@ -234,6 +235,7 @@ func keyFromGLFWKey(k imgui.GLFWKey) Key {
imgui.GLFWKeyMenu: KeyMenu,
imgui.GLFWKeyWorld1: KeyWorld1,
imgui.GLFWKeyWorld2: KeyWorld2,
-1: KeyUnknown,
}

if v, ok := data[k]; ok {
Expand Down

0 comments on commit d649def

Please sign in to comment.