1
0
Fork 0

Cleanup: No need to cast `const Font *` to itself. (#11395)

pull/11396/head
Peter Nelson 2023-10-25 14:08:07 +01:00 committed by GitHub
parent 3d7f54472d
commit d19832569e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -521,7 +521,7 @@ static int DrawLayoutLine(const ParagraphLayouter::Line &line, int y, int left,
* another size would be chosen it won't have truncated too little for * another size would be chosen it won't have truncated too little for
* the truncation dots. * the truncation dots.
*/ */
FontCache *fc = ((const Font*)line.GetVisualRun(0).GetFont())->fc; FontCache *fc = line.GetVisualRun(0).GetFont()->fc;
GlyphID dot_glyph = fc->MapCharToGlyph('.'); GlyphID dot_glyph = fc->MapCharToGlyph('.');
dot_width = fc->GetGlyphWidth(dot_glyph); dot_width = fc->GetGlyphWidth(dot_glyph);
dot_sprite = fc->GetGlyph(dot_glyph); dot_sprite = fc->GetGlyph(dot_glyph);
@ -570,7 +570,7 @@ static int DrawLayoutLine(const ParagraphLayouter::Line &line, int y, int left,
bool draw_shadow = false; bool draw_shadow = false;
for (int run_index = 0; run_index < line.CountRuns(); run_index++) { for (int run_index = 0; run_index < line.CountRuns(); run_index++) {
const ParagraphLayouter::VisualRun &run = line.GetVisualRun(run_index); const ParagraphLayouter::VisualRun &run = line.GetVisualRun(run_index);
const Font *f = (const Font*)run.GetFont(); const Font *f = run.GetFont();
FontCache *fc = f->fc; FontCache *fc = f->fc;
colour = f->colour; colour = f->colour;