[vtk-developers] [VTK 0013206]: vtkQtStringToImage::GetBounds doesn't take into account the rotation of the text

Mantis Bug Tracker mantis at public.kitware.com
Sat May 26 05:20:27 EDT 2012


The following issue has been SUBMITTED. 
====================================================================== 
http://www.vtk.org/Bug/view.php?id=13206 
====================================================================== 
Reported By:                Arnaud BARRE
Assigned To:                
====================================================================== 
Project:                    VTK
Issue ID:                   13206
Category:                   (No Category)
Reproducibility:            have not tried
Severity:                   minor
Priority:                   normal
Status:                     backlog
Project:                    Release 
Type:                       incorrect functionality 
Resolution:                 open
Fixed in Version:           
====================================================================== 
Date Submitted:             2012-05-26 05:20 EDT
Last Modified:              2012-05-26 05:20 EDT
====================================================================== 
Summary:                    vtkQtStringToImage::GetBounds doesn't take into
account the rotation of the text
Description: 
For both type of strings (vtkStdString, vtkUnicodeString), the Qt text renderer
doesn't take the orientation of the text as the FreeType text renderer do.

For both GetBounds methods, the code line 107-110 and line 138-141

QRectF rect;
QPainterPath path;
path.addText(0, 0, fontSpec, text);
rect = path.boundingRect();

could be replaced by this one:

QRectF rect;
QPainterPath path;
path.addText(0, 0, fontSpec, text);
QMatrix mat;
mat.rotate(-property->GetOrientation());
path = mat.map(path);
rect = path.boundingRect();

The result of this modification is visible in the uploaded picture.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-05-26 05:20 Arnaud BARRE   New Issue                                    
2012-05-26 05:20 Arnaud BARRE   File Added: vtkQtStringImageGetBoundsFix.png    
               
======================================================================




More information about the vtk-developers mailing list