本文整理汇总了C++中RenderStyle::autoRepeatNamedGridColumnLines方法的典型用法代码示例。如果您正苦于以下问题:C++ RenderStyle::autoRepeatNamedGridColumnLines方法的具体用法?C++ RenderStyle::autoRepeatNamedGridColumnLines怎么用?C++ RenderStyle::autoRepeatNamedGridColumnLines使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RenderStyle
的用法示例。
在下文中一共展示了RenderStyle::autoRepeatNamedGridColumnLines方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: isValidNamedLineOrArea
bool NamedLineCollection::isValidNamedLineOrArea(const String& namedLine, const RenderStyle& gridContainerStyle, GridPositionSide side)
{
bool isRowAxis = directionFromSide(side) == ForColumns;
auto& gridLineNames = isRowAxis ? gridContainerStyle.namedGridColumnLines() : gridContainerStyle.namedGridRowLines();
auto& autoRepeatGridLineNames = isRowAxis ? gridContainerStyle.autoRepeatNamedGridColumnLines() : gridContainerStyle.autoRepeatNamedGridRowLines();
if (gridLineNames.contains(namedLine) || autoRepeatGridLineNames.contains(namedLine))
return true;
String implicitName = implicitNamedGridLineForSide(namedLine, side);
return gridLineNames.contains(implicitName) || autoRepeatGridLineNames.contains(implicitName);
}
示例2:
NamedLineCollection::NamedLineCollection(const RenderStyle& gridContainerStyle, const String& namedLine, GridTrackSizingDirection direction, unsigned lastLine, unsigned autoRepeatTracksCount)
: m_lastLine(lastLine)
, m_repetitions(autoRepeatTracksCount)
{
bool isRowAxis = direction == ForColumns;
const NamedGridLinesMap& gridLineNames = isRowAxis ? gridContainerStyle.namedGridColumnLines() : gridContainerStyle.namedGridRowLines();
const NamedGridLinesMap& autoRepeatGridLineNames = isRowAxis ? gridContainerStyle.autoRepeatNamedGridColumnLines() : gridContainerStyle.autoRepeatNamedGridRowLines();
auto linesIterator = gridLineNames.find(namedLine);
m_namedLinesIndexes = linesIterator == gridLineNames.end() ? nullptr : &linesIterator->value;
auto autoRepeatLinesIterator = autoRepeatGridLineNames.find(namedLine);
m_autoRepeatNamedLinesIndexes = autoRepeatLinesIterator == autoRepeatGridLineNames.end() ? nullptr : &autoRepeatLinesIterator->value;
m_insertionPoint = isRowAxis ? gridContainerStyle.gridAutoRepeatColumnsInsertionPoint() : gridContainerStyle.gridAutoRepeatRowsInsertionPoint();
}