Merge pull request #2120 from tinyoverflow/fix-icon-placement

Fix calculation of icon offset
This commit is contained in:
Sami Vänttinen 2024-02-25 14:09:36 +02:00 committed by GitHub
commit 91cc1d17dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -126,7 +126,7 @@ kpxcUI.updateIconPosition = function(iconClass) {
};
kpxcUI.calculateIconOffset = function(field, size) {
const offset = Math.floor((field.offsetHeight - size) / 3);
const offset = Math.floor((field.offsetHeight / 2) - (size / 2) - 1);
return (offset < 0) ? 0 : offset;
};