TTree zoom-behavior changed - how to get back the old one?

TeeTree VCL for Borland Delphi and C++ Builder.
Post Reply
Markus
Newbie
Newbie
Posts: 12
Joined: Wed Jan 07, 2009 12:00 am

TTree zoom-behavior changed - how to get back the old one?

Post by Markus » Tue May 19, 2009 11:47 am

Hello,

we upgraded simultaneously from TChart 7 to TChart 8 and from an older Delphi to Delphi 2009. We use the TTree rather extensively and also need the zoom functionality quite often. Now we discovered a change in behavior which is a problem for us.

OLD BEHAVIOR (the desired one):
When zooming in and out the center of the zoom is the center of the currently visible tree-area (client area of the component).

NEW BEHAVIOR:
When zooming in and out the center of the zoom is the center of the whole tree.

The new behavior has a big disadvantage: if you have a very large zoom factor to view small details and then use the mouse wheel to zoom out again it nearly always happens that the detail you just viewed kind of "runs away" to one of the edges of the component.

I think this is because while zooming in, the center of the tree is moved away from the center of the client area of the TTree component. When zooming out again, the center of the zoom operation is outside the client area thus making the content of the tree "heading" towards this spot.

I hope it is clear what I meant. If not, please say so and I'll try to clarify. This behavior is making zooming a real pain because to have one detail centered while zooming out you have to move it into the center of the client area again and again.

Thanks for reading, your time and hopefully help!

Markus-Heinrich

Markus
Newbie
Newbie
Posts: 12
Joined: Wed Jan 07, 2009 12:00 am

Post by Markus » Mon May 25, 2009 8:02 am

Was there anything changed in the zoom behavior between the releases? Maybe there are new properties to adjust this behavior which I don't know about yet.

Any ideas are much appreciated!

Markus
Newbie
Newbie
Posts: 12
Joined: Wed Jan 07, 2009 12:00 am

Post by Markus » Mon May 25, 2009 2:22 pm

Well I found the bug. It is in the following method:

Code: Select all

Procedure TView3DOptions.SetZoom(const Value:Double);
begin
  if FZoom<>Value then
  begin
    if Assigned(FOnChangedZoom) then FOnChangedZoom(Zoom); { <-- offending part! }

    FZoom:=Value;
    Repaint;
  end;
end;
The parameter given to the handler should not be Zoom, but Value - as it always was. It now would have to be rounded because of the type change, so the fix looks like this:

Code: Select all

    if Assigned(FOnChangedZoom) then FOnChangedZoom(round(Value));
Please, add this as fix to the next release, because otherwise the handling of our apps is considerably impaired!!

Thanks!

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

Post by Yeray » Mon May 25, 2009 3:25 pm

Hi Markus-Heinrich,

Thank you for reporting this. I've implemented you suggestion so it will be available with next releases.
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