Problem: 1606095

Title: (Example -QuickDraw3D View) Real axis values are different from visual value

Received: Nov 20 1996 10:29AM


When opening the QuickDraw2D window, the visual values in "Malor Axis" and "Minor Axis" are different from real values in object. To reproduce the bug: I think the problem is that the visual value isn't synchronized at intialization, particularly in TMyQD3DBoxView::DoPostCreate().
void TMyQD3DBoxView::DoPostCreate(TDocument* itsDocument) 
{
  ...			
  //BoxData	
  float           ambience    = 0.8;
  TQ3ColorRGB     theColor    = {0.0,0.0,0.0};
  TQ3Point3D      origin      = {0,0,0};
  TQ3Vector3D     orientation = {0,1.0,0}; 
  TQ3Vector3D     majorAxis   = {0,0,2.0};
  TQ3Vector3D     minorAxis   = {2.0,0,0};
		
  fBox = new TQD3DBox;
  fBox->IQD3DBox(ambience,theColor,origin,orientation,majorAxis,minorAxis);
}
Those values need setting back to view (TNumberText objects), or should be read from view object (it's better, void hard code). Of course, the cheaper fix is to change the values in .rsrc resource.
Fix: The bug was in incorrect calls to get/set Box properties such as major and minor axis. By fixing these calls, the initial state would reflect the view state, and clicking in an edit field wouldn't cause it to suddenly change.