[wesnoth-commits] [wesnoth/wesnoth] 0e013c: font/sdl_ttf_compat: Don't set fg colour if we are...

Iris Morelle noreply at github.com
Sat Mar 13 22:57:30 UTC 2021


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 0e013c59b6ff83ae018889b8afdaaa7d1ce431a8
      https://github.com/wesnoth/wesnoth/commit/0e013c59b6ff83ae018889b8afdaaa7d1ce431a8
  Author: Iris Morelle <shadowm at wesnoth.org>
  Date:   2021-03-13 (Sat, 13 Mar 2021)

  Changed paths:
    M src/font/sdl_ttf_compat.cpp

  Log Message:
  -----------
  font/sdl_ttf_compat: Don't set fg colour if we aren't rendering


  Commit: 995bfef3df708cf6e8fb94109d9a2469e9c26166
      https://github.com/wesnoth/wesnoth/commit/995bfef3df708cf6e8fb94109d9a2469e9c26166
  Author: Iris Morelle <shadowm at wesnoth.org>
  Date:   2021-03-13 (Sat, 13 Mar 2021)

  Changed paths:
    M src/font/sdl_ttf_compat.cpp

  Log Message:
  -----------
  font/sdl_ttf_compat: Avoid rendering twice in pango_draw_text()

We need to obtain the text extents prior to rendering regardless. In the
best case, we do so in advance before rendering, which internally
doesn't recalculate the text layout if the rendering parameters haven't
been touched in the meantime. In the worst case, we calculate extents
twice but only render once.


Compare: https://github.com/wesnoth/wesnoth/compare/49094526c254...995bfef3df70



More information about the Commits mailing list