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 504 - Gradient using incorrect start and end positions when the shape is partially out of the ChartRect
Summary: Gradient using incorrect start and end positions when the shape is partially ...
Status: RESOLVED FIXED
Alias: None
Product: VCL TeeChart
Classification: Unclassified
Component: Canvas (show other bugs)
Version: 131119
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Steema Issue Manager
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-05 04:40 EST by yeray alonso
Modified: 2013-12-16 10:56 EST (History)
1 user (show)

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


Attachments
Scroll up or down and you'll see how the gradient changes to fill the new shape (2.18 KB, application/octet-stream)
2013-12-05 04:40 EST, yeray alonso
Details

Note You need to log in before you can comment on or make changes to this bug.
Description yeray alonso 2013-12-05 04:40:13 EST
Created attachment 50 [details]
Scroll up or down and you'll see how the gradient changes to fill the new shape

Having a TColorBandTool with a Gradient set from StartValue to EndValue, if you scroll the chart making the TColorBandTool to partially out of the ChartRect, the Gradient start and end are recalculated to fill the new shape. It should be clipped, not recalculated.

http://www.teechart.net/support/viewtopic.php?f=1&t=14548
Comment 1 david berneda 2013-12-16 07:35:40 EST
This problem is quite complicate to fix.

The ColorBand rectangle is restricted to axis boundaries to avoid drawing it outside the Chart rectangle (and to avoid potential GDI or GDI+ limitations if bounds are very very big).

Gradient filling color positions are not calculated by the ColorBand. It is done at the canvas level, where it has no knowledge of the "real" big boundaries.

However, at least in GDI+ we can use the already existing Gradient CustomTargetRectangle property, which is a TRect that overrides the current rectangle to fill.

I'll try using this property in ColorBand, when Gradient is Visible.
Comment 2 david berneda 2013-12-16 10:56:34 EST
Fixed. It wasn' difficult to fix.
When gradient is visible, Gradient.CustomTargetRectangle property is set to the "real" bounding rectangle instead of the clipped one.