Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

Bug in Zooming

 Post Reply Post Reply
Author
White Dave View Drop Down
Member
Member
Avatar

Joined: 03 Jun 2012
Posts: 42
Post Options Post Options   Quote White Dave Quote  Post ReplyReply Direct Link To This Post Topic: Bug in Zooming
    Posted: 08 Jul 2016 at 10:37pm
When doing the control/zoom on a chart, the result of the zoom differs depending on whether you zoom from bottom right to top left or vice/versa. Tracing through the code to TChartPane.DoZoomIn procedure, there appears to be an error in one of the else if statements (cut and paste error?).

if (CtrlZooming = czYAxis) or (CtrlZooming = czBoth) then
    begin
      if (FRy - FCy) > 0 then
      begin
        Series.ForceInit(true);
        Series.Mode := cmScaling;
        for I := 0 to Series.Count - 1 do
        begin
          Series.AutoRange := arDisabled;
          pmin := Series.YToValue(FRy, FSeriesRect);
          pmax := Series.YToValue(FCy, FSeriesRect);
          if pmax - pmin > ZOOMMIN then
          begin
            TCrackedChartSerie(Series).MinimumValue := pmin;
            TCrackedChartSerie(Series).MaximumValue := pmax;
          end;
        end;
        Chart.InitializeChart(ChartView.Canvas, FRect, 1, 1);
      end
      else if (FRy - FCy) > 0 then                    <= this branch will never get called!!
      begin
        Series.ForceInit(true);
        Series.Mode := cmScaling;
        for I := 0 to Series.Count - 1 do
        begin
          Series.AutoRange := arDisabled;
          pmin := Series.YToValue(FCy, FSeriesRect);
          pmax := Series.YToValue(FRy, FSeriesRect);
          if pmax - pmin > ZOOMMIN then
          begin
            TCrackedChartSerie(Series).MinimumValue := pmin;
            TCrackedChartSerie(Series).MaximumValue := pmax;
          end;
        end;
        Chart.InitializeChart(ChartView.Canvas, FRect, 1, 1);
      end;
    end;
Back to Top
Pieter Scheldeman View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 3392
Post Options Post Options   Quote Pieter Scheldeman Quote  Post ReplyReply Direct Link To This Post Posted: 08 Jul 2016 at 11:49pm
Hi, 

We have fixed this here, the next version will address this.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down