Can also fix the annoying warnings:
```
Subject: [PATCH] Fix annoying warning: Grid contains more visible items (n)
than rows*columns (16)
---
qml/2048.js | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/qml/2048.js b/qml/2048.js
index f249ca1..1fd5f42 100644
--- a/qml/2048.js
+++ b/qml/2048.js
@@ -373,7 +373,8 @@ function createTileObject(ind, n, isStartup) {
var sty = computeTileStyle(n, tileText);
var cell = cells.itemAt(ind)
- tile = tileComponent.createObject(tileGrid, {"x": cell.x, "y": cell.y,
"color": sty.bgColor, "tileColor": sty.fgColor, "tileFontSize": sty.fontSize,
"tileText": tileText});
+ tile = tileComponent.createObject(gameArea, {"x": cell.x + tileGrid.x,
"y": cell.y + tileGrid.y,
+ "color": sty.bgColor, "tileColor": sty.fgColor, "tileFontSize":
sty.fontSize, "tileText": tileText});
if (! isStartup) {
tile.runNewTileAnim = true;
}
@@ -392,7 +393,7 @@ function moveMergeTiles(v, v2, indices, j, src, dst, axis) {
tileItems[src].destroyFlag = true;
tileItems[src].z = -1;
tileItems[src].opacity = 0.5;
- tileItems[src][axis] = cells.itemAt(dst)[axis];
+ tileItems[src][axis] = cells.itemAt(dst)[axis] + tileGrid[axis];
var tileText = labelFunc[label](v2[indices[j]]);
var sty = computeTileStyle(v2[indices[j]], tileText);
@@ -402,7 +403,7 @@ function moveMergeTiles(v, v2, indices, j, src, dst, axis) {
tileItems[dst].tileFontSize = sty.fontSize;
} else {
// Move only
- tileItems[src][axis] = cells.itemAt(dst)[axis];
+ tileItems[src][axis] = cells.itemAt(dst)[axis] + tileGrid[axis];
tileItems[dst] = tileItems[src];
}
tileItems[src] = null;
--
2.51.0
```
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2134414
Title:
Upgrading from Noble to Questing broke MessageDiaglog boxes
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/2048-qt/+bug/2134414/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs