Merge branch 'master' into jgrpp
# Conflicts: # media/baseset/CMakeLists.txt # src/build_vehicle_gui.cpp # src/console.cpp # src/debug.cpp # src/fontcache/freetypefontcache.cpp # src/network/network.cpp # src/openttd.cpp # src/os/macosx/font_osx.cpp # src/os/windows/font_win32.cpp # src/settings_gui.cpp # src/video/sdl2_v.cpp # src/widgets/settings_widget.h # src/window_gui.h
This commit is contained in:
14
src/gfx.cpp
14
src/gfx.cpp
@@ -600,6 +600,8 @@ static int DrawLayoutLine(const ParagraphLayouter::Line &line, int y, int left,
|
||||
bool draw_shadow = false;
|
||||
for (int run_index = 0; run_index < line.CountRuns(); run_index++) {
|
||||
const ParagraphLayouter::VisualRun &run = line.GetVisualRun(run_index);
|
||||
const auto &glyphs = run.GetGlyphs();
|
||||
const auto &positions = run.GetPositions();
|
||||
const Font *f = run.GetFont();
|
||||
|
||||
FontCache *fc = f->fc;
|
||||
@@ -613,14 +615,14 @@ static int DrawLayoutLine(const ParagraphLayouter::Line &line, int y, int left,
|
||||
draw_shadow = fc->GetDrawGlyphShadow() && (colour & TC_NO_SHADE) == 0 && (colour & ~TC_FORCED) != TC_BLACK;
|
||||
|
||||
for (int i = 0; i < run.GetGlyphCount(); i++) {
|
||||
GlyphID glyph = run.GetGlyphs()[i];
|
||||
GlyphID glyph = glyphs[i];
|
||||
|
||||
/* Not a valid glyph (empty) */
|
||||
if (glyph == 0xFFFF) continue;
|
||||
|
||||
int begin_x = (int)run.GetPositions()[i * 2] + left - offset_x;
|
||||
int end_x = (int)run.GetPositions()[i * 2 + 2] + left - offset_x - 1;
|
||||
int top = (int)run.GetPositions()[i * 2 + 1] + y;
|
||||
int begin_x = (int)positions[i * 2] + left - offset_x;
|
||||
int end_x = (int)positions[i * 2 + 2] + left - offset_x - 1;
|
||||
int top = (int)positions[i * 2 + 1] + y;
|
||||
|
||||
/* Truncated away. */
|
||||
if (truncation && (begin_x < min_x || end_x > max_x)) continue;
|
||||
@@ -2131,6 +2133,10 @@ bool ToggleFullScreen(bool fs)
|
||||
void SortResolutions()
|
||||
{
|
||||
std::sort(_resolutions.begin(), _resolutions.end());
|
||||
|
||||
/* Remove any duplicates from the list. */
|
||||
auto last = std::unique(_resolutions.begin(), _resolutions.end());
|
||||
_resolutions.erase(last, _resolutions.end());
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user