mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-09 01:23:57 -07:00
refactor(z-values): replace magic Z-value numbers with ZValues constants
Magic numbers like 2000000007 are impossible to understand without context. Named constants (ZValues::DRAG_ITEM) are self-documenting. This intentionally renumbers overlay Z-values to use a cleaner offset sequence. The relative stacking order is preserved, which is what matters for correct rendering. Each consumer now includes z_values.h and uses semantic constants instead of magic numbers.
This commit is contained in:
parent
d22fa8b447
commit
652ca041b4
4 changed files with 12 additions and 8 deletions
|
|
@ -5,6 +5,7 @@
|
|||
#include "../player/player.h"
|
||||
#include "../player/player_actions.h"
|
||||
#include "../player/player_target.h"
|
||||
#include "../z_values.h"
|
||||
#include "../zones/card_zone.h"
|
||||
#include "card_item.h"
|
||||
|
||||
|
|
@ -23,7 +24,7 @@ ArrowItem::ArrowItem(Player *_player, int _id, ArrowTarget *_startItem, ArrowTar
|
|||
: QGraphicsItem(), player(_player), id(_id), startItem(_startItem), targetItem(_targetItem), targetLocked(false),
|
||||
color(_color), fullColor(true)
|
||||
{
|
||||
setZValue(2000000005);
|
||||
setZValue(ZValues::ARROWS);
|
||||
|
||||
if (startItem)
|
||||
startItem->addArrowFrom(this);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue