Skip to content

Commit

Permalink
Merge pull request #360 from gucio321/style-push-font
Browse files Browse the repository at this point in the history
style setter: fix bug, when pushing nil font caused crash
  • Loading branch information
AllenDang authored Sep 29, 2021
2 parents 04dbf3c + 35987fc commit 8e33d03
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Style.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@ import (
// NOTE: PopFont has to be called
// NOTE: Don't use PushFont. use StyleSetter instead
func PushFont(font *FontInfo) bool {
if font == nil {
return false
}

if f, ok := extraFontMap[font.String()]; ok {
imgui.PushFont(*f)
return true
}

return false
}

Expand Down

0 comments on commit 8e33d03

Please sign in to comment.