Fix calculation of icon offset

This commit is contained in:
Felix Stieglitz 2024-02-16 01:12:00 +01:00
parent b0a9ed5082
commit d183b31bbd
No known key found for this signature in database
GPG key ID: C892C174A5CA5425

View file

@ -126,7 +126,8 @@ 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);
console.log(field.offsetHeight, size, offset);
return (offset < 0) ? 0 : offset;
};