mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 23:08:05 +02:00
Qt5, Qt6: fixed setting scale factor on normal monitors without scaling. issue #41330
This commit is contained in:
parent
395b854b3c
commit
d50b1f2b9b
@ -874,9 +874,12 @@ var
|
||||
begin
|
||||
if IsValidDC(DC) and (QtDC.vImage <> nil) and (QtDC.vImage.Handle <> nil) then
|
||||
begin
|
||||
QPainter_end(QtDC.Widget);
|
||||
QImage_setDevicePixelRatio(QtDC.vImage.Handle, AScaleFactor);
|
||||
QPainter_begin(QtDC.Widget, QtDC.vImage.Handle);
|
||||
if not SameValue(AScaleFactor, QImage_devicePixelRatio(QtDC.vImage.Handle)) then
|
||||
begin
|
||||
QPainter_end(QtDC.Widget);
|
||||
QImage_setDevicePixelRatio(QtDC.vImage.Handle, AScaleFactor);
|
||||
QPainter_begin(QtDC.Widget, QtDC.vImage.Handle);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -893,9 +893,12 @@ var
|
||||
begin
|
||||
if IsValidDC(DC) and (QtDC.vImage <> nil) and (QtDC.vImage.Handle <> nil) then
|
||||
begin
|
||||
QPainter_end(QtDC.Widget);
|
||||
QImage_setDevicePixelRatio(QtDC.vImage.Handle, AScaleFactor);
|
||||
QPainter_begin(QtDC.Widget, QtDC.vImage.Handle);
|
||||
if not SameValue(AScaleFactor, QImage_devicePixelRatio(QtDC.vImage.Handle)) then
|
||||
begin
|
||||
QPainter_end(QtDC.Widget);
|
||||
QImage_setDevicePixelRatio(QtDC.vImage.Handle, AScaleFactor);
|
||||
QPainter_begin(QtDC.Widget, QtDC.vImage.Handle);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user