correctly align dots when centered

This commit is contained in:
Felix Salcher 2025-06-28 00:28:58 +02:00
parent 116789b19a
commit 8089bb23d8
No known key found for this signature in database

View file

@ -365,10 +365,10 @@ bool CPasswordInputField::draw(const SRenderData& data) {
const double CURRWIDTH = ((passSize.x + passSpacing) * CURRDOTS) - passSpacing;
// Calculate starting x-position to ensure dots stay centered within the input field
double xstart = dots.center ? ((DOTAREAWIDTH - CURRWIDTH) / 2.0) + DOTPAD - (eye.margin - eyeSize.x) / 2 : DOTPAD;
double xstart = dots.center ? ((DOTAREAWIDTH - CURRWIDTH) / 2.0) + DOTPAD : DOTPAD;
if (CURRDOTS > MAXDOTS)
xstart = (inputFieldBox.w + MAXDOTS * (passSize.x + passSpacing) - passSpacing - 2 * CURRWIDTH) / 2.0;
xstart = (inputFieldBox.w + MAXDOTS * (passSize.x + passSpacing) - passSpacing - 2 * CURRWIDTH - eye.margin - eyeSize.x) / 2.0;
if (dots.rounding == -1)
dots.rounding = passSize.x / 2.0;