void Dimensions(void) { boolish keyOnGraph; xrange = samplemap[nsamples - 1] - samplemap[0]; xrange = max(xrange, auxxrange); if (xrange == 0.0) xrange = 1.0; /* avoid division by 0.0 */ yrange = MaxCombinedHeight(); yrange = max(yrange, auxyrange); if (yrange == 0.0) yrange = 1.0; /* avoid division by 0.0 */ if (!bflag && !sflag) { bflag = strlen(jobstring) > SMALL_JOB_STRING_WIDTH; } if (bflag) { titleheight = 2 * TITLE_HEIGHT; } else { titleheight = TITLE_HEIGHT; } keyOnGraph = !multipageflag && TWENTY != 0; graphwidth = titlewidth - graphx0 - (keyOnGraph ? KeyWidth() : 0); graphheight = borderheight - titleheight - (2 * borderspace) - graphy0; }
static void Dimensions(void) { xrange = sampletable[ nsamples - 1 ]-sampletable[0]; if (fixedYRange >= 0) { yrange = fixedYRange; } else { if (showMax) yrange = maxDouble(maxValue, MaxCombinedHeight()); /* If the stack is large then maxValue<MaxCombinedHeight. */ else yrange = MaxCombinedHeight(); } graphwidth = titlewidth - graphx0 - KeyWidth(); graphheight = borderheight - titleheight - (2 * borderspace) - graphy0; #if DEBUG_DIMENSIONS printf("xrange: %5.2f, yrange: %5.2f, graphwidth: %5.2f and graphheight: %5.2f \n", xrange, yrange, graphwidth, graphheight); printf("MaxCombinedHeight: %5.2f\n", MaxCombinedHeight()); printf("maxValue: %5.2f\n", maxValue); #endif return; }