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 554

Summary: KeepAspectRatio allows to have the mouse pointer at a different position to the edge of the ZoomRect, resulting in a strange zooming area
Product: VCL TeeChart Reporter: yeray alonso <yeray>
Component: AxisAssignee: 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=14626
Chart Series: --- Delphi / C++ Builder RAD IDE Version:
Attachments: test project

Description yeray alonso 2014-01-28 11:49:15 EST
Created attachment 78 [details]
test project

With KeepAspectRatio=true, the ZoomRect being drawn tries to keep the aspect ratio of the original chart.
The zoom rectangle being drawn is always proportional. However, when you release the mouse button, the area zoomed in is the area from the mouse position, not the area the zoom rectangle is defining.
Note the top-left edge of the ZoomRect is always the mouse position where the MouseDown is made, but with KeepAspectRatio the bottom-right edge of the ZoomRect can be far below or far on the right side of the mouse position.

See the project attached and the images on it.
Comment 1 david berneda 2014-01-30 09:52:15 EST
Fixed. The problem was Chart MouseUp was forcing the ending zoom rectangle coordinates (X1,Y1) to be the mouse cursor position at mouseup.
Comment 2 david berneda 2014-01-30 09:54:08 EST
Also improved how is the zoom rectangle calculated when KeepAspectRatio=True.
Now it follows better the mouse cursor position, either at bottom or right side.