fix: custom scale, dpi (#13197)
Some checks are pending
CI / ${{ matrix.job.target }} (${{ matrix.job.os }}) (map[os:ubuntu-22.04 target:x86_64-unknown-linux-gnu]) (push) Waiting to run
Full Flutter CI / run-ci (push) Waiting to run

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou 2025-10-17 12:35:43 -04:00 committed by GitHub
parent d55974c352
commit 6a0da9cf09
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1927,8 +1927,12 @@ class CanvasModel with ChangeNotifier {
}
_devicePixelRatio = ui.window.devicePixelRatio;
if (kIgnoreDpi && style == kRemoteViewStyleOriginal) {
_scale = 1.0 / _devicePixelRatio;
if (kIgnoreDpi) {
if (style == kRemoteViewStyleOriginal) {
_scale = 1.0 / _devicePixelRatio;
} else if (_scale != 0 && style == kRemoteViewStyleCustom) {
_scale /= _devicePixelRatio;
}
}
_resetCanvasOffset(displayWidth, displayHeight);
final overflow = _x < 0 || y < 0;