Skip to content
Snippets Groups Projects
Commit 10bc97f3 authored by Rene Brun's avatar Rene Brun
Browse files

Modify TArraw::DrawArrow to use the current arrow attributes in case

the default arguments arrowsize and option are specified.


git-svn-id: http://root.cern.ch/svn/root/trunk@7421 27541ba8-7e3a-0410-8455-c3a389f83636
parent 6a20cf53
No related branches found
No related tags found
No related merge requests found
// @(#)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();}
......
// @(#)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);
}
//______________________________________________________________________________
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment