forked from firka/flutter
Fix DPR in test view configuration (#88609)
This commit is contained in:
@@ -1732,7 +1732,7 @@ class TestViewConfiguration extends ViewConfiguration {
|
||||
TestViewConfiguration._(Size size, ui.FlutterView window)
|
||||
: _paintMatrix = _getMatrix(size, window.devicePixelRatio, window),
|
||||
_hitTestMatrix = _getMatrix(size, 1.0, window),
|
||||
super(size: size);
|
||||
super(size: size, devicePixelRatio: window.devicePixelRatio);
|
||||
|
||||
static Matrix4 _getMatrix(Size size, double devicePixelRatio, ui.FlutterView window) {
|
||||
final double inverseRatio = devicePixelRatio / window.devicePixelRatio;
|
||||
|
||||
@@ -24,6 +24,11 @@ void main() {
|
||||
// The code below will throw without the default.
|
||||
TestViewConfiguration(size: const Size(1280.0, 800.0));
|
||||
});
|
||||
|
||||
test('sets the DPR to match the window', () {
|
||||
final TestViewConfiguration configuration = TestViewConfiguration(size: const Size(1280.0, 800.0));
|
||||
expect(configuration.devicePixelRatio, binding.window.devicePixelRatio);
|
||||
});
|
||||
});
|
||||
|
||||
group(AutomatedTestWidgetsFlutterBinding, () {
|
||||
|
||||
Reference in New Issue
Block a user