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


C++ Affine::withoutTranslation方法代码示例

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


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

示例1: set_transform

Geom::Affine SPStar::set_transform(Geom::Affine const &xform)
{
    bool opt_trans = (randomized == 0);
    // Only set transform with proportional scaling
    if (!xform.withoutTranslation().isUniformScale()) {
        return xform;
    }

    // Allow live effects
    if (hasPathEffect() && pathEffectsEnabled()) {
        return xform;
    }

    /* Calculate star start in parent coords. */
    Geom::Point pos( this->center * xform );

    /* This function takes care of translation and scaling, we return whatever parts we can't
       handle. */
    Geom::Affine ret(opt_trans ? xform.withoutTranslation() : xform);
    gdouble const s = hypot(ret[0], ret[1]);
    if (s > 1e-9) {
        ret[0] /= s;
        ret[1] /= s;
        ret[2] /= s;
        ret[3] /= s;
    } else {
        ret[0] = 1.0;
        ret[1] = 0.0;
        ret[2] = 0.0;
        ret[3] = 1.0;
    }

    this->r[0] *= s;
    this->r[1] *= s;

    /* Find start in item coords */
    pos = pos * ret.inverse();
    this->center = pos;

    this->set_shape();

    // Adjust stroke width
    this->adjust_stroke(s);

    // Adjust pattern fill
    this->adjust_pattern(xform * ret.inverse());

    // Adjust gradient fill
    this->adjust_gradient(xform * ret.inverse());

    this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG);

    return ret;
}
开发者ID:AakashDabas,项目名称:inkscape,代码行数:54,代码来源:sp-star.cpp

示例2: set_transform

Geom::Affine SPFlowtext::set_transform (Geom::Affine const &xform)
{
    if ((this->_optimizeScaledText && !xform.withoutTranslation().isNonzeroUniformScale())
        || (!this->_optimizeScaledText && !xform.isNonzeroUniformScale())) {
        this->_optimizeScaledText = false;
        return xform;
    }
    this->_optimizeScaledText = false;
    
    SPText *text = reinterpret_cast<SPText *>(this);
    
    double const ex = xform.descrim();
    if (ex == 0) {
        return xform;
    }

    Geom::Affine ret(xform);
    ret[0] /= ex;
    ret[1] /= ex;
    ret[2] /= ex;
    ret[3] /= ex;

    // Adjust font size
    text->_adjustFontsizeRecursive (this, ex);

    // Adjust stroke width
    this->adjust_stroke_width_recursive (ex);

    // Adjust pattern fill
    this->adjust_pattern(xform * ret.inverse());

    // Adjust gradient fill
    this->adjust_gradient(xform * ret.inverse());

    this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_TEXT_LAYOUT_MODIFIED_FLAG);

    return ret;
}
开发者ID:Grandrogue,项目名称:inkscape_metal,代码行数:38,代码来源:sp-flowtext.cpp


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