Commit 8dd2797d authored by Ole Streicher's avatar Ole Streicher

New upstream version 3.2.7

parent 9f4c179e
......@@ -5644,55 +5644,55 @@ done
vars="
src/tkbltChain.C
src/tkbltConfig.C
src/tkbltGrAxis.C
src/tkbltGrAxisOp.C
src/tkbltGrAxisOption.C
src/tkbltGrBind.C
src/tkbltGrElemOp.C
src/tkbltGrElemOption.C
src/tkbltGrElem.C
src/tkbltGrElemBar.C
src/tkbltGrElemLine.C
src/tkbltGrElemLineSpline.C
src/tkbltGrHairs.C
src/tkbltGrHairsOp.C
src/tkbltGrLegd.C
src/tkbltGrLegdOp.C
src/tkbltGrMarkerOp.C
src/tkbltGrMarkerOption.C
src/tkbltGrMarker.C
src/tkbltGrMarkerLine.C
src/tkbltGrMarkerPolygon.C
src/tkbltGrMarkerText.C
src/tkbltGrMisc.C
src/tkbltGrPenOp.C
src/tkbltGrPenOption.C
src/tkbltGrPen.C
src/tkbltGrPenBar.C
src/tkbltGrPenLine.C
src/tkbltGrPostscript.C
src/tkbltGrPostscriptOp.C
src/tkbltGrPSOutput.C
src/tkbltGrText.C
src/tkbltGrXAxisOp.C
src/tkbltGraph.C
src/tkbltGraphBar.C
src/tkbltGraphLine.C
src/tkbltGraphOp.C
src/tkbltGraphSup.C
src/tkbltInt.C
src/tkbltNsUtil.C
src/tkbltParse.C
src/tkbltOp.C
src/tkbltStubInit.c
src/tkbltStubLib.C
src/tkbltSwitch.C
src/tkbltVecCmd.C
src/tkbltVecOp.C
src/tkbltVecMath.C
src/tkbltVector.C
tkbltChain.C
tkbltConfig.C
tkbltGrAxis.C
tkbltGrAxisOp.C
tkbltGrAxisOption.C
tkbltGrBind.C
tkbltGrElemOp.C
tkbltGrElemOption.C
tkbltGrElem.C
tkbltGrElemBar.C
tkbltGrElemLine.C
tkbltGrElemLineSpline.C
tkbltGrHairs.C
tkbltGrHairsOp.C
tkbltGrLegd.C
tkbltGrLegdOp.C
tkbltGrMarkerOp.C
tkbltGrMarkerOption.C
tkbltGrMarker.C
tkbltGrMarkerLine.C
tkbltGrMarkerPolygon.C
tkbltGrMarkerText.C
tkbltGrMisc.C
tkbltGrPenOp.C
tkbltGrPenOption.C
tkbltGrPen.C
tkbltGrPenBar.C
tkbltGrPenLine.C
tkbltGrPostscript.C
tkbltGrPostscriptOp.C
tkbltGrPSOutput.C
tkbltGrText.C
tkbltGrXAxisOp.C
tkbltGraph.C
tkbltGraphBar.C
tkbltGraphLine.C
tkbltGraphOp.C
tkbltGraphSup.C
tkbltInt.C
tkbltNsUtil.C
tkbltParse.C
tkbltOp.C
tkbltStubInit.c
tkbltStubLib.C
tkbltSwitch.C
tkbltVecCmd.C
tkbltVecOp.C
tkbltVecMath.C
tkbltVector.C
"
for i in $vars; do
case $i in
......@@ -5729,8 +5729,8 @@ src/tkbltVector.C
vars="
src/tkbltVector.h
src/tkbltDecls.h
generic/tkbltVector.h
generic/tkbltDecls.h
"
for i in $vars; do
# check for existence, be strict because it is installed
......@@ -5742,7 +5742,7 @@ src/tkbltDecls.h
vars="-I./src"
vars=""
for i in $vars; do
PKG_INCLUDES="$PKG_INCLUDES $i"
done
......@@ -5763,12 +5763,11 @@ src/tkbltDecls.h
done
#if test "windows" = "${TEA_PLATFORM}"; then
#TEA_ADD_CFLAGS([-TP -EHsc -D_CRT_SECURE_NO_WARNINGS -D_USE_MATH_DEFINES])
#fi
PKG_CFLAGS="$PKG_CFLAGS "
vars="src/tkbltStubLib.C"
vars="tkbltStubLib.C"
for i in $vars; do
# check for existence - allows for generic/win/unix VPATH
if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \
......@@ -5815,8 +5814,7 @@ src/tkbltDecls.h
# TEA_ADD_* any platform specific compiler/build info here.
#--------------------------------------------------------------------
#CLEANFILES="$CLEANFILES pkgIndex.tcl"
CLEANFILES="$CLEANFILES tkbltConfig.sh"
CLEANFILES="$CLEANFILES"
if test "${TEA_PLATFORM}" = "windows" ; then
# Ensure no empty if clauses
:
......
......@@ -72,64 +72,66 @@ TEA_SETUP_COMPILER
#-----------------------------------------------------------------------
TEA_ADD_SOURCES([
src/tkbltChain.C
src/tkbltConfig.C
src/tkbltGrAxis.C
src/tkbltGrAxisOp.C
src/tkbltGrAxisOption.C
src/tkbltGrBind.C
src/tkbltGrElemOp.C
src/tkbltGrElemOption.C
src/tkbltGrElem.C
src/tkbltGrElemBar.C
src/tkbltGrElemLine.C
src/tkbltGrElemLineSpline.C
src/tkbltGrHairs.C
src/tkbltGrHairsOp.C
src/tkbltGrLegd.C
src/tkbltGrLegdOp.C
src/tkbltGrMarkerOp.C
src/tkbltGrMarkerOption.C
src/tkbltGrMarker.C
src/tkbltGrMarkerLine.C
src/tkbltGrMarkerPolygon.C
src/tkbltGrMarkerText.C
src/tkbltGrMisc.C
src/tkbltGrPenOp.C
src/tkbltGrPenOption.C
src/tkbltGrPen.C
src/tkbltGrPenBar.C
src/tkbltGrPenLine.C
src/tkbltGrPostscript.C
src/tkbltGrPostscriptOp.C
src/tkbltGrPSOutput.C
src/tkbltGrText.C
src/tkbltGrXAxisOp.C
src/tkbltGraph.C
src/tkbltGraphBar.C
src/tkbltGraphLine.C
src/tkbltGraphOp.C
src/tkbltGraphSup.C
src/tkbltInt.C
src/tkbltNsUtil.C
src/tkbltParse.C
src/tkbltOp.C
src/tkbltStubInit.c
src/tkbltStubLib.C
src/tkbltSwitch.C
src/tkbltVecCmd.C
src/tkbltVecOp.C
src/tkbltVecMath.C
src/tkbltVector.C
tkbltChain.C
tkbltConfig.C
tkbltGrAxis.C
tkbltGrAxisOp.C
tkbltGrAxisOption.C
tkbltGrBind.C
tkbltGrElemOp.C
tkbltGrElemOption.C
tkbltGrElem.C
tkbltGrElemBar.C
tkbltGrElemLine.C
tkbltGrElemLineSpline.C
tkbltGrHairs.C
tkbltGrHairsOp.C
tkbltGrLegd.C
tkbltGrLegdOp.C
tkbltGrMarkerOp.C
tkbltGrMarkerOption.C
tkbltGrMarker.C
tkbltGrMarkerLine.C
tkbltGrMarkerPolygon.C
tkbltGrMarkerText.C
tkbltGrMisc.C
tkbltGrPenOp.C
tkbltGrPenOption.C
tkbltGrPen.C
tkbltGrPenBar.C
tkbltGrPenLine.C
tkbltGrPostscript.C
tkbltGrPostscriptOp.C
tkbltGrPSOutput.C
tkbltGrText.C
tkbltGrXAxisOp.C
tkbltGraph.C
tkbltGraphBar.C
tkbltGraphLine.C
tkbltGraphOp.C
tkbltGraphSup.C
tkbltInt.C
tkbltNsUtil.C
tkbltParse.C
tkbltOp.C
tkbltStubInit.c
tkbltStubLib.C
tkbltSwitch.C
tkbltVecCmd.C
tkbltVecOp.C
tkbltVecMath.C
tkbltVector.C
])
TEA_ADD_HEADERS([
src/tkbltVector.h
src/tkbltDecls.h
generic/tkbltVector.h
generic/tkbltDecls.h
])
TEA_ADD_INCLUDES([-I./src])
TEA_ADD_INCLUDES([])
TEA_ADD_LIBS([-lstdc++])
TEA_ADD_CFLAGS([])
TEA_ADD_STUB_SOURCES([src/tkbltStubLib.C])
#if test "windows" = "${TEA_PLATFORM}"; then
#TEA_ADD_CFLAGS([-TP -EHsc -D_CRT_SECURE_NO_WARNINGS -D_USE_MATH_DEFINES])
#fi
TEA_ADD_STUB_SOURCES([tkbltStubLib.C])
TEA_ADD_TCL_SOURCES([library/graph.tcl])
#--------------------------------------------------------------------
......@@ -144,8 +146,7 @@ TEA_ADD_TCL_SOURCES([library/graph.tcl])
# TEA_ADD_* any platform specific compiler/build info here.
#--------------------------------------------------------------------
#CLEANFILES="$CLEANFILES pkgIndex.tcl"
CLEANFILES="$CLEANFILES tkbltConfig.sh"
CLEANFILES="$CLEANFILES"
if test "${TEA_PLATFORM}" = "windows" ; then
# Ensure no empty if clauses
:
......
......@@ -438,23 +438,6 @@
Sets the color of the axis and tick labels. The default
is black.
<B>-command</B> <I>prefix</I>
Specifies a Tcl command to be invoked when formatting the
axis tick labels. <I>Prefix</I> is a string containing the name
of a Tcl proc and any extra arguments for the procedure.
This command is invoked for each major tick on the axis.
Two additional arguments are passed to the procedure: the
pathname of the widget and the current the numeric value
of the tick. The procedure returns the formatted tick
label. If "" is returned, no label will appear next to
the tick. You can get the standard tick labels again by
setting <I>prefix</I> to "". The default is "".
Please note that this procedure is invoked while the
graph is redrawn. You may query configuration options.
But do not them, because this can have unexpected
results.
<B>-descending</B> <I>boolean</I>
Indicates whether the values along the axis are monotoni-
cally increasing or decreasing. If <I>boolean</I> is true, the
......@@ -542,6 +525,31 @@
Specifies the font for axis tick labels. The default is
*-Courier-Bold-R-Normal-*-100-*.
<B>-tickformat</B> <I>formatStr</I>
Specifies a printf-like description to format teh axis
tick labels. You can get the standard tick labels again by
setting <I>formatStr</I> to "". The default is "".
<B>-tickformatcommand</B>, <B>-command</B> <I>prefix</I>
Specifies a Tcl command to be invoked when formatting the
axis tick labels. <I>Prefix</I> is a string containing the name
of a Tcl proc and any extra arguments for the procedure.
This command is invoked for each major tick on the axis.
Two additional arguments are passed to the procedure: the
pathname of the widget and the current the numeric value
of the tick. The procedure returns the formatted tick
label. If "" is returned, no label will appear next to
the tick. You can get the standard tick labels again by
setting <I>prefix</I> to "". The default is "".
The numeric value for the tick might change when using the
<B>-logscale</B> and <B>-tickformat</B> options.
Please note that this procedure is invoked while the
graph is redrawn. You may query configuration options.
But do not them, because this can have unexpected
results.
<B>-ticklength</B> <I>pixels</I>
Sets the length of major and minor ticks (minor ticks are
half the length of major ticks). If <I>pixels</I> is less than
......
......@@ -686,21 +686,6 @@ the element is always the first tag in the list. The default value is
Sets the color of the axis and tick labels.
The default is \f(CWblack\fR.
.TP
\fB\-command \fIprefix\fR
Specifies a Tcl command to be invoked when formatting the axis tick
labels. \fIPrefix\fR is a string containing the name of a Tcl proc and
any extra arguments for the procedure. This command is invoked for each
major tick on the axis. Two additional arguments are passed to the
procedure: the pathname of the widget and the current the numeric
value of the tick. The procedure returns the formatted tick label. If
\f(CW""\fR is returned, no label will appear next to the tick. You can
get the standard tick labels again by setting \fIprefix\fR to
\f(CW""\fR. The default is \f(CW""\fR.
.sp 1
Please note that this procedure is invoked while the graph is redrawn.
You may query configuration options. But do not them, because this
can have unexpected results.
.TP
\fB\-descending \fIboolean\fR
Indicates whether the values along the axis are monotonically increasing or
decreasing. If \fIboolean\fR is true, the axis values will be
......@@ -810,6 +795,29 @@ displayed. The default is \f(CW2\fR.
Specifies the font for axis tick labels. The default is
\f(CW*-Courier-Bold-R-Normal-*-100-*\fR.
.TP
\fB\-tickformat\fR \fIformatStr\fR
Specifies a printf-like description to format teh axis
tick labels. You can get the standard tick labels again by
setting \fIformatStr\fR to \f(CW""\fR. The default is \f(CW""\fR.
.TP
\fB\-tickformatcommand\fR, \fB\-command \fIprefix\fR
Specifies a Tcl command to be invoked when formatting the axis tick
labels. \fIPrefix\fR is a string containing the name of a Tcl proc and
any extra arguments for the procedure. This command is invoked for each
major tick on the axis. Two additional arguments are passed to the
procedure: the pathname of the widget and the current the numeric
value of the tick. The procedure returns the formatted tick label. If
\f(CW""\fR is returned, no label will appear next to the tick. You can
get the standard tick labels again by setting \fIprefix\fR to
\f(CW""\fR. The default is \f(CW""\fR.
.sp 1
The numeric value for the tick might change when using the
\fB\-logscale\fR and \fB\-tickformat\fR options.
.sp 1
Please note that this procedure is invoked while the graph is redrawn.
You may query configuration options. But do not them, because this
can have unexpected results.
.TP
\fB\-ticklength \fIpixels\fR
Sets the length of major and minor ticks (minor ticks are half the
length of major ticks). If \fIpixels\fR is less than zero, the axis
......
......@@ -9,64 +9,64 @@ extern "C" {
*/
/* 0 */
EXTERN int Blt_CreateVector(Tcl_Interp*interp,
TKBLT_STORAGE_CLASS int Blt_CreateVector(Tcl_Interp*interp,
const char *vecName, int size,
Blt_Vector**vecPtrPtr);
/* 1 */
EXTERN int Blt_CreateVector2(Tcl_Interp*interp,
TKBLT_STORAGE_CLASS int Blt_CreateVector2(Tcl_Interp*interp,
const char *vecName, const char *cmdName,
const char *varName, int initialSize,
Blt_Vector **vecPtrPtr);
/* 2 */
EXTERN int Blt_DeleteVectorByName(Tcl_Interp*interp,
TKBLT_STORAGE_CLASS int Blt_DeleteVectorByName(Tcl_Interp*interp,
const char *vecName);
/* 3 */
EXTERN int Blt_DeleteVector(Blt_Vector *vecPtr);
TKBLT_STORAGE_CLASS int Blt_DeleteVector(Blt_Vector *vecPtr);
/* 4 */
EXTERN int Blt_GetVector(Tcl_Interp*interp, const char *vecName,
TKBLT_STORAGE_CLASS int Blt_GetVector(Tcl_Interp*interp, const char *vecName,
Blt_Vector **vecPtrPtr);
/* 5 */
EXTERN int Blt_GetVectorFromObj(Tcl_Interp*interp,
TKBLT_STORAGE_CLASS int Blt_GetVectorFromObj(Tcl_Interp*interp,
Tcl_Obj *objPtr, Blt_Vector **vecPtrPtr);
/* 6 */
EXTERN int Blt_ResetVector(Blt_Vector *vecPtr, double *dataArr,
TKBLT_STORAGE_CLASS int Blt_ResetVector(Blt_Vector *vecPtr, double *dataArr,
int n, int arraySize, Tcl_FreeProc *freeProc);
/* 7 */
EXTERN int Blt_ResizeVector(Blt_Vector *vecPtr, int n);
TKBLT_STORAGE_CLASS int Blt_ResizeVector(Blt_Vector *vecPtr, int n);
/* 8 */
EXTERN int Blt_VectorExists(Tcl_Interp*interp,
TKBLT_STORAGE_CLASS int Blt_VectorExists(Tcl_Interp*interp,
const char *vecName);
/* 9 */
EXTERN int Blt_VectorExists2(Tcl_Interp*interp,
TKBLT_STORAGE_CLASS int Blt_VectorExists2(Tcl_Interp*interp,
const char *vecName);
/* 10 */
EXTERN Blt_VectorId Blt_AllocVectorId(Tcl_Interp*interp,
TKBLT_STORAGE_CLASS Blt_VectorId Blt_AllocVectorId(Tcl_Interp*interp,
const char *vecName);
/* 11 */
EXTERN int Blt_GetVectorById(Tcl_Interp*interp,
TKBLT_STORAGE_CLASS int Blt_GetVectorById(Tcl_Interp*interp,
Blt_VectorId clientId,
Blt_Vector **vecPtrPtr);
/* 12 */
EXTERN void Blt_SetVectorChangedProc(Blt_VectorId clientId,
TKBLT_STORAGE_CLASS void Blt_SetVectorChangedProc(Blt_VectorId clientId,
Blt_VectorChangedProc *proc,
ClientData clientData);
/* 13 */
EXTERN void Blt_FreeVectorId(Blt_VectorId clientId);
TKBLT_STORAGE_CLASS void Blt_FreeVectorId(Blt_VectorId clientId);
/* 14 */
EXTERN const char * Blt_NameOfVectorId(Blt_VectorId clientId);
TKBLT_STORAGE_CLASS const char * Blt_NameOfVectorId(Blt_VectorId clientId);
/* 15 */
EXTERN const char * Blt_NameOfVector(Blt_Vector *vecPtr);
TKBLT_STORAGE_CLASS const char * Blt_NameOfVector(Blt_Vector *vecPtr);
/* 16 */
EXTERN int Blt_ExprVector(Tcl_Interp*interp, char *expr,
TKBLT_STORAGE_CLASS int Blt_ExprVector(Tcl_Interp*interp, char *expr,
Blt_Vector *vecPtr);
/* 17 */
EXTERN void Blt_InstallIndexProc(Tcl_Interp*interp,
TKBLT_STORAGE_CLASS void Blt_InstallIndexProc(Tcl_Interp*interp,
const char *indexName,
Blt_VectorIndexProc *procPtr);
/* 18 */
EXTERN double Blt_VecMin(Blt_Vector *vPtr);
TKBLT_STORAGE_CLASS double Blt_VecMin(Blt_Vector *vPtr);
/* 19 */
EXTERN double Blt_VecMax(Blt_Vector *vPtr);
TKBLT_STORAGE_CLASS double Blt_VecMax(Blt_Vector *vPtr);
typedef struct TkbltStubs {
int magic;
......
This diff is collapsed.
......@@ -114,7 +114,7 @@ namespace Blt {
int showTicks;
double windowSize;
const char *formatCmd;
const char *tickFormatCmd;
int descending;
int labelOffset;
TextStyleOptions limitsTextStyle;
......@@ -153,6 +153,8 @@ namespace Blt {
Tk_Font tickFont;
Tk_Font titleFont;
XColor* titleColor;
const char *tickFormat;
} AxisOptions;
class Axis {
......@@ -175,8 +177,8 @@ namespace Blt {
Chain* chain;
Point2d titlePos_;
unsigned short int titleWidth_;
unsigned short int titleHeight_;
unsigned int titleWidth_;
unsigned int titleHeight_;
double min_;
double max_;
double scrollMin_;
......@@ -194,14 +196,14 @@ namespace Blt {
Segment2d *segments_;
int nSegments_;
Chain* tickLabels_;
short int left_;
short int right_;
short int top_;
short int bottom_;
short int width_;
short int height_;
short int maxTickWidth_;
short int maxTickHeight_;
int left_;
int right_;
int top_;
int bottom_;
int width_;
int height_;
int maxTickWidth_;
int maxTickHeight_;
Tk_Anchor tickAnchor_;
GC tickGC_;
GC activeTickGC_;
......
......@@ -36,6 +36,7 @@
#include "tkbltGrAxis.h"
#include "tkbltGrAxisOp.h"
#include "tkbltGrMisc.h"
#include "tkbltInt.h"
using namespace Blt;
......@@ -554,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);
......
......@@ -35,6 +35,7 @@
#include "tkbltGrAxis.h"
#include "tkbltGrAxisOption.h"
#include "tkbltConfig.h"
#include "tkbltInt.h"
using namespace Blt;
......@@ -215,8 +216,7 @@ static void TicksFreeProc(ClientData clientData, Tk_Window tkwin,
char *ptr)
{
Ticks* ticksPtr = *(Ticks**)ptr;
if (ticksPtr)
delete ticksPtr;
delete ticksPtr;
}
static Tk_CustomOptionSetProc ObjectSetProc;
......
......@@ -160,8 +160,7 @@ void BindTable::doEvent(XEvent* eventPtr)
const char** tagArray = graphPtr_->getTags(item, classId, &nTags);
Tk_BindEvent(table_, eventPtr, graphPtr_->tkwin_, nTags, (void**)tagArray);
if (tagArray)
delete [] tagArray;
delete [] tagArray;
}
void BindTable::pickItem(XEvent* eventPtr)
......
......@@ -37,6 +37,7 @@
#include "tkbltGrBind.h"
#include "tkbltGrElem.h"
#include "tkbltGrPen.h"
#include "tkbltInt.h"
using namespace Blt;
......@@ -52,14 +53,12 @@ ElemValues::ElemValues()
ElemValues::~ElemValues()
{
if (values_)
delete [] values_;
delete [] values_;
}
void ElemValues::reset()
{
if (values_)
delete [] values_;
delete [] values_;
values_ =NULL;
nValues_ =0;
min_ =0;
......@@ -133,8 +132,7 @@ int ElemValuesVector::fetchValues(Blt_Vector* vector)
{
Graph* graphPtr = elemPtr_->graphPtr_;
if (values_)
delete [] values_;
delete [] values_;
values_ = NULL;
nValues_ = 0;
min_ =0;
......@@ -200,11 +198,9 @@ Element::~Element()
if (hashPtr_)
Tcl_DeleteHashEntry(hashPtr_);
if (name_)
delete [] name_;
delete [] name_;
if (activeIndices_)
delete [] activeIndices_;
delete [] activeIndices_;
Tk_FreeConfigOptions((char*)ops_, optionTable_, graphPtr_->tkwin_);
free(ops_);
......
......@@ -156,8 +156,8 @@ namespace Blt {
Graph* graphPtr_;
const char* name_;
Tcl_HashEntry* hashPtr_;
unsigned short row_;
unsigned short col_;
unsigned row_;
unsigned col_;
int nActiveIndices_;
int* activeIndices_;
int active_;
......
......@@ -41,6 +41,7 @@
#include "tkbltGrDef.h"
#include "tkbltConfig.h"
#include "tkbltGrPSOutput.h"
#include "tkbltInt.h"
using namespace Blt;
......@@ -227,8 +228,7 @@ BarElement::~BarElement()
{
BarElementOptions* ops = (BarElementOptions*)ops_;
if (builtinPenPtr)
delete builtinPenPtr;
delete builtinPenPtr;
reset();
......@@ -272,14 +272,14 @@ void BarElement::map()
return;
int nPoints = NUMBEROFPOINTS(ops);
double barWidth = (ops->barWidth > 0.0f) ? ops->barWidth : gops->barWidth;
double barWidth = (ops->barWidth > 0.0) ? ops->barWidth : gops->barWidth;
AxisOptions* axisyops = (AxisOptions*)ops->yAxis->ops();
double baseline = (axisyops->logScale) ? 0.0 : gops->baseline;
double barOffset = barWidth * 0.5;
// Create an array of bars representing the screen coordinates of all the
// segments in the bar.
XRectangle* bars = new XRectangle[nPoints];
Rectangle* bars = new Rectangle[nPoints];
int* barToData = new int[nPoints];
double* x = ops->coords.x->values_;
......@@ -287,7 +287,7 @@ void BarElement::map()
int count = 0;
int ii;
XRectangle* rp;
Rectangle* rp;
for (rp=bars, ii=0; ii<nPoints; ii++) {
// Two opposite corners of the rectangle in graph coordinates
Point2d c1, c2;
......@@ -428,13 +428,15 @@ void BarElement::map()
continue;
int height = (int)dy;
int width = (int)dx;
if (invertBar)
rp->y = (short int)MIN(c1.y, c2.y);
rp->y = (int)MIN(c1.y, c2.y);
else
rp->y = (short int)(MAX(c1.y, c2.y)) - height;
rp->y = (int)(MAX(c1.y, c2.y)) - height;
rp->x = (short int)MIN(c1.x, c2.x);
rp->width = (short int)dx + 1;
rp->x = (int)MIN(c1.x, c2.x);
rp->width = width + 1;
rp->width |= 0x1;
if (rp->width < 1)
rp->width = 1;
......@@ -621,7 +623,7 @@ void BarElement::closest()
int imin = 0;
int ii;
XRectangle* bp;
Rectangle* bp;