Cockatrice 2026-03-05-Development-2.11.0-beta.54
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
ZValues Namespace Reference

Functions

constexpr qreal childDragZValue (qreal hotSpotX, qreal hotSpotY)
 Compute Z-value for child drag items based on hotspot position.
constexpr qreal tableCardZValue (qreal x, qreal y)
 Compute Z-value for cards on the table zone based on position.

Variables

constexpr qreal OVERLAY_BASE = ZValueLayerManager::OVERLAY_BASE
constexpr qreal HOVERED_CARD = ZValueLayerManager::overlayZValue(1.0)
constexpr qreal ARROWS = ZValueLayerManager::overlayZValue(3.0)
constexpr qreal ZONE_VIEW_WIDGET = ZValueLayerManager::overlayZValue(4.0)
constexpr qreal DRAG_ITEM = ZValueLayerManager::overlayZValue(5.0)
constexpr qreal DRAG_ITEM_CHILD = ZValueLayerManager::overlayZValue(6.0)
constexpr qreal TOP_UI = ZValueLayerManager::overlayZValue(7.0)
constexpr qreal CARD_BASE = 1.0
constexpr qreal CARD_MAX = ZValueLayerManager::CARD_Z_VALUE_MAX

Function Documentation

◆ childDragZValue()

qreal ZValues::childDragZValue ( qreal hotSpotX,
qreal hotSpotY )
nodiscardconstexpr

Compute Z-value for child drag items based on hotspot position.

When dragging multiple cards together, each child card needs a unique Z-value to prevent Z-fighting (flickering/flashing). The Z-values are derived from their position when grabbed to conserve original stacking. The formula encodes 2D coordinates into a single value where X has higher weight, ensuring deterministic visual stacking.

Parameters
hotSpotXThe X coordinate of the grab position
hotSpotYThe Y coordinate of the grab position
Returns
Unique Z-value for the child drag item
Here is the caller graph for this function:

◆ tableCardZValue()

qreal ZValues::tableCardZValue ( qreal x,
qreal y )
nodiscardconstexpr

Compute Z-value for cards on the table zone based on position.

Cards lower on the table (higher Y) render above cards higher up, and cards to the right (higher X) render above cards to the left. This creates natural visual stacking for overlapping cards.

Parameters
xThe X coordinate of the card position
yThe Y coordinate of the card position
Returns
Z-value for the card's table position
Here is the caller graph for this function:

Variable Documentation

◆ ARROWS

qreal ZValues::ARROWS = ZValueLayerManager::overlayZValue(3.0)
constexpr

◆ CARD_BASE

qreal ZValues::CARD_BASE = 1.0
constexpr

◆ CARD_MAX

qreal ZValues::CARD_MAX = ZValueLayerManager::CARD_Z_VALUE_MAX
constexpr

◆ DRAG_ITEM

qreal ZValues::DRAG_ITEM = ZValueLayerManager::overlayZValue(5.0)
constexpr

◆ DRAG_ITEM_CHILD

qreal ZValues::DRAG_ITEM_CHILD = ZValueLayerManager::overlayZValue(6.0)
constexpr

◆ HOVERED_CARD

qreal ZValues::HOVERED_CARD = ZValueLayerManager::overlayZValue(1.0)
constexpr

◆ OVERLAY_BASE

qreal ZValues::OVERLAY_BASE = ZValueLayerManager::OVERLAY_BASE
constexpr

◆ TOP_UI

qreal ZValues::TOP_UI = ZValueLayerManager::overlayZValue(7.0)
constexpr

◆ ZONE_VIEW_WIDGET

qreal ZValues::ZONE_VIEW_WIDGET = ZValueLayerManager::overlayZValue(4.0)
constexpr