本文整理汇总了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;
}
示例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;
}