MCPcopy Create free account
hub / github.com/dillo-browser/dillo / initLine1Offset

Method initLine1Offset

dw/textblock_linebreaking.cc:1750–1776  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1748}
1749
1750void Textblock::initLine1Offset (int wordIndex)
1751{
1752 Word *word = words->getRef (wordIndex);
1753
1754 /* Test whether line1Offset can be used. */
1755 if (wordIndex == 0) {
1756 if (ignoreLine1OffsetSometimes &&
1757 line1Offset + word->size.width > lineBreakWidth) {
1758 line1OffsetEff = 0;
1759 } else {
1760 int indent = 0;
1761
1762 if (word->content.type == core::Content::WIDGET_IN_FLOW &&
1763 word->content.widget->isBlockLevel()) {
1764 /* don't use text-indent when nesting blocks */
1765 } else {
1766 if (core::style::isPerLength(getStyle()->textIndent)) {
1767 indent = core::style::multiplyWithPerLengthRounded
1768 (lineBreakWidth, getStyle()->textIndent);
1769 } else {
1770 indent = core::style::absLengthVal (getStyle()->textIndent);
1771 }
1772 }
1773 line1OffsetEff = line1Offset + indent;
1774 }
1775 }
1776}
1777
1778/**
1779 * Align the line.

Callers

nothing calls this directly

Calls 6

isPerLengthFunction · 0.85
getStyleFunction · 0.85
absLengthValFunction · 0.85
getRefMethod · 0.45
isBlockLevelMethod · 0.45

Tested by

no test coverage detected