Пример #1
0
void ShapeContentFill::pop(ofPath& path)
{
	ofPushStyle();
	path.setFilled(true);
	ofColor prev = path.getFillColor();
	float opacity = prev.a/255.f*opacity_;
	path.setFillColor(ofColor(color_, opacity*255));
	ofEnableBlendMode(blend_mode_);
	path.draw();
	path.setFillColor(prev);
	ofPopStyle();
}
Пример #2
0
void ShapeContentGroup::pop(ofPath& path)
{
	if(transform_.isDirty()) {
		transform_.refreshMatrix();
	}
	transform_.pushMatrix();
	ofColor prev_st = path.getStrokeColor();
	ofColor prev_fi = path.getFillColor();
	float opacity_st = prev_st.a/255.f*opacity_;
	float opacity_fi = prev_fi.a/255.f*opacity_;
	path.setStrokeColor(ofColor(prev_st, opacity_st*255));
	path.setFillColor(ofColor(prev_fi, opacity_fi*255));
	for(vector<ShapeContent*>::reverse_iterator it = content_.rbegin(); it != content_.rend(); ++it) {
		(*it)->pop(path);
	}
	path.setStrokeColor(prev_st);
	path.setFillColor(prev_fi);
	transform_.popMatrix();
}
Пример #3
0
 void handlePathDrawStyle(ofPath& p)
 {
     p.setFilled(m_hasFill);
     p.setFillColor(m_fillColor);
     p.setStrokeColor(m_strokeColor);
     if( m_hasStroke )
     {
         p.setStrokeWidth(m_strokeWeight);
     }
     else
     {
         p.setStrokeWidth(0);
     }
 }