GR: allow setting :titlefontvalign, currently not taken into account

This commit is contained in:
t-bltg 2021-07-03 18:09:07 +02:00
parent 0ca5bc9124
commit 6193607e18

View File

@ -1607,7 +1607,6 @@ end
function gr_add_title(sp, viewport_plotarea, viewport_subplot) function gr_add_title(sp, viewport_plotarea, viewport_subplot)
if sp[:title] != "" if sp[:title] != ""
GR.savestate() GR.savestate()
gr_set_font(titlefont(sp), sp)
loc = sp[:titlelocation] loc = sp[:titlelocation]
if loc == :left if loc == :left
xpos = viewport_plotarea[1] xpos = viewport_plotarea[1]
@ -1619,7 +1618,7 @@ function gr_add_title(sp, viewport_plotarea, viewport_subplot)
xpos = gr_view_xcenter(viewport_plotarea) xpos = gr_view_xcenter(viewport_plotarea)
halign = GR.TEXT_HALIGN_CENTER halign = GR.TEXT_HALIGN_CENTER
end end
GR.settextalign(halign, GR.TEXT_VALIGN_TOP) gr_set_font(titlefont(sp), sp; halign=halign)
gr_text(xpos, viewport_subplot[4], sp[:title]) gr_text(xpos, viewport_subplot[4], sp[:title])
GR.restorestate() GR.restorestate()
end end