Add screenshot of increasing precision to tips page

This commit is contained in:
2017-02-07 00:46:19 -07:00
parent ab9af756a4
commit 04bd63b273
5 changed files with 4613 additions and 62 deletions
+7 -7
View File
@@ -1,5 +1,5 @@
import React, {Component} from 'react';
import {Dimensions, Image, Text, View} from 'react-native';
import {Image, Text, View} from 'react-native';
export default class MyImage extends Component {
constructor(props) {
@@ -10,17 +10,20 @@ export default class MyImage extends Component {
const {view, data} = this.props;
if (view.layout) {
const maxHeight = view.layout.height * 0.8;
const maxHeight = view.layout.height * 0.4;
const maxWidth = view.layout.width * 0.9;
// What the width will be if the responsive limit kicks in
const widthResp = view.layout.width * 0.6;
const aspectRatio = data.width / data.height;
let setWidth = maxWidth;
let setHeight = maxWidth / aspectRatio;
if (setHeight > maxHeight) {
setHeight = maxHeight;
setWidth = setHeight * aspectRatio;
setWidth = widthResp;
setHeight = setWidth / aspectRatio;
}
return (
@@ -44,6 +47,3 @@ export default class MyImage extends Component {
}
}
}