FW: VGUI Bug for Small Text Canvas?
I did not see Dr. Wampler's quick fix posted to the discussion list, so
here it is. This problem occurs only if the user resizes the text
canvas so small that no text is visible.
- Steve
-----Original Message-----
From: Dr. Stephen K. Young
Sent: Tuesday, December 01, 1998 10:56 AM
To: 'bruce@objectcentral.com'
Subject: RE: VGUI Bug for Small Text Canvas?
Thanks for the quick fix!
Adding your extra checks for (maxRows < 1) and (maxCols < 1) did solve
the problem.
- Steve
-----Original Message-----
From: Bruce Wampler [mailto:bruce@objectcentral.com]
Sent: Monday, November 30, 1998 7:30 PM
To: Dr. Stephen K. Young
Subject: Re: VGUI Bug for Small Text Canvas?
This is reayy wierd. This bug has been in V ever since the start, as
nearly
as I can tell, and had not been found. Yet I got TWO separate reports,
finally, within a day! Strange!
Try this:
// Bug fix for windows too small on Windows.
// Apply the following pathc to /v/srcwin/vtextcnv.cpp
// The changes are for maxRows or maxCols <= 0
//===================>>> vTextCanvasPane::ResizeText
<<<======================
void vTextCanvasPane::ResizeText(void)
{
// determine how many rows and columns we have
cHeight = TextHeight(cAscent, cDescent);
if (cHeight == 0)
cHeight = 1;
cWidth = TextWidth("c"); // Use "c" as average char
maxRows = (_height-(2*MARGIN)) / cHeight; // how many rows
if (maxRows < 1)
maxRows = 1;
if (maxRows > rowsAllocated)
maxRows = rowsAllocated;
maxCols = (_width-(2*MARGIN)) / cWidth;
if (maxCols < 1)
maxCols = 1;
Bruce E. Wampler, Ph.D.
Author of the V C++ GUI Framework
e-mail: mailto:bruce@objectcentral.com
web: http://www.objectcentral.com
Reply to: