[GME-commit] 
	GMESRC/GME/MgaDecorators StereotypeDecorators.cpp,1.11,1.12
    gme-commit at list.isis.vanderbilt.edu 
    gme-commit at list.isis.vanderbilt.edu
       
    Sat Jul 17 04:45:33 CDT 2004
    
        - Previous message: [GME-commit] 
	GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep Any.cpp,1.9,1.10
	Any.h,1.5,1.6 AspectRep.cpp,1.9,1.10 Broker.cpp,1.6,1.7
	ConnectionRep.cpp,1.5,1.6 ConnectionRep.h,1.2,1.3
	Dumper.cpp,1.21,1.22 FCO.cpp,1.8,1.9 FCO.h,1.3,1.4
	FolderRep.cpp,1.6,1.7 Sheet.cpp,1.5,1.6 Sheet.h,1.3,1.4
- Next message: [GME-commit] GMESRC/GME/Gme GMEApp.cpp,1.117,1.118
-  Messages sorted by: 
              [ date ]
              [ thread ]
              [ subject ]
              [ author ]
         
  
Update of /var/lib/gme/GMESRC/GME/MgaDecorators
In directory braindrain:/tmp/cvs-serv24756
Modified Files:
	StereotypeDecorators.cpp 
Log Message:
Fixed calculations of text extent in the default decorator (JIRA GME-20)
.
CVS User: volgy
Index: StereotypeDecorators.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/MgaDecorators/StereotypeDecorators.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** StereotypeDecorators.cpp	14 Nov 2003 08:28:01 -0000	1.11
--- StereotypeDecorators.cpp	17 Jul 2004 08:45:30 -0000	1.12
***************
*** 381,397 ****
  CRect DecoratorBase::getLabelLocation() const
  {
! 	LOGFONT logFont;
! 	getFacilities().getFont( m_iFontKey )->pFont->GetLogFont( &logFont );
  	CPoint pt = getLabelPosition();
  	ECoordRefPoint eAlign = getAlignment();
  
! 	int iX = 0;
! 	for ( int i = 0 ; i < m_vecName.size() ; i++ )
! 		iX = max( m_vecName[ i ].GetLength(), iX );
! 	CSize cSize( logFont.lfWidth * iX, logFont.lfHeight );
  	if ( eAlign == CRP_CENTER )
  		pt.x -= cSize.cx / 2;
  	else if ( eAlign == CRP_END )
  		pt.x -= cSize.cx;
  
  	return CRect( pt.x, pt.y, pt.x + cSize.cx, pt.y + cSize.cy );
--- 381,403 ----
  CRect DecoratorBase::getLabelLocation() const
  {
! 
  	CPoint pt = getLabelPosition();
  	ECoordRefPoint eAlign = getAlignment();
  
! 	CDC dc;
! 	dc.CreateCompatibleDC(NULL);
! 	dc.SelectObject(getFacilities().getFont( m_iFontKey )->pFont);
! 	CSize cSize(0,0);
! 	for ( int i = 0 ; i < m_vecName.size() ; i++ ) {
! 		CSize tmpSize = dc.GetTextExtent(m_vecName[ i ]);
! 		cSize.cy += tmpSize.cy;
! 		cSize.cx = max (cSize.cx, tmpSize.cx);
! 	}
! 
  	if ( eAlign == CRP_CENTER )
  		pt.x -= cSize.cx / 2;
  	else if ( eAlign == CRP_END )
  		pt.x -= cSize.cx;
+ 
  
  	return CRect( pt.x, pt.y, pt.x + cSize.cx, pt.y + cSize.cy );
    
    
        
	- Previous message: [GME-commit] 
	GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep Any.cpp,1.9,1.10
	Any.h,1.5,1.6 AspectRep.cpp,1.9,1.10 Broker.cpp,1.6,1.7
	ConnectionRep.cpp,1.5,1.6 ConnectionRep.h,1.2,1.3
	Dumper.cpp,1.21,1.22 FCO.cpp,1.8,1.9 FCO.h,1.3,1.4
	FolderRep.cpp,1.6,1.7 Sheet.cpp,1.5,1.6 Sheet.h,1.3,1.4
- Next message: [GME-commit] GMESRC/GME/Gme GMEApp.cpp,1.117,1.118
-  Messages sorted by: 
              [ date ]
              [ thread ]
              [ subject ]
              [ author ]
         
More information about the GME-commit
mailing list