@ Override public void draw ( Canvas canvas , Projection pj ) { if ( mIcon == null ) return ; if ( mPosition == null ) return ; pj . toPixels ( mPosition , mPositionPixels ) ; int width = mIcon . getIntrinsicWidth ( ) ; int height = mIcon . getIntrinsicHeight ( ) ; Rect rect = new Rect ( 0 , 0 , width , height ) ; rect . offset ( - ( int ) ( mAnchorU * width ) , - ( int ) ( mAnchorV * height ) ) ; mIcon . setBounds ( rect ) ; mIcon . setAlpha ( ( int ) ( mAlpha * 255 ) ) ; float rotationOnScreen = ( mFlat ? - mBearing : pj . getOrientation ( ) - mBearing ) ; drawAt ( canvas , mIcon , mPositionPixels . x , mPositionPixels . y , false , rotationOnScreen ) ; }
Draw the icon .