示例#1
0
void RS_OverlayBox::draw(RS_Painter* painter, RS_GraphicView* view, double& /*patternOffset*/) {
    if (painter==NULL || view==NULL) {
        return;
    }

    RS_Vector v1=view->toGui(getCorner1());
    RS_Vector v2=view->toGui(getCorner2());

    QRectF selectRect(
        v1.x,
        v1.y,
        v2.x - v1.x,
        v2.y - v1.y);

    if (v1.y > v2.y) {
        painter->setPen(QColor(50, 255, 50));
        painter->fillRect(selectRect, RS_Color(9, 255, 9, 90));
    }
    else {
        painter->setPen(QColor(50, 50, 255));
        painter->fillRect(selectRect, RS_Color(9, 9, 255, 90));
    }

    painter->drawRect(v1, v2);
}
示例#2
0
void RS_OverlayBox::draw(RS_Painter* painter, RS_GraphicView* view, double& patternOffset) {
    if (painter==NULL || view==NULL) {
        return;
    }
	
	RS_Vector v1=view->toGui(getCorner1());
	RS_Vector v2=view->toGui(getCorner2());
	
	QBrush brush(QColor(9,9,255,90));
	painter->fillRect(v1.x, v1.y, v2.x-v1.x, v2.y-v1.y, QColor(9,9,255,90) );
	

}
示例#3
0
void RS_OverlayCircle::draw(RS_Painter* painter, RS_GraphicView* view, double& /*patternOffset*/) {
    if (painter==NULL || view==NULL) {
        return;
    }
	
	RS_Vector v1=view->toGui(getCorner1());
	RS_Vector v2=view->toGui(getCorner2());
	
   RS_Vector cc = (v1 + v2) / 2.0;
           
   double radius = v2.distanceTo(cc);
   
       if (v1.x > v2.x) 	       /* see "cross" in rs_actionselectcircle.cpp  */
     {
	
	RS_Pen p(RS_Color(50,255,50),RS2::Width00,RS2::DashLine);   /* green */
	        painter->setPen(p);
	//        painter->setPen(QColor(50, 255, 50));
	        painter->fillCircle(cc, radius, RS_Color(9, 255, 9, 90));
	     }
	     else {
	         painter->setPen(QColor(50, 50, 255));
	         painter->fillCircle(cc, radius, RS_Color(9, 9, 255, 90));
	     }
	 
	 
   
// old in LC1:	QBrush brush(QColor(9,9,255,90));
   
	// painter->fillRect(v1.x, v1.y, v2.x-v1.x, v2.y-v1.y, QColor(9,9,255,90) );
	
   // painter->fillCircle(cc, radius, brush );
   
   painter->drawCircle(cc, radius);   
   
}