mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-12 00:54:53 -07:00
* refactor: extract CARD_HEIGHT to shared CardDimensions header Move duplicated CARD_WIDTH/CARD_HEIGHT constants to card_dimensions.h. Fixed documentation in z_value_layer_manager.h. * WIDTH_F used directly instead of casting * Improved consistency and added missing newlines at end of files
29 lines
886 B
C++
29 lines
886 B
C++
#ifndef CARD_DIMENSIONS_H
|
|
#define CARD_DIMENSIONS_H
|
|
|
|
#include <QtGlobal>
|
|
|
|
/**
|
|
* @file card_dimensions.h
|
|
* @brief Canonical card dimension constants for layout and Z-value calculations.
|
|
*
|
|
* These values represent the logical pixel dimensions of a standard card graphic.
|
|
* They are used throughout the game scene for layout, rendering, and Z-value computation.
|
|
*/
|
|
namespace CardDimensions
|
|
{
|
|
/// Card width in pixels
|
|
constexpr int WIDTH = 72;
|
|
/// Card height in pixels
|
|
constexpr int HEIGHT = 102;
|
|
|
|
/// Pre-converted for floating-point contexts (Z-value calculations)
|
|
constexpr qreal WIDTH_F = static_cast<qreal>(WIDTH);
|
|
constexpr qreal HEIGHT_F = static_cast<qreal>(HEIGHT);
|
|
|
|
/// Half-dimensions for centering and rotation transforms
|
|
constexpr qreal WIDTH_HALF_F = WIDTH_F / 2;
|
|
constexpr qreal HEIGHT_HALF_F = HEIGHT_F / 2;
|
|
} // namespace CardDimensions
|
|
|
|
#endif // CARD_DIMENSIONS_H
|