From 04d02fd58bb008b716d7a866832195d780239ed4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Adri=C3=A1n=20Medra=C3=B1o=20Calvo?=
 <adrian@medranocalvo.com>
Date: Thu, 27 Jul 2017 12:39:37 +0200
Subject: Use axis' own classid to determine the type

---
 generic/tkbltGrAxisOp.C | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/generic/tkbltGrAxisOp.C b/generic/tkbltGrAxisOp.C
index 196d29a..e467d53 100644
--- a/generic/tkbltGrAxisOp.C
+++ b/generic/tkbltGrAxisOp.C
@@ -555,10 +555,14 @@ int AxisTypeOp(Axis* axisPtr, Tcl_Interp* interp,
 {
   const char* typeName = "";
   if (axisPtr->use_) {
-    if (axisNames[axisPtr->margin_].classId == CID_AXIS_X)
+    switch (axisPtr->classId_) {
+    case CID_AXIS_X:
       typeName = "x";
-    else if (axisNames[axisPtr->margin_].classId == CID_AXIS_Y)
+      break;
+    case CID_AXIS_Y:
       typeName = "y";
+      break;
+    }
   }
 
   Tcl_SetStringObj(Tcl_GetObjResult(interp), typeName, -1);
-- 
cgit v0.12