[DEV] transfert Cross product to etk lib and add missing miterlimit in style

This commit is contained in:
Edouard DUPIN 2015-12-01 21:45:55 +01:00
parent ef8d2a889e
commit 7037a6980b
2 changed files with 4 additions and 2 deletions

View File

@ -383,6 +383,9 @@ void esvg::Base::parsePaintAttr(const std::shared_ptr<const exml::Element>& _ele
m_paint.lineJoin = esvg::join_miter;
SVG_ERROR("not know " << outputType << " value : \"" << outputValue << "\", not in [miter,round,bevel]");
}
} else if (outputType == "stroke-miterlimit") {
float tmp = parseLength(outputValue);
m_paint.miterLimit = std::max(0.0f, tmp);
} else if (outputType == "marker-start") {
// TODO : ...
} else {

View File

@ -275,8 +275,7 @@ void esvg::render::SegmentList::createSegmentListStroke(esvg::render::PointList&
{
vec2 axePrevious = (it.m_pos-it.m_posPrevious).safeNormalize();
vec2 axeNext = (it.m_posNext - it.m_pos).safeNormalize();
// TODO : Add cross at the vector2 ...
float cross = axePrevious.x() * axeNext.y() - axeNext.x() * axePrevious.y();
float cross = axePrevious.cross(axeNext);
if (cross > 0.0f) {
vec2 right = getIntersect(rightPoint, it.m_pos-it.m_posPrevious, it.m_pos, it.m_miterAxe);
vec2 left1 = it.m_pos