Commit a66bb18c authored by Holger Kaelberer's avatar Holger Kaelberer
Browse files

balancebox, improvements for hdpi devices

parent fbe2ac11
......@@ -21,9 +21,7 @@
/* ToDo:
- levels, levels, levels
- make sensitivity configurable?
- catch case of user levelset without or empty levels file
- editor: detect and warn invalid levels (no start, no goal)
- make sensitivity configurable
*/
.pragma library
.import QtQuick 2.0 as Quick
......@@ -41,6 +39,7 @@ var box2dPpm = 32; // pixelsPerMeter used in Box2D's world
var boardSizeM = 0.9; // board's real edge length, fixed to 90 cm
var boardSizePix = 500; // board's current size in pix (acquired dynamically)
var dpiBase=139;
var boardSizeBase = 760;
var curDpi = null;
var pixelsPerMeter = null;
var vFactor = pixelsPerMeter / box2dPpm; // FIXME: calculate!
......@@ -119,8 +118,7 @@ function start(items_) {
function reconfigureScene()
{
// set up dynamic variables for movement:
pixelsPerMeter = boardSizePix / boardSizeM / (items.dpi / dpiBase);
//pixelsPerMeter = (items.mapWrapper.length / 760) * boardSizePix / boardSizeM;
pixelsPerMeter = (items.mapWrapper.length / boardSizeBase) * boardSizePix / boardSizeM;
vFactor = pixelsPerMeter / box2dPpm;
console.log("Starting: mode=" + items.mode
......
......@@ -135,10 +135,10 @@ Item {
id: toolBox2
anchors.top: mapWrapper.top
anchors.left: mapWrapper.right
anchors.leftMargin: 10
anchors.topMargin: 20
spacing: 5
width: (background.width - mapWrapper.width - props.wallSize - 20) / 2
anchors.leftMargin: 10 * ApplicationInfo.ratio
anchors.topMargin: 20 * ApplicationInfo.ratio
spacing: 5 * ApplicationInfo.ratio
width: (background.width - mapWrapper.width - props.wallSize - 20 * ApplicationInfo.ratio) / 2
height: parent.height
// anchors.topMargin: 20
......@@ -163,11 +163,11 @@ Item {
Column {
id: toolBox
anchors.top: mapWrapper.top
anchors.topMargin: 20
anchors.topMargin: 20 * ApplicationInfo.ratio
anchors.left: parent.left
anchors.leftMargin: 10
width: (mapWrapper.x - 20)
spacing: 5
spacing: 5 * ApplicationInfo.ratio
Component.onCompleted: clearTool.selected = true;
......@@ -339,7 +339,7 @@ Item {
Row {
id: contactToolRow
spacing: 5
width: contact.width + contactTextInput + spacing
width: contact.width + contactTextInput.width + spacing
anchors.centerIn: parent
BalanceContact {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment