From 6d55565da20355acf432e601a9b139dadaab2c56 Mon Sep 17 00:00:00 2001 From: zeljan1 Date: Thu, 9 Jan 2025 09:34:22 +0100 Subject: [PATCH] Gtk3: renamed deviceScaleRatio to canvasScaleFactor. --- lcl/interfaces/gtk3/gtk3lclintf.inc | 2 +- lcl/interfaces/gtk3/gtk3objects.pas | 16 ++++++++-------- lcl/interfaces/gtk3/gtk3winapi.inc | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lcl/interfaces/gtk3/gtk3lclintf.inc b/lcl/interfaces/gtk3/gtk3lclintf.inc index 2c8088376e..cf4e6c0152 100644 --- a/lcl/interfaces/gtk3/gtk3lclintf.inc +++ b/lcl/interfaces/gtk3/gtk3lclintf.inc @@ -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 diff --git a/lcl/interfaces/gtk3/gtk3objects.pas b/lcl/interfaces/gtk3/gtk3objects.pas index 6caff04bea..b46a3e775c 100644 --- a/lcl/interfaces/gtk3/gtk3objects.pas +++ b/lcl/interfaces/gtk3/gtk3objects.pas @@ -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; diff --git a/lcl/interfaces/gtk3/gtk3winapi.inc b/lcl/interfaces/gtk3/gtk3winapi.inc index cbb940e21a..3edf7f06d6 100644 --- a/lcl/interfaces/gtk3/gtk3winapi.inc +++ b/lcl/interfaces/gtk3/gtk3winapi.inc @@ -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);