Ignore:
Timestamp:
Sep 15, 2024, 1:31:30 PM (4 days ago)
Author:
chronos
Message:
  • Fixed: City screen rename right mouse click didn't work on Windows due to window title are. Change to behave the same way as on Linux.
  • Fixed: Allow full screen switching in editor and movie mode.
  • Modified: Precalculate scaling coefficients also for from native values conversions for faster speed.
File:
1 edited

Legend:

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

    r568 r617  
    354354    ToNative: Double;
    355355    FromNative: Double;
    356     Lookup: array[-10000..10000] of Integer; // Should be sufficient for 8K screens
     356    LookupToNative: array[-10000..10000] of Integer; // Should be sufficient for 8K screens
     357    LookupFromNative: array[-10000..10000] of Integer; // Should be sufficient for 8K screens
    357358    property Dpi: Integer read FDpi write SetDpi;
    358359  end;
     
    13531354  if FDpi = AValue then Exit;
    13541355  FDpi := AValue;
     1356
     1357  // Precalculate scaling coefficients
    13551358  ToNative := ScreenInfo.Dpi / 96;
    1356 
    1357   // Precalculate scaling coefficients
     1359  for I := Low(LookupToNative) to High(LookupToNative) do
     1360    LookupToNative[I] := Ceil(I * ToNative);
    13581361  FromNative := 96 / ScreenInfo.Dpi;
    1359   for I := Low(Lookup) to High(Lookup) do
    1360     Lookup[I] := Ceil(I * ToNative);
     1362  for I := Low(LookupFromNative) to High(LookupFromNative) do
     1363    LookupFromNative[I] := Floor(I * FromNative);
    13611364end;
    13621365
Note: See TracChangeset for help on using the changeset viewer.