mirror of
https://github.com/flutter/flutter.git
synced 2026-02-03 17:51:05 +08:00
24 lines
796 B
Dart
24 lines
796 B
Dart
// Copyright 2014 The Flutter Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
// @dart = 2.8
|
|
|
|
import 'package:flutter/rendering.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
import 'rendering_tester.dart';
|
|
|
|
void main() {
|
|
group('RenderView', () {
|
|
test('accounts for device pixel ratio in paintBounds', () {
|
|
layout(RenderAspectRatio(aspectRatio: 1.0));
|
|
pumpFrame();
|
|
final Size logicalSize = renderer.renderView.configuration.size;
|
|
final double devicePixelRatio = renderer.renderView.configuration.devicePixelRatio;
|
|
final Size physicalSize = logicalSize * devicePixelRatio;
|
|
expect(renderer.renderView.paintBounds, Offset.zero & physicalSize);
|
|
});
|
|
});
|
|
}
|