Page 1 of 1

Problem with zooming and keeping the aspect ratio

Posted: Thu Jan 23, 2014 9:55 am
by 16568029
Hi,

I have a problem zooming and keeping the aspect ratio. I use the mouse to zoom, dragging the mouse down and right. When I release the mouse button, it seams that the redraw function uses the mouse position as the lower right corner of the zoom area and not the lower right corner of the ZoomRect.
If I am positioning the mouse exactly at the lower right corner of the ZoomRect and release the mouse button, I get the expected zoom. If I am positioning the mouse away from the lower right corner of the ZoomRect and release the mouse button, I get a zoom using the mouse position as the lower right corner, not keeping the aspect ratio.

I am using TeeChart Pro v2013.09.131119
If you want, I can send you a test project showing the problem.

What can I do?

Regards
RCTB

Re: Problem with zooming and keeping the aspect ratio

Posted: Fri Jan 24, 2014 10:17 am
by yeray
Hello,

Yes, it would be better if you could arrange a simple example project we can run as-is to reproduce the problem here. Well, in this case, where some interaction is needed, we may also need some step by step instructions.
I'm afraid I'm not sure to understand the instructions you provided. How can you release the mouse button in a different position than a ZoomRect corner? The ZoomRect is precisely the rectangle being drawn when you drag the mouse. Maybe you meant ChartRect instead of ZoomRect? The ChartRect is the rectangle limited by the chart axes; the area where the series are drawn.

Re: Problem with zooming and keeping the aspect ratio

Posted: Fri Jan 24, 2014 1:04 pm
by 16568029
Hello Yeray.
I have added a zip file with two pictures to describe the problem and a little project to reproduce the problem.

RCTB
Test Zoom.ZIP
TestZoom project
(78.98 KiB) Downloaded 371 times

Re: Problem with zooming and keeping the aspect ratio

Posted: Fri Jan 24, 2014 4:05 pm
by yeray
Hi,

A bit strange. This is what I do and what I obtain:
1.png
1.png (22.31 KiB) Viewed 8622 times
2.png
2.png (17.68 KiB) Viewed 8606 times
It looks correct, isn't it?
I'm using TeeChart v2013.09 and Delphi 7.
Could you please verify the paths are correct in your IDE? Just to make sure you are not using a previous installation.

Re: Problem with zooming and keeping the aspect ratio

Posted: Fri Jan 24, 2014 5:42 pm
by 16568029
Hi.
I forgot to mention that I use XE2.
I will first be back at the Delphi machine Tuesday and I will check the path as the first.
Your result looks as it shall, that is also what I get the most of the time but if I provokes the program just a little (not putting the mouse exact at the corner of the ZoomRect), it will give the result I was sending to you.

Regards
RCTB

Re: Problem with zooming and keeping the aspect ratio

Posted: Mon Jan 27, 2014 4:00 pm
by yeray
Hello,
RCTB wrote:I forgot to mention that I use XE2.
I've tried now your application with TeeChart Pro v2013.09 and XE2, and I still can see the complete red rectangle when I draw a zoom rectangle bigger than it.
I only see the red rectangle cut after the zoom if the zoom rectangle cuts the red rectangle, as I'd expect.
RCTB wrote:I will first be back at the Delphi machine Tuesday and I will check the path as the first.
Ok.
RCTB wrote:Your result looks as it shall, that is also what I get the most of the time but if I provokes the program just a little (not putting the mouse exact at the corner of the ZoomRect), it will give the result I was sending to you.
I still don't understand what do you mean. Since the ZoomRect is the rectangle that is drawn from the point where you click down the left mouse button to the point where you release the left mouse button, I don't see how you can put the mouse in a different position to the ZoomRect corner.

Re: Problem with zooming and keeping the aspect ratio

Posted: Tue Jan 28, 2014 10:26 am
by 16568029
Hello.

Now I have checked the library path and the only “Steema-path” I have is to TeeChart Pro 2013.

The problem is the KeepAspectRatio, when this is true the lower right corner of the ZoomRect is not following the mouse because it is keeping the aspectratio. Some times there is a big different between the lower right corner of the ZoomRect and the mouse and if you releases the mousebutton at this time you get the error.

Regards
RCTB

Re: Problem with zooming and keeping the aspect ratio

Posted: Tue Jan 28, 2014 4:51 pm
by yeray
Hello,
RCTB wrote:The problem is the KeepAspectRatio, when this is true the lower right corner of the ZoomRect is not following the mouse because it is keeping the aspectratio. Some times there is a big different between the lower right corner of the ZoomRect and the mouse and if you releases the mousebutton at this time you get the error.
I understood it now!
Here is the picture I made to explain where the mouse down and mouse up actions are made:
Picture before zoom showing mouse positions.png
Picture before zoom showing mouse positions.png (25.18 KiB) Viewed 8544 times
I've added it to the bug tracker system:
http://bugs.teechart.net/show_bug.cgi?id=554

Re: Problem with zooming and keeping the aspect ratio

Posted: Wed Jan 29, 2014 7:14 am
by 16568029
Hello.

Thank you for your help/reply, I look forward to a version with a fix :D .
Regards
RCTB

Re: Problem with zooming and keeping the aspect ratio

Posted: Wed Jan 29, 2014 9:00 am
by yeray
Hi,

You can subscribe to the ticket to receive updates directly to your mail account.