From d183b31bbdbd92b978e7a0ce701f22380811e541 Mon Sep 17 00:00:00 2001 From: Felix Stieglitz <6287093+tinyoverflow@users.noreply.github.com> Date: Fri, 16 Feb 2024 01:12:00 +0100 Subject: [PATCH 1/2] Fix calculation of icon offset --- keepassxc-browser/content/ui.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/keepassxc-browser/content/ui.js b/keepassxc-browser/content/ui.js index 84dc9f5..9ceaca0 100644 --- a/keepassxc-browser/content/ui.js +++ b/keepassxc-browser/content/ui.js @@ -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; }; From f717229f8e2ba5e940c2344785a67d3e55656650 Mon Sep 17 00:00:00 2001 From: Felix Stieglitz <6287093+tinyoverflow@users.noreply.github.com> Date: Fri, 16 Feb 2024 08:16:58 +0100 Subject: [PATCH 2/2] Remove debugging leftover --- keepassxc-browser/content/ui.js | 1 - 1 file changed, 1 deletion(-) diff --git a/keepassxc-browser/content/ui.js b/keepassxc-browser/content/ui.js index 9ceaca0..23f48dd 100644 --- a/keepassxc-browser/content/ui.js +++ b/keepassxc-browser/content/ui.js @@ -127,7 +127,6 @@ kpxcUI.updateIconPosition = function(iconClass) { kpxcUI.calculateIconOffset = function(field, size) { const offset = Math.floor((field.offsetHeight / 2) - (size / 2) - 1); - console.log(field.offsetHeight, size, offset); return (offset < 0) ? 0 : offset; };