From 6fef702cfaf58913f67979f725adcabc9bc55a0c Mon Sep 17 00:00:00 2001 From: Ian Hickson Date: Mon, 15 May 2017 13:30:24 -0700 Subject: [PATCH] Trivial fixes to dart:ui docs. (#3689) --- lib/ui/semantics.dart | 4 ++-- lib/ui/window.dart | 14 +++++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/ui/semantics.dart b/lib/ui/semantics.dart index cab175aeb..725804254 100644 --- a/lib/ui/semantics.dart +++ b/lib/ui/semantics.dart @@ -186,7 +186,7 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 { /// system. /// /// The `transform` is a matrix that maps this node's coodinate system into - /// its parent's coordate system. + /// its parent's coordinate system. void updateNode({ int id, int flags, @@ -197,7 +197,7 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 { Int32List children }) { if (transform.length != 16) - throw new ArgumentError("[transform] must have 16 entries."); + throw new ArgumentError('transform argument must have 16 entries.'); _updateNode(id, flags, actions, diff --git a/lib/ui/window.dart b/lib/ui/window.dart index d7f488d86..f0111814d 100644 --- a/lib/ui/window.dart +++ b/lib/ui/window.dart @@ -110,6 +110,16 @@ class Window { /// The number of device pixels for each logical pixel. This number might not /// be a power of two. Indeed, it might not even be an integer. For example, /// the Nexus 6 has a device pixel ratio of 3.5. + /// + /// Device pixels are also referred to as physical pixels. Logical pixels are + /// also referred to as device-independent or resolution-independent pixels. + /// + /// By definition, there are roughly 38 logical pixels per centimeter, or + /// about 96 logical pixels per inch, of the physical display. The value + /// returned by [devicePixelRatio] is ultimately obtained either from the + /// hardware itself, the device drivers, or a hard-coded value stored in the + /// operating system or firmware, and may be inaccurate, sometimes by a + /// significant margin. double get devicePixelRatio => _devicePixelRatio; double _devicePixelRatio = 1.0; @@ -127,7 +137,9 @@ class Window { WindowPadding _padding = WindowPadding.zero; /// A callback that is invoked whenever the [devicePixelRatio], - /// [physicalSize], or [padding] values change. + /// [physicalSize], or [padding] values change, for example when the device is + /// rotated or when the application is resized (e.g. when showing applications + /// side-by-side on Android). VoidCallback onMetricsChanged; /// The system-reported locale. -- GitLab