Codechange: Replace Alignment enum with struct

Alignment struct contains separate horizontal and vertical alignment members.
This commit is contained in:
Peter Nelson
2026-06-28 20:43:36 +01:00
committed by Peter Nelson
parent 8e637cefed
commit b4d16d319f
52 changed files with 328 additions and 295 deletions
+15
View File
@@ -10,9 +10,24 @@
#include "../stdafx.h"
#include "geometry_func.hpp"
#include "math_func.hpp"
#include "../strings_func.h"
#include "../strings_type.h"
#include "../safeguards.h"
/**
* Resolve horizontal alignment for the current text direction.
* @return The resolved horizontal alignment.
*/
AlignmentH Alignment::ResolveRTL() const
{
switch (this->h) {
case AlignmentH::Start: return _current_text_dir == TD_RTL ? AlignmentH::ForceRight : AlignmentH::ForceLeft;
case AlignmentH::End: return _current_text_dir == TD_RTL ? AlignmentH::ForceLeft : AlignmentH::ForceRight;
default: return this->h;
}
}
/**
* Compute bounding box of both dimensions.
* @param d1 First dimension.