Changeset 254


Ignore:
Timestamp:
May 23, 2020, 12:55:52 AM (4 years ago)
Author:
chronos
Message:
  • Fixed: Build DpiScrollDC under Linux.
Location:
branches/highdpi
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/highdpi/LocalPlayer/Term.pas

    r252 r254  
    41904190    offscreen.Canvas.Font.Assign(UniFont[ftSmall]);
    41914191    rec := Rect(0, 0, MapWidth, MapHeight);
    4192     DpiScrollDC(offscreen.Canvas.Handle, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt,
     4192    DpiScrollDC(offscreen.Canvas, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt,
    41934193      rec, rec, 0, nil);
    41944194    for DoInvalidate := false to FastScrolling do
     
    41974197      begin
    41984198        rec.Bottom := MapHeight - overlap;
    4199         DpiScrollDC(Canvas.Handle, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt, rec,
     4199        DpiScrollDC(Canvas, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt, rec,
    42004200          rec, 0, nil);
    42014201        ProcessOptions := prInvalidate;
  • branches/highdpi/Packages/DpiControls/UDpiControls.pas

    r253 r254  
    941941function DpiBitBltCanvas(Dest: TDpiCanvas; X, Y, Width, Height: Integer; Src: TDpiCanvas; XSrc, YSrc: Integer; Rop: DWORD = SRCCOPY): Boolean;
    942942function DpiCreateRectRgn(X1, Y1, X2, Y2: Integer): HRGN;
    943 function DpiScrollDC(hDC:HDC; dx:longint; dy:longint; const lprcScroll:RECT; const lprcClip:RECT;hrgnUpdate:HRGN; lprcUpdate: LPRECT): WINBOOL;
     943function DpiScrollDC(Canvas: TDpiCanvas; dx: Longint; dy: Longint; const lprcScroll: TRect;
     944  const lprcClip:TRect; hrgnUpdate: Handle; lprcUpdate: PRect): Boolean;
    944945function ScaleToNative(Value: Integer): Integer;
    945946function ScaleFromNative(Value: Integer): Integer;
     
    984985end;
    985986
    986 {$IFDEF LINUX}
    987 function LinuxScrollDC(Canvas: TDpiCanvas; dx: longint; dy: longint; const lprcScroll:TRect; const lprcClip:TRect; hrgnUpdate:HRGN; lprcUpdate: PRect):Boolean;
    988 begin
    989 end;
    990 {$ENDIF}
    991 
    992 function DpiScrollDC(hDC: HDC; dx: longint; dy: longint;
    993   const lprcScroll: RECT; const lprcClip: RECT; hrgnUpdate: HRGN;
    994   lprcUpdate: LPRECT): WINBOOL;
     987function DpiScrollDC(Canvas: TDpiCanvas; dx: Longint; dy: Longint;
     988  const lprcScroll: TRect; const lprcClip: TRect; hrgnUpdate: Handle;
     989  lprcUpdate: PRect): Boolean;
    995990begin
    996991  {$IFDEF WINDOWS}
    997   Result := Windows.ScrollDC(hDC, ScaleToNative(dx), ScaleToNative(dy),
     992  Result := Windows.ScrollDC(Canvas.Handle, ScaleToNative(dx), ScaleToNative(dy),
    998993    ScaleRectToNative(lprcScroll), ScaleRectToNative(lprcClip),
    999994    hrgnUpdate, lprcUpdate);
     
    1001996  {$IFDEF LINUX}
    1002997  // Can't do scrolling of DC under Linux, then fallback into BitBlt.
    1003   Result := DpiBitCanvas(Canvas, lprcScroll.Left + dx, lprcScroll.Top + dy, lprcScroll.Right - lprcScroll.Left, lprcScroll.Bottom - lprcScroll.Top,
     998  Result := DpiBitBltCanvas(Canvas, lprcScroll.Left + dx, lprcScroll.Top + dy, lprcScroll.Right - lprcScroll.Left, lprcScroll.Bottom - lprcScroll.Top,
    1004999    Canvas, lprcScroll.Left, lprcScroll.Top);
    10051000  {$ENDIF}
Note: See TracChangeset for help on using the changeset viewer.