[DEV] remove etk_min and etk_max & color properties

This commit is contained in:
Edouard DUPIN 2014-07-03 21:03:26 +02:00
parent a6c50c8f94
commit ac34d1f531
5 changed files with 14 additions and 14 deletions

View File

@ -221,20 +221,20 @@ void esvg::Base::parsePaintAttr(const exml::Element *_element) {
content = _element->getAttribute("opacity");
if (content.size()!=0) {
float opacity = parseLength(content);
opacity = etk_max(0.0, etk_min(1.0, opacity));
opacity = std::avg(0.0f, opacity, 1.0f);
m_paint.fill.a = opacity*0xFF;
m_paint.stroke.a = opacity*0xFF;
}
content = _element->getAttribute("fill-opacity");
if (content.size()!=0) {
float opacity = parseLength(content);
opacity = etk_max(0.0, etk_min(1.0, opacity));
opacity = std::avg(0.0f, opacity, 1.0f);
m_paint.fill.a = opacity*0xFF;
}
content = _element->getAttribute("stroke-opacity");
if (content.size()!=0) {
float opacity = parseLength(content);
opacity = etk_max(0.0, etk_min(1.0, opacity));
opacity = std::avg(0.0f, opacity, 1.0f);
m_paint.stroke.a = opacity*0xFF;
}
content = _element->getAttribute("fill-rule");
@ -299,18 +299,18 @@ void esvg::Base::parsePaintAttr(const exml::Element *_element) {
SVG_VERBOSE(" input : \"" << outputValue << "\" == > " << m_paint.strokeWidth);
} else if (outputType == "opacity" ) {
float opacity = parseLength(outputValue);
opacity = etk_max(0.0, etk_min(1.0, opacity));
opacity = std::avg(0.0f, opacity, 1.0f);
m_paint.fill.a = opacity*0xFF;
m_paint.stroke.a = opacity*0xFF;
SVG_VERBOSE(" input : \"" << outputValue << "\" == > " << m_paint.fill);
} else if (outputType == "fill-opacity") {
float opacity = parseLength(outputValue);
opacity = etk_max(0.0, etk_min(1.0, opacity));
opacity = std::avg(0.0f, opacity, 1.0f);
m_paint.fill.a = opacity*0xFF;
SVG_VERBOSE(" input : \"" << outputValue << "\" == > " << m_paint.fill);
} else if (outputType == "stroke-opacity") {
float opacity = parseLength(outputValue);
opacity = etk_max(0.0, etk_min(1.0, opacity));
opacity = std::avg(0.0f, opacity, 1.0f);
m_paint.stroke.a = opacity*0xFF;
SVG_VERBOSE(" input : \"" << outputValue << "\" == > " << m_paint.stroke);
} else if (outputType == "fill-rule" ) {

View File

@ -89,8 +89,8 @@ bool esvg::Group::parse(exml::Element * _element, agg::trans_affine& _parentTran
delete(elementParser);
elementParser = NULL;
} else {
_sizeMax.setValue(etk_max(_sizeMax.x(), tmpPos.x()),
etk_max(_sizeMax.y(), tmpPos.y()));
_sizeMax.setValue(std::max(_sizeMax.x(), tmpPos.x()),
std::max(_sizeMax.y(), tmpPos.y()));
// add element in the system
m_subElementList.push_back(elementParser);
}

View File

@ -51,8 +51,8 @@ bool esvg::Line::parse(exml::Element * _element, agg::trans_affine& _parentTrans
if (content.size()!=0) {
m_stopPos.setY(parseLength(content));
}
_sizeMax.setValue(etk_max(m_startPos.x(), m_stopPos.x()),
etk_max(m_startPos.y(), m_stopPos.y()));
_sizeMax.setValue(std::max(m_startPos.x(), m_stopPos.x()),
std::max(m_startPos.y(), m_stopPos.y()));
return true;
}

View File

@ -50,8 +50,8 @@ bool esvg::Polygon::parse(exml::Element * _element, agg::trans_affine& _parentTr
if (sscanf(sss, "%f,%f%n", &pos.m_floats[0], &pos.m_floats[1], &n) == 2) {
m_listPoint.push_back(pos);
sss += n;
_sizeMax.setValue(etk_max(_sizeMax.x(), pos.x()),
etk_max(_sizeMax.y(), pos.y()));
_sizeMax.setValue(std::max(_sizeMax.x(), pos.x()),
std::max(_sizeMax.y(), pos.y()));
if(sss[0] == ' ' || sss[0] == ',') {
sss++;
}

View File

@ -44,8 +44,8 @@ bool esvg::Polyline::parse(exml::Element * _element, agg::trans_affine& _parentT
int32_t n;
if (sscanf(sss, "%f,%f %n", &pos.m_floats[0], &pos.m_floats[1], &n) == 2) {
m_listPoint.push_back(pos);
_sizeMax.setValue(etk_max(_sizeMax.x(), pos.x()),
etk_max(_sizeMax.y(), pos.y()));
_sizeMax.setValue(std::max(_sizeMax.x(), pos.x()),
std::max(_sizeMax.y(), pos.y()));
sss += n;
} else {
break;