From 1e426b18ba96a9d0771a8f80698e988677f70196 Mon Sep 17 00:00:00 2001
From: Rene Brun <Rene.Brun@cern.ch>
Date: Tue, 12 Sep 2000 06:44:42 +0000
Subject: [PATCH] Modify the default TCanvas constructor to use the new
 function TClass::IsCallingNew.

git-svn-id: http://root.cern.ch/svn/root/trunk@632 27541ba8-7e3a-0410-8455-c3a389f83636
---
 gpad/src/TCanvas.cxx | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/gpad/src/TCanvas.cxx b/gpad/src/TCanvas.cxx
index 123acb9686f..fd8a7612dcf 100644
--- a/gpad/src/TCanvas.cxx
+++ b/gpad/src/TCanvas.cxx
@@ -1,4 +1,4 @@
-// @(#)root/gpad:$Name:  $:$Id: TCanvas.cxx,v 1.10 2000/09/11 06:18:24 brun Exp $
+// @(#)root/gpad:$Name:  $:$Id: TCanvas.cxx,v 1.11 2000/09/11 09:59:26 brun Exp $
 // Author: Rene Brun   12/12/94
 
 /*************************************************************************
@@ -119,7 +119,7 @@ TCanvas::TCanvas() : TPad()
 {
    // Canvas default constructor.
 
-   if (gROOT->ReadingObject()) {
+   if (TClass::IsCallingNew()) {
       Constructor();
    } else {
       const char *defcanvas = gROOT->GetDefCanvasName();
@@ -667,12 +667,12 @@ void TCanvas::DrawClonePad()
    // Note that the original canvas may have subpads.
 
    
-  if (gPad == 0 || gPad == this) {
+  TPad *padsav = (TPad*)gPad;
+  TPad *pad = (TPad*)gROOT->GetSelectedPad();
+  if (fCanvasID < 0 || padsav == 0 || pad == this) {
      DrawClone();
      return;
   }
-  TPad *padsav = (TPad*)gPad;
-  TPad *pad = (TPad*)gROOT->GetSelectedPad();
   this->cd();
   TObject *obj, *clone;
   //copy pad attributes
-- 
GitLab