本文整理汇总了C++中contentWidth函数的典型用法代码示例。如果您正苦于以下问题:C++ contentWidth函数的具体用法?C++ contentWidth怎么用?C++ contentWidth使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了contentWidth函数的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: writeItemToContentMap
//------------------------------------------------------------------------------//
bool InventoryReceiver::addItemAtLocation(InventoryItem& item, int x, int y)
{
if (itemWillFitAtLocation(item, x, y))
{
InventoryReceiver* old_receiver =
dynamic_cast<InventoryReceiver*>(item.getParent());
if (old_receiver)
old_receiver->removeItem(item);
item.setLocationOnReceiver(x, y);
writeItemToContentMap(item);
addChild(&item);
// set position and size. This ensures the items visually match the
// logical content map.
item.setPosition(UVector2(UDim(static_cast<float>(x) / contentWidth(), 0),
UDim(static_cast<float>(y) / contentHeight(), 0)));
item.setSize(USize(
UDim(static_cast<float>(item.contentWidth()) / contentWidth(), 0),
UDim(static_cast<float>(item.contentHeight()) / contentHeight(), 0)));
return true;
}
return false;
}
开发者ID:AjaxWang1989,项目名称:cegui,代码行数:30,代码来源:InventoryReceiver.cpp
示例2: contentWidth
void RenderSnapshottedPlugIn::paintSnapshot(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
Image* image = m_snapshotResource->image().get();
if (!image || image->isNull())
return;
LayoutUnit cWidth = contentWidth();
LayoutUnit cHeight = contentHeight();
if (!cWidth || !cHeight)
return;
GraphicsContext& context = paintInfo.context();
LayoutSize contentSize(cWidth, cHeight);
LayoutPoint contentLocation = location() + paintOffset;
contentLocation.move(borderLeft() + paddingLeft(), borderTop() + paddingTop());
LayoutRect rect(contentLocation, contentSize);
IntRect alignedRect = snappedIntRect(rect);
if (alignedRect.width() <= 0 || alignedRect.height() <= 0)
return;
bool useLowQualityScaling = shouldPaintAtLowQuality(context, *image, image, alignedRect.size());
ImageOrientationDescription orientationDescription(shouldRespectImageOrientation());
#if ENABLE(CSS_IMAGE_ORIENTATION)
orientationDescription.setImageOrientationEnum(style().imageOrientation());
#endif
context.drawImage(*image, alignedRect, ImagePaintingOptions(orientationDescription, useLowQualityScaling));
}
开发者ID:valbok,项目名称:WebKitForWayland,代码行数:30,代码来源:RenderSnapshottedPlugIn.cpp
示例3: contentWidth
void RenderSnapshottedPlugIn::paintSnapshot(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
Image* image = m_snapshotResource->image().get();
if (!image || image->isNull())
return;
LayoutUnit cWidth = contentWidth();
LayoutUnit cHeight = contentHeight();
if (!cWidth || !cHeight)
return;
GraphicsContext& context = paintInfo.context();
LayoutSize contentSize(cWidth, cHeight);
LayoutPoint contentLocation = location() + paintOffset;
contentLocation.move(borderLeft() + paddingLeft(), borderTop() + paddingTop());
LayoutRect rect(contentLocation, contentSize);
IntRect alignedRect = snappedIntRect(rect);
if (alignedRect.width() <= 0 || alignedRect.height() <= 0)
return;
InterpolationQuality interpolation = chooseInterpolationQuality(context, *image, image, alignedRect.size());
ImageOrientationDescription orientationDescription(shouldRespectImageOrientation(), style().imageOrientation());
context.drawImage(*image, alignedRect, ImagePaintingOptions(orientationDescription, interpolation));
}
开发者ID:edcwconan,项目名称:webkit,代码行数:26,代码来源:RenderSnapshottedPlugIn.cpp
示例4: contentWidth
QImage RoundButton::prepareRippleMask() const {
auto innerWidth = contentWidth();
auto rounded = rtlrect(rect().marginsRemoved(_st.padding), width());
if (_fullWidthOverride < 0) {
rounded = QRect(0, rounded.top(), innerWidth - _fullWidthOverride, rounded.height());
}
return RippleAnimation::roundRectMask(rounded.size(), st::buttonRadius);
}
开发者ID:Igevorse,项目名称:tdesktop,代码行数:8,代码来源:buttons.cpp
示例5: ASSERT
LayoutUnit RenderRegion::logicalHeightOfAllFlowThreadContent() const
{
ASSERT(m_flowThread);
if (hasOverrideHeight() && !m_flowThread->inConstrainedLayoutPhase()) {
ASSERT(hasAutoLogicalHeight());
return overrideLogicalContentHeight();
}
return m_flowThread->isHorizontalWritingMode() ? contentHeight() : contentWidth();
}
开发者ID:Channely,项目名称:know-your-chrome,代码行数:9,代码来源:RenderRegion.cpp
示例6: ASSERT
LayoutUnit RenderNamedFlowFragment::pageLogicalHeight() const
{
ASSERT(isValid());
if (hasComputedAutoHeight() && m_flowThread->inMeasureContentLayoutPhase()) {
ASSERT(hasAutoLogicalHeight());
return computedAutoHeight();
}
return m_flowThread->isHorizontalWritingMode() ? contentHeight() : contentWidth();
}
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:9,代码来源:RenderNamedFlowFragment.cpp
示例7: ASSERT
LayoutUnit RenderRegion::pageLogicalHeight() const
{
ASSERT(m_flowThread);
if (hasComputedAutoHeight() && !m_flowThread->inConstrainedLayoutPhase()) {
ASSERT(hasAutoLogicalHeight());
return computedAutoHeight();
}
return m_flowThread->isHorizontalWritingMode() ? contentHeight() : contentWidth();
}
开发者ID:IllusionRom-deprecated,项目名称:android_platform_external_chromium_org_third_party_WebKit,代码行数:9,代码来源:RenderRegion.cpp
示例8: toSVGSVGElement
// LayoutBox methods will expect coordinates w/o any transforms in coordinates
// relative to our borderBox origin. This method gives us exactly that.
void LayoutSVGRoot::buildLocalToBorderBoxTransform()
{
SVGSVGElement* svg = toSVGSVGElement(node());
ASSERT(svg);
float scale = style()->effectiveZoom();
FloatPoint translate = svg->currentTranslate();
LayoutSize borderAndPadding(borderLeft() + paddingLeft(), borderTop() + paddingTop());
m_localToBorderBoxTransform = svg->viewBoxToViewTransform(contentWidth() / scale, contentHeight() / scale);
AffineTransform viewToBorderBoxTransform(scale, 0, 0, scale, borderAndPadding.width() + translate.x(), borderAndPadding.height() + translate.y());
m_localToBorderBoxTransform.preMultiply(viewToBorderBoxTransform);
}
开发者ID:mtucker6784,项目名称:chromium,代码行数:14,代码来源:LayoutSVGRoot.cpp
示例9: toRenderBox
RenderObject* RenderTextControlMultiLine::layoutSpecialExcludedChild(bool relayoutChildren)
{
RenderObject* placeholderRenderer = RenderTextControl::layoutSpecialExcludedChild(relayoutChildren);
if (!placeholderRenderer)
return 0;
if (!placeholderRenderer->isBox())
return placeholderRenderer;
RenderBox* placeholderBox = toRenderBox(placeholderRenderer);
placeholderBox->style()->setWidth(Length(contentWidth() - placeholderBox->borderAndPaddingWidth(), Fixed));
placeholderBox->layoutIfNeeded();
placeholderBox->setX(borderLeft() + paddingLeft());
placeholderBox->setY(borderTop() + paddingTop());
return placeholderRenderer;
}
开发者ID:Moondee,项目名称:Artemis,代码行数:14,代码来源:RenderTextControlMultiLine.cpp
示例10: layout
void RenderRegion::layout()
{
RenderReplaced::layout();
if (m_flowThread && isValid()) {
if (regionRect().width() != contentWidth() || regionRect().height() != contentHeight())
m_flowThread->invalidateRegions();
}
// FIXME: We need to find a way to set up overflow properly. Our flow thread hasn't gotten a layout
// yet, so we can't look to it for correct information. It's possible we could wait until after the RenderFlowThread
// gets a layout, and then try to propagate overflow information back to the region, and then mark for a second layout.
// That second layout would then be able to use the information from the RenderFlowThread to set up overflow.
//
// The big problem though is that overflow needs to be region-specific. We can't simply use the RenderFlowThread's global
// overflow values, since then we'd always think any narrow region had huge overflow (all the way to the width of the
// RenderFlowThread itself).
//
// We'll need to expand RenderBoxRegionInfo to also hold left and right overflow values.
}
开发者ID:sysrqb,项目名称:chromium-src,代码行数:19,代码来源:RenderRegion.cpp
示例11: paintReplaced
void RenderImage::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
GraphicsContext* context = paintInfo.context;
if (m_imageResource->hasImage() && contentWidth() > 0 && contentHeight() > 0) {
LayoutRect contentRect = contentBoxRect();
contentRect.moveBy(paintOffset);
LayoutRect paintRect = replacedContentRect();
paintRect.moveBy(paintOffset);
bool clip = !contentRect.contains(paintRect);
if (clip) {
context->save();
context->clip(contentRect);
}
paintIntoRect(context, paintRect);
if (clip)
context->restore();
}
}
开发者ID:domenic,项目名称:mojo,代码行数:21,代码来源:RenderImage.cpp
示例12: p
void RoundButton::paintEvent(QPaintEvent *e) {
Painter p(this);
auto innerWidth = contentWidth();
auto rounded = rect().marginsRemoved(_st.padding);
if (_fullWidthOverride < 0) {
rounded = QRect(0, rounded.top(), innerWidth - _fullWidthOverride, rounded.height());
}
App::roundRect(p, myrtlrect(rounded), _st.textBg, ImageRoundRadius::Small);
auto over = isOver();
auto down = isDown();
if (over || down) {
App::roundRect(p, myrtlrect(rounded), _st.textBgOver, ImageRoundRadius::Small);
}
auto ms = getms();
paintRipple(p, rounded.x(), rounded.y(), ms);
p.setFont(_st.font);
int textLeft = _st.padding.left() + ((width() - innerWidth - _st.padding.left() - _st.padding.right()) / 2);
if (_fullWidthOverride < 0) {
textLeft = -_fullWidthOverride / 2;
}
int textTop = _st.padding.top() + _st.textTop;
if (!_text.isEmpty()) {
p.setPen((over || down) ? _st.textFgOver : _st.textFg);
p.drawTextLeft(textLeft, textTop, width(), _text);
}
if (_numbers) {
textLeft += _textWidth + (_textWidth ? _st.numbersSkip : 0);
p.setPen((over || down) ? _st.numbersTextFgOver : _st.numbersTextFg);
_numbers->paint(p, textLeft, textTop, width());
}
_st.icon.paint(p, QPoint(_st.padding.left(), _st.padding.right()), width());
}
开发者ID:Igevorse,项目名称:tdesktop,代码行数:36,代码来源:buttons.cpp
示例13: FloatRect
void RenderSVGImage::paint(PaintInfo& paintInfo, int parentX, int parentY)
{
if (paintInfo.context->paintingDisabled() || (paintInfo.phase != PaintPhaseForeground) || style()->visibility() == HIDDEN)
return;
paintInfo.context->save();
paintInfo.context->concatCTM(AffineTransform().translate(parentX, parentY));
paintInfo.context->concatCTM(localTransform());
paintInfo.context->concatCTM(translationForAttributes());
FloatRect boundingBox = FloatRect(0, 0, width(), height());
SVGElement* svgElement = static_cast<SVGElement*>(element());
ASSERT(svgElement && svgElement->document() && svgElement->isStyled());
SVGStyledElement* styledElement = static_cast<SVGStyledElement*>(svgElement);
const SVGRenderStyle* svgStyle = style()->svgStyle();
AtomicString filterId(SVGURIReference::getTarget(svgStyle->filter()));
AtomicString clipperId(SVGURIReference::getTarget(svgStyle->clipPath()));
AtomicString maskerId(SVGURIReference::getTarget(svgStyle->maskElement()));
#if ENABLE(SVG_EXPERIMENTAL_FEATURES)
SVGResourceFilter* filter = getFilterById(document(), filterId);
#endif
SVGResourceClipper* clipper = getClipperById(document(), clipperId);
SVGResourceMasker* masker = getMaskerById(document(), maskerId);
#if ENABLE(SVG_EXPERIMENTAL_FEATURES)
if (filter)
filter->prepareFilter(paintInfo.context, boundingBox);
else if (!filterId.isEmpty())
svgElement->document()->accessSVGExtensions()->addPendingResource(filterId, styledElement);
#endif
if (clipper) {
clipper->addClient(styledElement);
clipper->applyClip(paintInfo.context, boundingBox);
} else if (!clipperId.isEmpty())
svgElement->document()->accessSVGExtensions()->addPendingResource(clipperId, styledElement);
if (masker) {
masker->addClient(styledElement);
masker->applyMask(paintInfo.context, boundingBox);
} else if (!maskerId.isEmpty())
svgElement->document()->accessSVGExtensions()->addPendingResource(maskerId, styledElement);
float opacity = style()->opacity();
if (opacity < 1.0f) {
paintInfo.context->clip(enclosingIntRect(boundingBox));
paintInfo.context->beginTransparencyLayer(opacity);
}
PaintInfo pi(paintInfo);
pi.rect = absoluteTransform().inverse().mapRect(pi.rect);
SVGImageElement* imageElt = static_cast<SVGImageElement*>(node());
FloatRect destRect(m_x, m_y, contentWidth(), contentHeight());
FloatRect srcRect(0, 0, image()->width(), image()->height());
if (imageElt->preserveAspectRatio()->align() != SVGPreserveAspectRatio::SVG_PRESERVEASPECTRATIO_NONE)
adjustRectsForAspectRatio(destRect, srcRect, imageElt->preserveAspectRatio());
paintInfo.context->drawImage(image(), destRect, srcRect);
#if ENABLE(SVG_EXPERIMENTAL_FEATURES)
if (filter)
filter->applyFilter(paintInfo.context, boundingBox);
#endif
if (opacity < 1.0f)
paintInfo.context->endTransparencyLayer();
paintInfo.context->restore();
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:76,代码来源:RenderSVGImage.cpp
示例14: toRenderMultiColumnBlock
void RenderMultiColumnSet::paintColumnRules(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
if (paintInfo.context->paintingDisabled())
return;
RenderStyle* blockStyle = toRenderMultiColumnBlock(parent())->style();
const Color& ruleColor = blockStyle->visitedDependentColor(CSSPropertyWebkitColumnRuleColor);
bool ruleTransparent = blockStyle->columnRuleIsTransparent();
EBorderStyle ruleStyle = blockStyle->columnRuleStyle();
LayoutUnit ruleThickness = blockStyle->columnRuleWidth();
LayoutUnit colGap = columnGap();
bool renderRule = ruleStyle > BHIDDEN && !ruleTransparent && ruleThickness <= colGap;
if (!renderRule)
return;
unsigned colCount = columnCount();
if (colCount <= 1)
return;
bool antialias = shouldAntialiasLines(paintInfo.context);
bool leftToRight = style()->isLeftToRightDirection();
LayoutUnit currLogicalLeftOffset = leftToRight ? ZERO_LAYOUT_UNIT : contentLogicalWidth();
LayoutUnit ruleAdd = borderAndPaddingLogicalLeft();
LayoutUnit ruleLogicalLeft = leftToRight ? ZERO_LAYOUT_UNIT : contentLogicalWidth();
LayoutUnit inlineDirectionSize = computedColumnWidth();
BoxSide boxSide = isHorizontalWritingMode()
? leftToRight ? BSLeft : BSRight
: leftToRight ? BSTop : BSBottom;
for (unsigned i = 0; i < colCount; i++) {
// Move to the next position.
if (leftToRight) {
ruleLogicalLeft += inlineDirectionSize + colGap / 2;
currLogicalLeftOffset += inlineDirectionSize + colGap;
} else {
ruleLogicalLeft -= (inlineDirectionSize + colGap / 2);
currLogicalLeftOffset -= (inlineDirectionSize + colGap);
}
// Now paint the column rule.
if (i < colCount - 1) {
LayoutUnit ruleLeft = isHorizontalWritingMode() ? paintOffset.x() + ruleLogicalLeft - ruleThickness / 2 + ruleAdd : paintOffset.x() + borderLeft() + paddingLeft();
LayoutUnit ruleRight = isHorizontalWritingMode() ? ruleLeft + ruleThickness : ruleLeft + contentWidth();
LayoutUnit ruleTop = isHorizontalWritingMode() ? paintOffset.y() + borderTop() + paddingTop() : paintOffset.y() + ruleLogicalLeft - ruleThickness / 2 + ruleAdd;
LayoutUnit ruleBottom = isHorizontalWritingMode() ? ruleTop + contentHeight() : ruleTop + ruleThickness;
IntRect pixelSnappedRuleRect = pixelSnappedIntRectFromEdges(ruleLeft, ruleTop, ruleRight, ruleBottom);
drawLineForBoxSide(paintInfo.context, pixelSnappedRuleRect.x(), pixelSnappedRuleRect.y(), pixelSnappedRuleRect.maxX(), pixelSnappedRuleRect.maxY(), boxSide, ruleColor, ruleStyle, 0, 0, antialias);
}
ruleLogicalLeft = currLogicalLeftOffset;
}
}
开发者ID:sanyaade-webdev,项目名称:webkit,代码行数:53,代码来源:RenderMultiColumnSet.cpp
示例15: VisiblePosition
VisiblePosition RenderContainer::positionForCoordinates(int x, int y)
{
// no children...return this render object's element, if there is one, and offset 0
if (!m_firstChild)
return VisiblePosition(element(), 0, DOWNSTREAM);
if (isTable() && element()) {
int right = contentWidth() + borderRight() + paddingRight() + borderLeft() + paddingLeft();
int bottom = contentHeight() + borderTop() + paddingTop() + borderBottom() + paddingBottom();
if (x < 0 || x > right || y < 0 || y > bottom) {
if (x <= right / 2)
return VisiblePosition(Position(element(), 0));
else
return VisiblePosition(Position(element(), maxDeepOffset(element())));
}
}
// Pass off to the closest child.
int minDist = INT_MAX;
RenderObject* closestRenderer = 0;
int newX = x;
int newY = y;
if (isTableRow()) {
newX += xPos();
newY += yPos();
}
for (RenderObject* renderer = m_firstChild; renderer; renderer = renderer->nextSibling()) {
if (!renderer->firstChild() && !renderer->isInline() && !renderer->isBlockFlow()
|| renderer->style()->visibility() != VISIBLE)
continue;
int top = borderTop() + paddingTop() + (isTableRow() ? 0 : renderer->yPos());
int bottom = top + renderer->contentHeight();
int left = borderLeft() + paddingLeft() + (isTableRow() ? 0 : renderer->xPos());
int right = left + renderer->contentWidth();
if (x <= right && x >= left && y <= top && y >= bottom) {
if (renderer->isTableRow())
return renderer->positionForCoordinates(x + newX - renderer->xPos(), y + newY - renderer->yPos());
return renderer->positionForCoordinates(x - renderer->xPos(), y - renderer->yPos());
}
// Find the distance from (x, y) to the box. Split the space around the box into 8 pieces
// and use a different compare depending on which piece (x, y) is in.
IntPoint cmp;
if (x > right) {
if (y < top)
cmp = IntPoint(right, top);
else if (y > bottom)
cmp = IntPoint(right, bottom);
else
cmp = IntPoint(right, y);
} else if (x < left) {
if (y < top)
cmp = IntPoint(left, top);
else if (y > bottom)
cmp = IntPoint(left, bottom);
else
cmp = IntPoint(left, y);
} else {
if (y < top)
cmp = IntPoint(x, top);
else
cmp = IntPoint(x, bottom);
}
int x1minusx2 = cmp.x() - x;
int y1minusy2 = cmp.y() - y;
int dist = x1minusx2 * x1minusx2 + y1minusy2 * y1minusy2;
if (dist < minDist) {
closestRenderer = renderer;
minDist = dist;
}
}
if (closestRenderer)
return closestRenderer->positionForCoordinates(newX - closestRenderer->xPos(), newY - closestRenderer->yPos());
return VisiblePosition(element(), 0, DOWNSTREAM);
}
开发者ID:JonasZ95,项目名称:EAWebkit,代码行数:82,代码来源:RenderContainer.cpp
示例16: contentWidth
FoSize FoExternalGraphicDoc::widthValue()
{
return contentWidth();
}
开发者ID:SorinS,项目名称:fop-miniscribus,代码行数:4,代码来源:foexternalgraphicdoc.cpp
示例17: toRenderBlockFlow
void RenderMultiColumnSet::paintColumnRules(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
if (paintInfo.context->paintingDisabled())
return;
RenderMultiColumnFlowThread* flowThread = toRenderBlockFlow(parent())->multiColumnFlowThread();
const RenderStyle& blockStyle = parent()->style();
const Color& ruleColor = blockStyle.visitedDependentColor(CSSPropertyWebkitColumnRuleColor);
bool ruleTransparent = blockStyle.columnRuleIsTransparent();
EBorderStyle ruleStyle = blockStyle.columnRuleStyle();
LayoutUnit ruleThickness = blockStyle.columnRuleWidth();
LayoutUnit colGap = columnGap();
bool renderRule = ruleStyle > BHIDDEN && !ruleTransparent;
if (!renderRule)
return;
unsigned colCount = columnCount();
if (colCount <= 1)
return;
bool antialias = shouldAntialiasLines(paintInfo.context);
if (flowThread->progressionIsInline()) {
bool leftToRight = style().isLeftToRightDirection() ^ flowThread->progressionIsReversed();
LayoutUnit currLogicalLeftOffset = leftToRight ? LayoutUnit() : contentLogicalWidth();
LayoutUnit ruleAdd = logicalLeftOffsetForContent();
LayoutUnit ruleLogicalLeft = leftToRight ? LayoutUnit() : contentLogicalWidth();
LayoutUnit inlineDirectionSize = computedColumnWidth();
BoxSide boxSide = isHorizontalWritingMode()
? leftToRight ? BSLeft : BSRight
: leftToRight ? BSTop : BSBottom;
for (unsigned i = 0; i < colCount; i++) {
// Move to the next position.
if (leftToRight) {
ruleLogicalLeft += inlineDirectionSize + colGap / 2;
currLogicalLeftOffset += inlineDirectionSize + colGap;
} else {
ruleLogicalLeft -= (inlineDirectionSize + colGap / 2);
currLogicalLeftOffset -= (inlineDirectionSize + colGap);
}
// Now paint the column rule.
if (i < colCount - 1) {
LayoutUnit ruleLeft = isHorizontalWritingMode() ? paintOffset.x() + ruleLogicalLeft - ruleThickness / 2 + ruleAdd : paintOffset.x() + borderLeft() + paddingLeft();
LayoutUnit ruleRight = isHorizontalWritingMode() ? ruleLeft + ruleThickness : ruleLeft + contentWidth();
LayoutUnit ruleTop = isHorizontalWritingMode() ? paintOffset.y() + borderTop() + paddingTop() : paintOffset.y() + ruleLogicalLeft - ruleThickness / 2 + ruleAdd;
LayoutUnit ruleBottom = isHorizontalWritingMode() ? ruleTop + contentHeight() : ruleTop + ruleThickness;
IntRect pixelSnappedRuleRect = pixelSnappedIntRectFromEdges(ruleLeft, ruleTop, ruleRight, ruleBottom);
drawLineForBoxSide(paintInfo.context, pixelSnappedRuleRect.x(), pixelSnappedRuleRect.y(), pixelSnappedRuleRect.maxX(), pixelSnappedRuleRect.maxY(), boxSide, ruleColor, ruleStyle, 0, 0, antialias);
}
ruleLogicalLeft = currLogicalLeftOffset;
}
} else {
bool topToBottom = !style().isFlippedBlocksWritingMode() ^ flowThread->progressionIsReversed();
LayoutUnit ruleLeft = isHorizontalWritingMode() ? LayoutUnit() : colGap / 2 - colGap - ruleThickness / 2;
LayoutUnit ruleWidth = isHorizontalWritingMode() ? contentWidth() : ruleThickness;
LayoutUnit ruleTop = isHorizontalWritingMode() ? colGap / 2 - colGap - ruleThickness / 2 : LayoutUnit();
LayoutUnit ruleHeight = isHorizontalWritingMode() ? ruleThickness : contentHeight();
LayoutRect ruleRect(ruleLeft, ruleTop, ruleWidth, ruleHeight);
if (!topToBottom) {
if (isHorizontalWritingMode())
ruleRect.setY(height() - ruleRect.maxY());
else
ruleRect.setX(width() - ruleRect.maxX());
}
ruleRect.moveBy(paintOffset);
BoxSide boxSide = isHorizontalWritingMode() ? topToBottom ? BSTop : BSBottom : topToBottom ? BSLeft : BSRight;
LayoutSize step(0, topToBottom ? computedColumnHeight() + colGap : -(computedColumnHeight() + colGap));
if (!isHorizontalWritingMode())
step = step.transposedSize();
for (unsigned i = 1; i < colCount; i++) {
ruleRect.move(step);
IntRect pixelSnappedRuleRect = pixelSnappedIntRect(ruleRect);
drawLineForBoxSide(paintInfo.context, pixelSnappedRuleRect.x(), pixelSnappedRuleRect.y(), pixelSnappedRuleRect.maxX(), pixelSnappedRuleRect.maxY(), boxSide, ruleColor, ruleStyle, 0, 0, antialias);
}
}
}
开发者ID:boska,项目名称:webkit,代码行数:84,代码来源:RenderMultiColumnSet.cpp
注:本文中的contentWidth函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论