uiacceltk/hitchcock/coretoolkit/src/huicanvaswshwgc.cpp
changeset 13 8f67d927ea57
parent 0 15bf7259bb7c
child 14 83d2d132aa58
equal deleted inserted replaced
0:15bf7259bb7c 13:8f67d927ea57
   655            {      
   655            {      
   656            points.Append( THuiRealPoint( aPointerArray->At(j) + iWsOrigin + iPosDelta) );        
   656            points.Append( THuiRealPoint( aPointerArray->At(j) + iWsOrigin + iPosDelta) );        
   657            }
   657            }
   658         UseWsState();
   658         UseWsState();
   659         
   659         
   660         if ( aFillRule == MWsGraphicsContext::EAlternate )
   660         if (iWsBrushStyle == MWsGraphicsContext::ENullBrush)
   661             {
   661             {
   662             iCanvasGc->SetPolygonDrawMode( EHuiFillEvenOdd );
   662             // nullbrush, but pen style set
   663             }
   663             // -> draw non filled polygon and 
   664         if ( aFillRule == MWsGraphicsContext::EWinding )
   664             // use pencolor
   665             {        
   665             iCanvasGc->SetPolygonDrawMode( EHuiNoFill );
   666             iCanvasGc->SetPolygonDrawMode( EHuiFillNonZero );
   666             iCanvasGc->SetPenColor(iWsPenColor);            
   667             }
   667             iCanvasGc->SetOpacity(TReal32(iWsPenColor.Alpha() / 255.f));       
   668         iCanvasGc->SetPenColor(iWsPenColor);            
   668 
   669         iCanvasGc->SetOpacity(TReal32(iWsPenColor.Alpha() / 255.f));       
   669             }
       
   670         else
       
   671             {
       
   672             if ( aFillRule == MWsGraphicsContext::EAlternate )
       
   673                 {
       
   674                 iCanvasGc->SetPolygonDrawMode( EHuiFillEvenOdd );
       
   675                 }
       
   676             if ( aFillRule == MWsGraphicsContext::EWinding )
       
   677                 {        
       
   678                 iCanvasGc->SetPolygonDrawMode( EHuiFillNonZero );
       
   679                 }
       
   680             iCanvasGc->SetPenColor(iWsBrushColor);            
       
   681             iCanvasGc->SetOpacity(TReal32(iWsBrushColor.Alpha() / 255.f));       
       
   682             }
       
   683             
   670         iCanvasGc->SetDrawMode(SelectCanvasDrawMode(iWsDrawMode));        
   684         iCanvasGc->SetDrawMode(SelectCanvasDrawMode(iWsDrawMode));        
   671             
   685             
   672         iCanvasGc->DrawPolygon( points );
   686         iCanvasGc->DrawPolygon( points );
   673     
   687     
   674         UseCanvasState();
   688         UseCanvasState();
  2065             {
  2079             {
  2066             TInt oldAlpha = gc->PenAlpha();
  2080             TInt oldAlpha = gc->PenAlpha();
  2067             TRgb oldColor = gc->PenColor();            
  2081             TRgb oldColor = gc->PenColor();            
  2068             gc->SetPenAlpha(0);
  2082             gc->SetPenAlpha(0);
  2069             gc->SetPenColor(KRgbBlue);
  2083             gc->SetPenColor(KRgbBlue);
  2070             gc->Clear(); 
  2084             TRect rect = aUpdateRegion.BoundingRect();
       
  2085             gc->Clear(rect); 
  2071             gc->SetPenAlpha(oldAlpha);
  2086             gc->SetPenAlpha(oldAlpha);
  2072             gc->SetPenColor(oldColor);
  2087             gc->SetPenColor(oldColor);
  2073             }
  2088             }
  2074         }
  2089         }
  2075     }
  2090     }
  2104     iCanvasGc->Gc()->PushClip();
  2119     iCanvasGc->Gc()->PushClip();
  2105     
  2120     
  2106     // Set new clipping region which does not clip anything. 
  2121     // Set new clipping region which does not clip anything. 
  2107     // We want always draw aUpdateRegion fully to the aRenderbuffer. 
  2122     // We want always draw aUpdateRegion fully to the aRenderbuffer. 
  2108     TRect displayArea = iCanvasGc->Gc()->DisplayArea(); 
  2123     TRect displayArea = iCanvasGc->Gc()->DisplayArea(); 
       
  2124     
  2109     iCanvasGc->Gc()->SetClip(displayArea); // this call does not transform region anymore
  2125     iCanvasGc->Gc()->SetClip(displayArea); // this call does not transform region anymore
  2110     
  2126     
  2111     // We use translation to get screen coordinates to match render buffer coordinates
  2127     // We use translation to get screen coordinates to match render buffer coordinates
  2112     iCanvasGc->PushTransformationMatrix();
  2128     iCanvasGc->PushTransformationMatrix();
  2113     iCanvasGc->Translate(x, y, 0.f);
  2129     iCanvasGc->Translate(x, y, 0.f);