当前位置: 首页>>代码示例>>C++>>正文


C++ AffineTransform::mapSize方法代码示例

本文整理汇总了C++中AffineTransform::mapSize方法的典型用法代码示例。如果您正苦于以下问题:C++ AffineTransform::mapSize方法的具体用法?C++ AffineTransform::mapSize怎么用?C++ AffineTransform::mapSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AffineTransform的用法示例。


在下文中一共展示了AffineTransform::mapSize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: make_pair

std::pair<float, float> SVGGlyphToPathTranslator::extents()
{
    AffineTransform glyphPathTransform = transform();
    FloatPoint beginning = glyphPathTransform.mapPoint(m_currentPoint);
    FloatSize end = glyphPathTransform.mapSize(FloatSize(m_glyphBuffer.advanceAt(m_index)));
    return std::make_pair(beginning.x(), beginning.x() + end.width());
}
开发者ID:highweb-project,项目名称:highweb-parallelwebkit,代码行数:7,代码来源:SVGTextRunRenderingContext.cpp

示例2: transformPaintInvalidationRect

LayoutRect SVGLayoutSupport::transformPaintInvalidationRect(
    const LayoutObject& object,
    const AffineTransform& rootTransform,
    const FloatRect& localRect) {
  FloatRect adjustedRect = rootTransform.mapRect(localRect);

  if (object.isSVGShape() && object.styleRef().svgStyle().hasStroke()) {
    if (float strokeWidthForHairlinePadding =
            toLayoutSVGShape(object).strokeWidth()) {
      // For hairline strokes (stroke-width < 1 in device space), Skia
      // rasterizes up to 0.4(9) off the stroke center. That means
      // enclosingIntRect is not enough - we must also pad to 0.5.
      // This is still fragile as it misses out on CC/DSF CTM components.
      const FloatSize strokeSize = rootTransform.mapSize(FloatSize(
          strokeWidthForHairlinePadding, strokeWidthForHairlinePadding));
      if (strokeSize.width() < 1 || strokeSize.height() < 1) {
        float pad =
            0.5f - std::min(strokeSize.width(), strokeSize.height()) / 2;
        DCHECK_GT(pad, 0);
        // Additionally, square/round caps can potentially introduce an outset
        // <= 0.5
        if (object.styleRef().svgStyle().capStyle() != ButtCap)
          pad += 0.5f;
        adjustedRect.inflate(pad);
      }
    }
  }

  if (adjustedRect.isEmpty())
    return LayoutRect();

  // Use enclosingIntRect because we cannot properly apply subpixel offset of
  // the SVGRoot since we don't know the desired subpixel accumulation at this
  // point.
  return LayoutRect(enclosingIntRect(adjustedRect));
}
开发者ID:ollie314,项目名称:chromium,代码行数:36,代码来源:SVGLayoutSupport.cpp

示例3: make_pair

std::pair<float, float> CairoGlyphToPathTranslator::extents()
{
    FloatPoint beginning = m_translation.mapPoint(FloatPoint());
    FloatSize end = m_translation.mapSize(m_glyphBuffer.advanceAt(m_index));
    return std::make_pair(static_cast<float>(beginning.x()), static_cast<float>(beginning.x() + end.width()));
}
开发者ID:emutavchi,项目名称:WebKitForWayland,代码行数:6,代码来源:FontCairo.cpp


注:本文中的AffineTransform::mapSize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。