Problem with zooming and keeping the aspect ratio

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
RCTB
Newbie
Newbie
Posts: 5
Joined: Fri Dec 13, 2013 12:00 am

Problem with zooming and keeping the aspect ratio

Post by RCTB » Thu Jan 23, 2014 9:55 am

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

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Problem with zooming and keeping the aspect ratio

Post by Yeray » Fri Jan 24, 2014 10:17 am

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.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

RCTB
Newbie
Newbie
Posts: 5
Joined: Fri Dec 13, 2013 12:00 am

Re: Problem with zooming and keeping the aspect ratio

Post by RCTB » Fri Jan 24, 2014 1:04 pm

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

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Problem with zooming and keeping the aspect ratio

Post by Yeray » Fri Jan 24, 2014 4:05 pm

Hi,

A bit strange. This is what I do and what I obtain:
1.png
1.png (22.31 KiB) Viewed 8616 times
2.png
2.png (17.68 KiB) Viewed 8600 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.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

RCTB
Newbie
Newbie
Posts: 5
Joined: Fri Dec 13, 2013 12:00 am

Re: Problem with zooming and keeping the aspect ratio

Post by RCTB » Fri Jan 24, 2014 5:42 pm

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

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Problem with zooming and keeping the aspect ratio

Post by Yeray » Mon Jan 27, 2014 4:00 pm

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.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

RCTB
Newbie
Newbie
Posts: 5
Joined: Fri Dec 13, 2013 12:00 am

Re: Problem with zooming and keeping the aspect ratio

Post by RCTB » Tue Jan 28, 2014 10:26 am

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

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Problem with zooming and keeping the aspect ratio

Post by Yeray » Tue Jan 28, 2014 4:51 pm

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 8538 times
I've added it to the bug tracker system:
http://bugs.teechart.net/show_bug.cgi?id=554
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

RCTB
Newbie
Newbie
Posts: 5
Joined: Fri Dec 13, 2013 12:00 am

Re: Problem with zooming and keeping the aspect ratio

Post by RCTB » Wed Jan 29, 2014 7:14 am

Hello.

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

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Problem with zooming and keeping the aspect ratio

Post by Yeray » Wed Jan 29, 2014 9:00 am

Hi,

You can subscribe to the ticket to receive updates directly to your mail account.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply