Changeset 252 for branches/highdpi/LocalPlayer/Term.pas
- Timestamp:
- May 23, 2020, 12:45:14 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/highdpi/LocalPlayer/Term.pas
r251 r252 280 280 procedure LoadSettings; 281 281 procedure SaveSettings; 282 procedure OnScroll(var m: TMessage); message WM_VSCROLL;282 procedure OnScroll(var Msg: TMessage); message WM_VSCROLL; 283 283 procedure OnEOT(var Msg: TMessage); message WM_EOT; 284 284 procedure SoundPreload(Check: integer); … … 3620 3620 end; 3621 3621 3622 procedure TMainScreen.OnScroll(var m: TMessage);3623 begin 3624 if sb.Process( m) then begin3622 procedure TMainScreen.OnScroll(var Msg: TMessage); 3623 begin 3624 if sb.Process(Msg) then begin 3625 3625 PanelPaint; 3626 3626 Update; … … 3630 3630 procedure TMainScreen.OnEOT(var Msg: TMessage); 3631 3631 begin 3632 EndTurn 3632 EndTurn; 3633 3633 end; 3634 3634 … … 3638 3638 begin 3639 3639 MessgExDlg.CancelMovie; 3640 Server(sBreak, me, 0, nil^) 3640 Server(sBreak, me, 0, nil^); 3641 3641 end 3642 3642 else if ClientMode < 0 then … … 3647 3647 begin 3648 3648 Jump[pTurn] := 0; 3649 StartRunning := false 3649 StartRunning := false; 3650 3650 end 3651 3651 else 3652 EndTurn 3652 EndTurn; 3653 3653 end; 3654 3654 … … 4144 4144 end; 4145 4145 4146 {$IFDEF LINUX}4147 // Can't do scrolling of DC under Linux, then fallback into BitBlt.4148 function ScrollDC(Canvas: TDpiCanvas; dx: longint; dy: longint; const lprcScroll:TRect; const lprcClip:TRect; hrgnUpdate:HRGN; lprcUpdate: PRect):Boolean;4149 begin4150 Result := DpiBitCanvas(Canvas, lprcScroll.Left + dx, lprcScroll.Top + dy, lprcScroll.Right - lprcScroll.Left, lprcScroll.Bottom - lprcScroll.Top,4151 Canvas, lprcScroll.Left, lprcScroll.Top);4152 end;4153 {$ENDIF}4154 4155 4146 procedure TMainScreen.MainOffscreenPaint; 4156 4147 var … … 4199 4190 offscreen.Canvas.Font.Assign(UniFont[ftSmall]); 4200 4191 rec := Rect(0, 0, MapWidth, MapHeight); 4201 {$IFDEF WINDOWS} 4202 ScrollDC(offscreen.Canvas.Handle, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt, 4192 DpiScrollDC(offscreen.Canvas.Handle, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt, 4203 4193 rec, rec, 0, nil); 4204 {$ENDIF}4205 {$IFDEF LINUX}4206 ScrollDC(offscreen.Canvas, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt,4207 rec, rec, 0, nil);4208 {$ENDIF}4209 4194 for DoInvalidate := false to FastScrolling do 4210 4195 begin … … 4212 4197 begin 4213 4198 rec.Bottom := MapHeight - overlap; 4214 {$IFDEF WINDOWS} 4215 ScrollDC(Canvas.Handle, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt, rec, 4199 DpiScrollDC(Canvas.Handle, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt, rec, 4216 4200 rec, 0, nil); 4217 {$ENDIF}4218 {$IFDEF LINUX}4219 ScrollDC(Canvas, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt,4220 rec, rec, 0, nil);4221 {$ENDIF}4222 4201 ProcessOptions := prInvalidate; 4223 4202 end … … 5074 5053 if DpiMouse.CursorPos.x = 0 then 5075 5054 dx := -speed // scroll left 5076 else if DpiMouse.CursorPos.x = DpiScreen.width - 1 then5055 else if DpiMouse.CursorPos.x >= DpiScreen.width - 1 then 5077 5056 dx := speed; // scroll right 5078 5057 if DpiMouse.CursorPos.y = 0 then 5079 5058 dy := -speed // scroll up 5080 else if (DpiMouse.CursorPos.y = DpiScreen.height - 1) and5059 else if (DpiMouse.CursorPos.y >= DpiScreen.height - 1) and 5081 5060 (DpiMouse.CursorPos.x >= TerrainBtn.Left + TerrainBtn.width) and 5082 5061 (DpiMouse.CursorPos.x < xRightPanel + 10 - 8) then
Note:
See TracChangeset
for help on using the changeset viewer.