1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
--- a/src/bltGraph.c
+++ b/src/bltGraph.c
@@ -2018,19 +2018,21 @@
return TCL_ERROR;
}
Tk_SizeOfImage(tkImage, &iw, &ih);
- reqWidth = iw;
- reqHeight = ih;
- if (args.flags & MAXPECT) {
- double xs, ys;
+ if (iw > 0 && ih > 0) {
+ reqWidth = iw;
+ reqHeight = ih;
+ if (args.flags & MAXPECT) {
+ double xs, ys;
- xs = (double)iw / w;
- ys = (double)ih / h;
- if (xs > ys) {
- reqWidth = (int)(w * ys);
- reqHeight = (int)(h * ys);
- } else {
- reqWidth = (int)(w * xs);
- reqHeight = (int)(h * xs);
+ xs = (double)iw / w;
+ ys = (double)ih / h;
+ if (xs > ys) {
+ reqWidth = (int)(w * ys);
+ reqHeight = (int)(h * ys);
+ } else {
+ reqWidth = (int)(w * xs);
+ reqHeight = (int)(h * xs);
+ }
}
}
}
--- a/src/bltGrLine2.c
+++ b/src/bltGrLine2.c
@@ -3740,7 +3740,7 @@
if (elemPtr->yHigh.numValues > p->index) {
yHigh = elemPtr->yHigh.values[p->index];
} else if (elemPtr->yError.numValues > p->index) {
- yHigh = elemPtr->y.values[p->index] -
+ yHigh = elemPtr->y.values[p->index] +
elemPtr->yError.values[p->index];
} else {
yHigh = Blt_NaN();
|