anchor.diff:  
     //adjust range
     if HorzScrollbar.Visible then
  -    HorzScrollbar.Range:= ANewWidth;
  +    HorzScrollbar.Range:= NewWidth;
     if VertScrollBar.Visible then
  -    VertScrollbar.Range:= ANewHeight;
  +    VertScrollbar.Range:= NewHeight;
   
     DoScroll;
   end;
  
positive.code:   end;
  
    //Restore saved center position
    if AKeepPosition then
    begin
      if ANewLeft = 0 then
      begin
        AScrollMaxX:= Max(ANewWidth - AWidth, 0);
        HorzScrollBar.Position:=
          Min(AScrollMaxX, Trunc(ACenterRatioX * ANewWidth) - AWidth div 2);
      end
      else
        HorzScrollBar.Position:= 0;
  
      if ANewTop = 0 then
      begin
        AScrollMaxY:= Max(ANewHeight - AHeight, 0);
        VertScrollBar.Position:=
          Min(AScrollMaxY, Trunc(ACenterRatioY * ANewHeight) - AHeight div 2);
      end
      else
        VertScrollBar.Position:= 0;
  
negative.code:     {
      //Note: code commented in as it causes wrong scaling sometimes.
      //If image is already fit, don't scale it:
      if (FImage.Width = CliWidth) and
        (FImage.Height = CliHeight) then
      begin
        NewWidth:= FImage.Width;
        NewHeight:= FImage.Height;
      end
      else
      }
      //Need to scale
      begin
        NewWidth:= FImageWidth;
        NewHeight:= FImageHeight;
  
        if FImageFitOnlyBig and
          (FImageWidth <= CliWidth) and (FImageHeight <= CliHeight) then
        begin
          FImageScale:= 100;
        end
        else
        begin
          if (CliWidth > 0) and (CliHeight > 0) and
            (FImageWidth > 0) and (FImageHeight > 0) then
          begin
            NRatio:= CliWidth / CliHeight;
            NImageRatio:= FImageWidth / FImageHeight;
            if ((NRatio >= NImageRatio) and (not FImageFitWidth)) or FImageFitHeight then
            begin
              //fit height
              if FImageFitOnlyBig and (CliHeight >= FImageHeight) then begin end
              else
              begin
                NewHeight:= CliHeight;
                NewWidth:= Trunc(NewHeight * NImageRatio);
                FImageScale:= CliHeight * 100 div FImageHeight;
              end;
            end
            else
            begin
              //fit width
              if FImageFitOnlyBig and (CliWidth >= FImageWidth) then begin end
              else
              begin
                NewWidth:= CliWidth;
                NewHeight:= Trunc(NewWidth / NImageRatio);
                FImageScale:= CliWidth * 100 div FImageWidth;
              end;
            end;
          end;
  