Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 1 of 1 total
Thread TSlideShow Bug in 2.03
Thu, Nov 12 2015 10:07 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Founds this while updating the online demos:  the TSlideShow control has a bug in it from the Random() changes, so be very careful about your own projects if they use Random().  This is the only control in the standard component library that uses it.

I'll be uploading a new 2.03 B2 to fix this soon.

The hot fix:

WebSlide.pas

procedure TSlideImageElement.DoLoaded;
var
  TempOffsetX: Double;
  TempOffsetY: Double;
begin
  inherited DoLoaded;
  FSourceRect.Assign(0,0,ActualWidth,ActualHeight);
  FSourceRect.Fit(FSlideShow.Canvas.Width,FSlideShow.Canvas.Height);
  FDestRect.Assign(FSourceRect);
  if (FScale < 1) then
     FDestRect.Scale(FScale);
  if FPan then
     begin
     TempOffsetX:=((Floor((Random(0,100)/100)*3)-1)/2);  <<<<<<<<<<<<<<<<
     TempOffsetY:=((Floor((Random(0,100)/100)*3)-1)/2);  <<<<<<<<<<<<<<<<
     FDestRect.Offset((FDestRect.Left*TempOffsetX),
                      (FDestRect.Top*TempOffsetX));
     end;
  FSlideShow.ImageElementLoaded(Self);
end;

Tim Young
Elevate Software
www.elevatesoft.com
Image