Bug 176740

Summary: Multiple piles can be simultaneously hightlighted when dragging cards.
Product: [Applications] kpat Reporter: Parker Coates <coates>
Component: generalAssignee: Stephan Kulow <coolo>
Status: RESOLVED FIXED    
Severity: normal CC: davidben, kde-games-bugs
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Unspecified   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Patch to reuse the same code for drops and highlights in DealerScene.

Description Parker Coates 2008-12-02 21:10:12 UTC
Version:            (using Devel)
Installed from:    Compiled sources

Currently when dragging a card, KPat checks all piles currently under the card and highlights all those that are valid drop points for the card being moved. In certain situations in certain games, this can lead to up to four piles being highlighted at once. The problem is that from any given position, the card can only actually be dropped on a single pile. Highlighting more than one pile, when in reality only one is the "real" drop target is a little misleading and (in my opinion) looks bad.

The attached patch essentially extracts the pile selection code from the drop function into its own method. This method is then called by both the hover logic (for selecting which pile to highlight) and the drop function (for selecting the pile to drop on). The result is less code and more consistency.
Comment 1 Parker Coates 2008-12-02 21:12:08 UTC
Created attachment 29003 [details]
Patch to reuse the same code for drops and highlights in DealerScene.
Comment 2 Parker Coates 2008-12-09 14:33:16 UTC
*** Bug 177283 has been marked as a duplicate of this bug. ***
Comment 3 Stephan Kulow 2008-12-27 16:47:25 UTC
applied
Comment 4 Stephan Kulow 2008-12-27 20:06:11 UTC
your patch has an ugly side effect: cards don't move back to their origin pile.
Comment 5 Stephan Kulow 2008-12-27 20:29:19 UTC
SVN commit 902245 by coolo:

Parker forgot one else
CCBUG: 176740


 M  +1 -0      dealer.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=902245
Comment 6 Parker Coates 2009-01-06 10:24:45 UTC
SVN commit 906434 by coates:

Stephan forgot to actually add the else in his "Parker forgot one else" 
commit. ;)

Not callling moveCardsBack caused misdropped cards to stay 
floating out in the middle of nowhere. Calling moveCardsBack everytime 
caused the card drop animation to be skipped as noticed by Matthew 
Woehlke. I believe this change represents the desired behaviour.

CCBUG: 176740


 M  +4 -1      dealer.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=906434
Comment 7 Matthew Woehlke 2009-01-06 18:12:10 UTC
Yes, smooth drop is working again. Thanks for the quick fix!