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 - Exporting to Metafile with checkboxes in the legend gives unaligned checkboxes from v2013.09
Summary: Exporting to Metafile with checkboxes in the legend gives unaligned checkboxe...
Status: RESOLVED FIXED
Alias: None
Product: VCL TeeChart
Classification: Unclassified
Component: Export (show other bugs)
Version: 131119
Hardware: PC Windows
: --- enhancement
Target Milestone: ---
Assignee: Steema Issue Manager
URL: http://www.teechart.net/support/viewt...
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-18 07:16 EDT by yeray alonso
Modified: 2014-03-19 13:21 EDT (History)
1 user (show)

See Also:
Chart Series: ---
Delphi / C++ Builder RAD IDE Version:


Attachments
Metafile with checkboxes in the legend (1.60 KB, application/octet-stream)
2014-03-18 07:16 EDT, yeray alonso
Details
screenshots (108.27 KB, application/octet-stream)
2014-03-19 13:07 EDT, yeray alonso
Details

Note You need to log in before you can comment on or make changes to this bug.
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( ...