[Kde-games-devel] Fix double-click bug in GameScene code of KMahjongg

Ian Wadham iandw.au at gmail.com
Sat Dec 19 04:20:13 UTC 2015


Hi Frederik,

There is a really nasty bug in the QGrapicsView code of KMahjongg,
in the GameScene class (frameworks branch).

If you double-click on a tile that cannot be removed (ie. it is half under
another tile or has a tile on each side), the forbidden tile highlights.  It
is then possible to remove that tile illegally by clicking on a matching
tile somewhere else.

So it is possible to open up holes in rows of tiles or leave higher-layer
tiles balancing on the air… ;-)  Try it… :-)

The fix is in the attached patch.  The comments explain how it works
and why it is needed.  The commit message I use locally is:
        Swallow double-click, to avoid allowing an illegal move.

Apologies, Frederik, for any conflicts you might find on the frameworks
branch, especially in lines containing the text "QTransform()".

Cheers, Ian W.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: doubleclick.PATCH
Type: application/octet-stream
Size: 2145 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-games-devel/attachments/20151219/192b2a23/attachment-0001.obj>
-------------- next part --------------




More information about the kde-games-devel mailing list