Gtk3: renamed deviceScaleRatio to canvasScaleFactor.

This commit is contained in:
zeljan1 2025-01-09 09:34:22 +01:00
parent 34844aa934
commit 6d55565da2
3 changed files with 11 additions and 11 deletions

View File

@ -1191,7 +1191,7 @@ var
Gtk3DC: TGtk3DeviceContext absolute DC;
begin
if (Gtk3DC <> nil) then
gtk3DC.DeviceScaleRatio := AScaleRatio;
gtk3DC.CanvasScaleFactor := AScaleRatio;
end;
//##apiwiz##eps## // Do not remove, no wizard declaration after this line

View File

@ -213,7 +213,7 @@ type
FvClipRect: TRect;
FCurrentPen: TGtk3Pen;
FBkMode: Integer;
FDeviceScaleRatio: double;
FCanvasScaleFactor: double;
function GetOffset: TPoint;
procedure setBrush(AValue: TGtk3Brush);
procedure SetFont(AValue: TGtk3Font);
@ -288,7 +288,7 @@ type
property CurrentPen: TGtk3Pen read FCurrentPen write FCurrentPen;
property CurrentRegion: TGtk3Region read FCurrentRegion;
property CurrentTextColor: TColorRef read FCurrentTextColor write FCurrentTextColor;
property DeviceScaleRatio: double read FDeviceScaleRatio write SetCanvasScaleFactor;
property CanvasScaleFactor: double read FCanvasScaleFactor write SetCanvasScaleFactor;
property Offset: TPoint read GetOffset write SetOffset;
property OwnsSurface: Boolean read FOwnsSurface;
property vBrush: TGtk3Brush read FBrush write setBrush;
@ -1475,7 +1475,7 @@ begin
' FromPaintEvent:',BoolToStr(APaintEvent),' )');
{$endif}
inherited Create;
FDeviceScaleRatio := 1;
FCanvasScaleFactor := 1;
FvClipRect := Rect(0, 0, 0, 0);
Window := nil;
Parent := nil;
@ -1550,7 +1550,7 @@ begin
' FromPaintEvent:',BoolToStr(APaintEvent),' )');
{$endif}
inherited Create;
FDeviceScaleRatio := 1;
FCanvasScaleFactor := 1;
FvClipRect := Rect(0, 0, 0, 0);
Parent := nil;
ParentPixmap := nil;
@ -1580,7 +1580,7 @@ begin
' FromPaintEvent:',BoolToStr(True),' )');
{$endif}
inherited Create;
FDeviceScaleRatio := 1;
FCanvasScaleFactor := 1;
FOwnsCairo := False;
Window := nil;
Parent := AWidget;
@ -2421,11 +2421,11 @@ procedure TGtk3DeviceContext.SetCanvasScaleFactor(const AValue: double);
var
matrix: Tcairo_matrix_t;
begin
if FDeviceScaleRatio <> AValue then
if FCanvasScaleFactor <> AValue then
begin
FDeviceScaleRatio := AValue;
FCanvasScaleFactor := AValue;
cairo_get_matrix(pcr, @matrix);
cairo_matrix_scale(@matrix, FDeviceScaleRatio, FDeviceScaleRatio);
cairo_matrix_scale(@matrix, FCanvasScaleFactor, FCanvasScaleFactor);
cairo_set_matrix(pcr, @matrix);
end;
end;

View File

@ -3996,8 +3996,8 @@ begin
{$ENDIF}
if Assigned(SrcContext.pcr) and SrcContext.OwnsSurface then
begin
Width := Round(Width / SrcContext.DeviceScaleRatio);
Height := Round(Height / SrcContext.DeviceScaleRatio);
Width := Round(Width / SrcContext.CanvasScaleFactor);
Height := Round(Height / SrcContext.CanvasScaleFactor);
end;
ATargetRect := Rect(X, Y, Width + X, Height + Y);
ASrcRect := Rect(XSrc, YSrc, SrcWidth + XSrc, SrcHeight + YSrc);