Bug 176740 - Multiple piles can be simultaneously hightlighted when dragging cards.
Summary: Multiple piles can be simultaneously hightlighted when dragging cards.
Status: RESOLVED FIXED
Alias: None
Product: kpat
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Unspecified
: NOR normal
Target Milestone: ---
Assignee: Stephan Kulow
URL:
Keywords:
: 177283 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-12-02 21:10 UTC by Parker Coates
Modified: 2009-01-06 18:12 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Patch to reuse the same code for drops and highlights in DealerScene. (3.83 KB, patch)
2008-12-02 21:12 UTC, Parker Coates
Details

Note You need to log in before you can comment on or make changes to this bug.
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!