void NodeSurface::Update( TopologyNode* pNode, bool selected ) { if ( pNode == NULL ) { return; } // Store the PGRGuid so we can handle device information on clicks m_guid = pNode->GetGuid(); m_deviceId = pNode->GetDeviceId(); // Create a context for the surface Cairo::RefPtr<Cairo::Context> refCairo = Cairo::Context::create( m_surface ); int width = m_surface->get_width(); int height= m_surface->get_height(); int radius = 10; double red, green, blue; TopologyNode::NodeType nodeType = pNode->GetNodeType(); GetNodeTypeColor( nodeType, red, green, blue ); FillBackground( refCairo, 1.0, 1.0, 1.0 ); DrawRoundedRectangle( refCairo, 10, 10, width-20, height-20, radius, red, green, blue, selected ); DrawNodeText( refCairo, pNode, width/2, height/2 ); //DrawIcon( refCairo, m_iconSurface, m_iconPixBuf, width/2, height/2 ); DrawPorts( refCairo, pNode ); }
void cPrimitives::DrawRoundedRectangle( const eeRectf& R, const eeFloat& Angle, const eeVector2f& Scale, const eeUint& Corners ) { DrawRoundedRectangle( R, mColor, mColor, mColor, mColor, Angle, Scale, Corners ); }
void SvgDeviceContext::DrawRectangle(int x, int y, int width, int height) { DrawRoundedRectangle( x, y, width, height, 0 ); }