Logo Search packages:      
Sourcecode: ktechlab version File versions  Download package

void Component::initPainter ( QPainter &  p  )  [protected, virtual, inherited]

Sets the right colour if selected, transforms the matrix of the painter

Reimplemented from CNItem.

Definition at line 170 of file component.cpp.

References CNItem::initPainter().

Referenced by Component::drawPortShape(), and ECRotoSwitch::drawShape().

{
      CNItem::initPainter(p);
      
      if ( !b_flipped && (m_angleDegrees%360 == 0) )
            return;
      
      p.save();
      
      p.translate( int(x()), int(y()) );
      if (b_flipped)
            p.scale( -1, 1 );
      
      p.rotate(m_angleDegrees);
      p.translate( -int(x()), -int(y()) );
}


Generated by  Doxygen 1.6.0   Back to index