Ignore:
Timestamp:
Apr 16, 2024, 10:57:39 AM (4 weeks ago)
Author:
chronos
Message:
  • Fixed: Map drawing in case of fractional scaling.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/DpiControls/Dpi.Graphics.pas

    r506 r538  
    692692  SrcPtr: TPixelPointer;
    693693  DstPtr: TPixelPointer;
    694   xx, yy: Integer;
    695   SrcX, SrcY: Integer;
    696   DstX, DstY: Integer;
    697   DstWidth, DstHeight: Integer;
    698 begin
    699   //Dst.Canvas.StretchDraw(Rect(0, 0, ScaleToNative(Dst.Width), ScaleToNative(Dst.Height)), Src);
    700   //Exit;
     694  XX, YY: Integer;
     695  DstPixelX, DstPixelY: Integer;
     696  DstPixelWidth, DstPixelHeight: Integer;
     697begin
    701698  Dst.BeginUpdate;
    702699  SrcPtr := TPixelPointer.Create(Src, 0, 0);
    703700  DstPtr := TPixelPointer.Create(Dst, 0, 0);
    704   {for yy := 0 to Dst.Height - 1 do begin
    705     for xx := 0 to Dst.Width - 1 do begin
    706       SrcPtr.SetXY(Min(ScaleFromNative(xx), Src.Width - 1),
    707         Min(ScaleFromNative(yy), Src.Height - 1));
    708       DstPtr.PixelB := SrcPtr.PixelB;
    709       DstPtr.PixelG := SrcPtr.PixelG;
    710       DstPtr.PixelR := SrcPtr.PixelR;
    711       DstPtr.NextPixel;
    712     end;
    713     DstPtr.NextLine;
    714   end;
    715   }
    716   for SrcY := 0 to Src.Height - 1 do begin
    717     DstHeight := ScaleToNative(SrcY + 1) - ScaleToNative(SrcY);
    718     for DstY := 0 to DstHeight - 1 do begin
    719       for SrcX := 0 to Src.Width - 1 do begin
    720         DstWidth := ScaleToNative(SrcX + 1) - ScaleToNative(SrcX);
    721         for DstX := 0 to DstWidth - 1 do begin
     701  for YY := 0 to Src.Height - 1 do begin
     702    DstPixelHeight := ScaleToNative(YY + 1) - ScaleToNative(YY);
     703    for DstPixelY := 0 to DstPixelHeight - 1 do begin
     704      for XX := 0 to Src.Width - 1 do begin
     705        DstPixelWidth := ScaleToNative(XX + 1) - ScaleToNative(XX);
     706        for DstPixelX := 0 to DstPixelWidth - 1 do begin
    722707          DstPtr.PixelB := SrcPtr.PixelB;
    723708          DstPtr.PixelG := SrcPtr.PixelG;
Note: See TracChangeset for help on using the changeset viewer.