summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/bltGrAxisOp.h1
-rw-r--r--src/bltGraph.C41
-rw-r--r--src/bltGraph.h2
3 files changed, 21 insertions, 23 deletions
diff --git a/src/bltGrAxisOp.h b/src/bltGrAxisOp.h
index a4990ed..0826924 100644
--- a/src/bltGrAxisOp.h
+++ b/src/bltGrAxisOp.h
@@ -41,7 +41,6 @@ extern Point2d Blt_InvMap2D(Graph* graphPtr, double x, double y,
extern Point2d Blt_Map2D(Graph* graphPtr, double x, double y,
Axis2d *pairPtr);
-extern void Blt_AdjustAxisPointers(Graph* graphPtr);
extern void Blt_UpdateAxisBackgrounds(Graph* graphPtr);
extern void Blt_GridsToPostScript(Graph* graphPtr, Blt_Ps ps);
extern Axis *Blt_GetFirstAxis(Blt_Chain chain);
diff --git a/src/bltGraph.C b/src/bltGraph.C
index 3dc35c0..c36e7d0 100644
--- a/src/bltGraph.C
+++ b/src/bltGraph.C
@@ -62,8 +62,6 @@ extern void MarginsToPostScript(Graph* graphPtr, Blt_Ps ps);
static Blt_BindPickProc PickEntry;
-static void AdjustAxisPointers(Graph* graphPtr);
-
// OptionSpecs
static const char* barmodeObjOption[] =
@@ -319,7 +317,7 @@ Graph::Graph(ClientData clientData, Tcl_Interp* interp,
return;
}
- AdjustAxisPointers(this);
+ adjustAxes();
Tcl_SetStringObj(Tcl_GetObjResult(interp_), Tk_PathName(tkwin_), -1);
}
@@ -398,7 +396,7 @@ void Graph::configure()
// If the -inverted option changed, we need to readjust the pointers
// to the axes and recompute the their scales.
if (flags & RESET_AXES)
- AdjustAxisPointers(this);
+ adjustAxes();
// Free the pixmap if we're not buffering the display of elements anymore.
if ((!ops->backingStore) && (cache_ != None)) {
@@ -737,23 +735,6 @@ void Graph::eventuallyRedraw()
}
}
-static void AdjustAxisPointers(Graph* graphPtr)
-{
- GraphOptions* ops = (GraphOptions*)graphPtr->ops_;
- if (ops->inverted) {
- ops->leftMargin.axes = graphPtr->axisChain_[0];
- ops->bottomMargin.axes = graphPtr->axisChain_[1];
- ops->rightMargin.axes = graphPtr->axisChain_[2];
- ops->topMargin.axes = graphPtr->axisChain_[3];
- }
- else {
- ops->leftMargin.axes = graphPtr->axisChain_[1];
- ops->bottomMargin.axes = graphPtr->axisChain_[0];
- ops->rightMargin.axes = graphPtr->axisChain_[3];
- ops->topMargin.axes = graphPtr->axisChain_[2];
- }
-}
-
void Graph::extents(Region2d* regionPtr)
{
GraphOptions* ops = (GraphOptions*)ops_;
@@ -1174,6 +1155,24 @@ ClientData Graph::axisTag(const char *tagName)
return Tcl_GetHashKey(&axes_.tagTable, hPtr);
}
+void Graph::adjustAxes()
+{
+ GraphOptions* ops = (GraphOptions*)ops_;
+
+ if (ops->inverted) {
+ ops->leftMargin.axes = axisChain_[0];
+ ops->bottomMargin.axes = axisChain_[1];
+ ops->rightMargin.axes = axisChain_[2];
+ ops->topMargin.axes = axisChain_[3];
+ }
+ else {
+ ops->leftMargin.axes = axisChain_[1];
+ ops->bottomMargin.axes = axisChain_[0];
+ ops->rightMargin.axes = axisChain_[3];
+ ops->topMargin.axes = axisChain_[2];
+ }
+}
+
void Graph::resetAxes()
{
GraphOptions* gops = (GraphOptions*)ops_;
diff --git a/src/bltGraph.h b/src/bltGraph.h
index 4e44620..7863353 100644
--- a/src/bltGraph.h
+++ b/src/bltGraph.h
@@ -224,6 +224,7 @@ class Graph {
void drawAxes(Drawable);
void drawAxesLimits(Drawable);
void drawAxesGrids(Drawable);
+ void adjustAxes();
public:
Graph(ClientData clientData, Tcl_Interp*interp,
@@ -255,7 +256,6 @@ class Graph {
ClientData elementTag(const char*);
};
-typedef ClientData (MakeTagProc)(Graph* graphPtr, const char *tagName);
extern Blt_BindTagProc Blt_GraphTags;
#endif