@@ -29,33 +29,33 @@ var Dimensions = require('Dimensions');
2929 * });
3030 * <Image source={image} style={{width: 200, height: 100}} />
3131 * ```
32- *
32+ *
3333 * ## Pixel grid snapping
34- *
35- * In iOS, you can specify positions and dimensions for elements with arbitrary
34+ *
35+ * In iOS, you can specify positions and dimensions for elements with arbitrary
3636 * precision, for example 29.674825. But, ultimately the physical display only
3737 * have a fixed number of pixels, for example 640×960 for iPhone 4 or 750×1334
38- * for iPhone 6. iOS tries to be as faithful as possible to the user value by
39- * spreading one original pixel into multiple ones to trick the eye. The
40- * downside of this technique is that it makes the resulting element look
38+ * for iPhone 6. iOS tries to be as faithful as possible to the user value by
39+ * spreading one original pixel into multiple ones to trick the eye. The
40+ * downside of this technique is that it makes the resulting element look
4141 * blurry.
42- *
43- * In practice, we found out that developers do not want this feature and they
44- * have to work around it by doing manual rounding in order to avoid having
45- * blurry elements. In React Native, we are rounding all the pixels
42+ *
43+ * In practice, we found out that developers do not want this feature and they
44+ * have to work around it by doing manual rounding in order to avoid having
45+ * blurry elements. In React Native, we are rounding all the pixels
4646 * automatically.
47- *
48- * We have to be careful when to do this rounding. You never want to work with
49- * rounded and unrounded values at the same time as you're going to accumulate
50- * rounding errors. Having even one rounding error is deadly because a one
47+ *
48+ * We have to be careful when to do this rounding. You never want to work with
49+ * rounded and unrounded values at the same time as you're going to accumulate
50+ * rounding errors. Having even one rounding error is deadly because a one
5151 * pixel border may vanish or be twice as big.
52- *
52+ *
5353 * In React Native, everything in JavaScript and within the layout engine works
54- * with arbitrary precision numbers. It's only when we set the position and
55- * dimensions of the native element on the main thread that we round. Also,
56- * rounding is done relative to the root rather than the parent, again to avoid
54+ * with arbitrary precision numbers. It's only when we set the position and
55+ * dimensions of the native element on the main thread that we round. Also,
56+ * rounding is done relative to the root rather than the parent, again to avoid
5757 * accumulating rounding errors.
58- *
58+ *
5959 */
6060class PixelRatio {
6161 /**
0 commit comments