diff --git a/graf/inc/TArrow.h b/graf/inc/TArrow.h index ce56db9e6910d62624320a877ba66cc554f2459e..f58b346a5adf173cdf13ba597500025e5b0a7de6 100644 --- a/graf/inc/TArrow.h +++ b/graf/inc/TArrow.h @@ -1,4 +1,4 @@ -// @(#)root/graf:$Name: $:$Id: TArrow.h,v 1.4 2002/02/23 15:45:56 rdm Exp $ +// @(#)root/graf:$Name: $:$Id: TArrow.h,v 1.5 2002/10/31 07:27:34 brun Exp $ // Author: Rene Brun 17/10/95 /************************************************************************* @@ -47,7 +47,7 @@ public: void Copy(TObject &arrow) const; virtual void Draw(Option_t *option=""); virtual void DrawArrow(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2 - ,Float_t arrowsize=0.05 ,Option_t *option=">"); + ,Float_t arrowsize=0 ,Option_t *option=""); Float_t GetAngle() const {return fAngle;} Float_t GetArrowSize() const {return fArrowSize;} Option_t *GetOption() const { return fOption.Data();} diff --git a/graf/src/TArrow.cxx b/graf/src/TArrow.cxx index d0a97888c956ab657682da3a2218767dcc683bff..c2b9651e29c29ab7aa61a5cce735ef06e57468e7 100644 --- a/graf/src/TArrow.cxx +++ b/graf/src/TArrow.cxx @@ -1,4 +1,4 @@ -// @(#)root/graf:$Name: $:$Id: TArrow.cxx,v 1.7 2002/10/31 07:27:35 brun Exp $ +// @(#)root/graf:$Name: $:$Id: TArrow.cxx,v 1.8 2003/04/02 14:14:08 brun Exp $ // Author: Rene Brun 17/10/95 /************************************************************************* @@ -112,10 +112,20 @@ void TArrow::DrawArrow(Double_t x1, Double_t y1,Double_t x2, Double_t y2, { //*-*-*-*-*-*-*-*-*-*-*Draw this arrow with new coordinates*-*-*-*-*-*-*-*-*-* //*-* ==================================== - TArrow *newarrow = new TArrow(x1,y1,x2,y2,arrowsize,option); +// if arrowsize is <= 0, arrowsize will be the current arrow size +// if option="", option will be the current arrow option + + Float_t size = arrowsize; + if (size <= 0) size = fArrowSize; + if (size <= 0) size = 0.05; + const char* opt = option; + if (!opt || strlen(opt) == 0) opt = fOption.Data(); + if (!opt || strlen(opt) == 0) opt = "|>"; + TArrow *newarrow = new TArrow(x1,y1,x2,y2,size,opt); + newarrow->SetAngle(fAngle); TAttLine::Copy(*newarrow); TAttFill::Copy(*newarrow); - newarrow->AppendPad(option); + newarrow->AppendPad(opt); } //______________________________________________________________________________