aAdjust strikethrough offset
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -42,7 +42,8 @@ void TextBlock::render(const GfxRenderer& renderer, const int fontId, const int
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((currentStyle & EpdFontFamily::STRIKETHROUGH) != 0) {
|
if ((currentStyle & EpdFontFamily::STRIKETHROUGH) != 0) {
|
||||||
const int strikeY = y + renderer.getFontAscenderSize(fontId) / 2 + 2;
|
// Arbitrary vertical offset of 4px from the font midline to avoid colliding with typical diacritics; adjust as needed
|
||||||
|
const int strikeY = y + renderer.getFontAscenderSize(fontId) / 2 + 4;
|
||||||
renderer.drawLine(startX, strikeY, startX + lineWidth, strikeY, 2, true);
|
renderer.drawLine(startX, strikeY, startX + lineWidth, strikeY, 2, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -735,7 +735,8 @@ void MdReaderActivity::renderPage() {
|
|||||||
renderer.drawLine(x, underlineY, x + spanWidth, underlineY, 2, true);
|
renderer.drawLine(x, underlineY, x + spanWidth, underlineY, 2, true);
|
||||||
}
|
}
|
||||||
if ((span.style & EpdFontFamily::STRIKETHROUGH) != 0) {
|
if ((span.style & EpdFontFamily::STRIKETHROUGH) != 0) {
|
||||||
const int strikeY = y + renderer.getFontAscenderSize(cachedFontId) / 2 + 2;
|
// Arbitrary vertical offset of 4px from the font midline to avoid colliding with typical diacritics; adjust as needed
|
||||||
|
const int strikeY = y + renderer.getFontAscenderSize(cachedFontId) / 2 + 4;
|
||||||
renderer.drawLine(x, strikeY, x + spanWidth, strikeY, 2, true);
|
renderer.drawLine(x, strikeY, x + spanWidth, strikeY, 2, true);
|
||||||
}
|
}
|
||||||
x += spanWidth;
|
x += spanWidth;
|
||||||
|
|||||||
Reference in New Issue
Block a user