[GME-commit] GMESRC/GME/Gme PannButton.cpp,1.4,1.5 GMEView.cpp,1.140,1.141

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Thu May 6 15:39:43 CDT 2004


Update of /var/lib/gme/GMESRC/GME/Gme
In directory braindrain:/tmp/cvs-serv7238

Modified Files:
	PannButton.cpp GMEView.cpp 
Log Message:
center zoom even picture is smaller than client area

CVS User: bogyom

Index: PannButton.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Gme/PannButton.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** PannButton.cpp	6 May 2004 17:49:48 -0000	1.4
--- PannButton.cpp	6 May 2004 19:39:41 -0000	1.5
***************
*** 69,72 ****
--- 69,73 ----
  	m_bitmapSizeStored = actsize;
  	m_backgorund = bkgrnd;
+ 
  	Invalidate();
  	UpdateWindow();
***************
*** 138,146 ****
  	GetParent()->GetClientRect(&clientr);
  	CBrush brush;
! 	DWORD dw = GetSysColor(COLOR_3DFACE);
! 	BYTE r = GetRValue(dw);
! 	BYTE g = GetGValue(dw); 
! 	BYTE b = GetBValue(dw); 
! 	brush.CreateSolidBrush(RGB(r,g,b));
  	dc.FillRect(&clientr, &brush);
  
--- 139,154 ----
  	GetParent()->GetClientRect(&clientr);
  	CBrush brush;
! 	COLORREF col;
! 	if (!m_bitmapDC)
! 	{
! 		DWORD dw = GetSysColor(COLOR_3DFACE);
! 		BYTE r = GetRValue(dw);
! 		BYTE g = GetGValue(dw); 
! 		BYTE b = GetBValue(dw); 
! 		col = RGB(r,g,b);
! 	}
! 	else
! 		col = m_backgorund;
! 	brush.CreateSolidBrush(col); 
  	dc.FillRect(&clientr, &brush);
  

Index: GMEView.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Gme/GMEView.cpp,v
retrieving revision 1.140
retrieving revision 1.141
diff -C2 -d -r1.140 -r1.141
*** GMEView.cpp	6 May 2004 17:47:32 -0000	1.140
--- GMEView.cpp	6 May 2004 19:39:41 -0000	1.141
***************
*** 5976,5981 ****
  		CRect client(0,0,0,0);
  		GetClientRect(&client);
! 		point.x = client.Width()/2;
! 		point.y = client.Height()/2;
  		setZoomPoint(curzoom, point);
  		Invalidate();
--- 5976,6001 ----
  		CRect client(0,0,0,0);
  		GetClientRect(&client);
! 
! 		CRect rect;
! 		GetClientRect(&rect);
! 
! 		CRect objext, annext, extent;
! 		CGuiObject::GetExtent(children, objext);
! 		CGuiAnnotator::GetExtent(annotators, annext);
! 		extent.UnionRect(&objext, &annext);
! 		extent.right = (int)(extent.right*EXTENT_ERROR_CORR); // ??
! 		extent.bottom = (int)(extent.bottom*EXTENT_ERROR_CORR); // ??
! 		CSize s(extent.right, extent.bottom);
! 
! 		CWindowDC dc(NULL);
! 		dc.SetMapMode(MM_ISOTROPIC);
! 		dc.SetWindowExt(100,100);
! 		dc.SetViewportExt(curzoom, curzoom);
! 		CPoint expoint(extent.right, extent.bottom);
! 		dc.LPtoDP((LPPOINT)&expoint);
! 
! 		point.x = (expoint.x < client.Width())? point.x = expoint.x/2 :point.x = client.Width()/2;
! 		point.y = (expoint.y < client.Height())? point.y = expoint.y/2 :point.y = client.Height()/2;
! 		
  		setZoomPoint(curzoom, point);
  		Invalidate();



More information about the GME-commit mailing list