Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 643

Summary: Exporting to Metafile with checkboxes in the legend gives unaligned checkboxes from v2013.09
Product: VCL TeeChart Reporter: yeray alonso <yeray>
Component: ExportAssignee: Steema Issue Manager <issuemanager>
Status: RESOLVED FIXED    
Severity: enhancement CC: david
Priority: ---    
Version: 131119   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
URL: http://www.teechart.net/support/viewtopic.php?f=3&t=14775&p=65295#p65295
Chart Series: --- Delphi / C++ Builder RAD IDE Version:
Attachments: Metafile with checkboxes in the legend
screenshots

Description yeray alonso 2014-03-18 07:16:27 EDT
Created attachment 121 [details]
Metafile with checkboxes in the legend

Exporting to Metafile with checkboxes in the legend gives unaligned checkboxes from v2013.09.

It works fine in GDI, not in GDI+ in v2013.09 and above.
It worked fine in 2013.08.

See the attached project.
Comment 1 david berneda 2014-03-19 12:55:33 EDT
It worked fine with GDI+ in 2013.08 ?

There is nothing in the code that makes a difference GDI vs GDI+
Comment 2 yeray alonso 2014-03-19 13:07:18 EDT
Created attachment 125 [details]
screenshots

Yes. If I run the project attached in Delphi 7

With v2013.08:
- GDI+ gives aligned checkboxes in the legend
- GDI gives aligned checkboxes in the legend

With v2013.09 and up:
- GDI+ gives unaligned checkboxes in the legend
- GDI gives aligned checkboxes in the legend

See the images attached
Comment 3 david berneda 2014-03-19 13:12:37 EDT
This is very strange.
The displacement equals to checkbox height, but only when the chart canvas is GDI+.

When drawing the checkbox, the chart GDI or GDI+ canvas is not used at all. 
Checkbox is drawn using Windows API call and only using the TMetafileCanvas.
The vertical coordinate is exactly the same in both canvas.
Comment 4 david berneda 2014-03-19 13:21:02 EDT
Fixed. 
The fix is not very appropiate but solves the problem for now, until the real cause can be discovered.

if (ParentChart.Canvas.ReferenceCanvas is TMetafileCanvas) and  ParentChart.Canvas.SupportsAlpha then
 Inc(tmpY,13);

TeeDrawCheckBox( ...