From 10bc97f33534824e03c4ef67cd9bededc561d72d Mon Sep 17 00:00:00 2001
From: Rene Brun <Rene.Brun@cern.ch>
Date: Thu, 9 Oct 2003 16:39:59 +0000
Subject: [PATCH] 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
---
 graf/inc/TArrow.h   |  4 ++--
 graf/src/TArrow.cxx | 16 +++++++++++++---
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/graf/inc/TArrow.h b/graf/inc/TArrow.h
index ce56db9e691..f58b346a5ad 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 d0a97888c95..c2b9651e29c 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);
 }
 
 //______________________________________________________________________________
-- 
GitLab