From 4d0f1545ea057c7fc5ee50665c92adf7c6de204c Mon Sep 17 00:00:00 2001 From: Simon Hong Date: Tue, 16 Jan 2024 12:46:47 +0900 Subject: [PATCH] Fixed new tab button's plus icon is mis-aligned with horizontal tab fix https://github.com/brave/brave-browser/issues/35300 --- browser/ui/views/tabs/brave_new_tab_button.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/browser/ui/views/tabs/brave_new_tab_button.cc b/browser/ui/views/tabs/brave_new_tab_button.cc index 34dfe4f2603e..e476cbe488a6 100644 --- a/browser/ui/views/tabs/brave_new_tab_button.cc +++ b/browser/ui/views/tabs/brave_new_tab_button.cc @@ -85,8 +85,9 @@ void BraveNewTabButton::PaintIcon(gfx::Canvas* canvas) { // the canvas in the center of the view. constexpr int kIconSize = 18; gfx::Rect bounds = GetContentsBounds(); - canvas->Translate(gfx::Vector2d((bounds.width() - kIconSize) / 2, - (bounds.height() - kIconSize) / 2)); + canvas->Translate( + gfx::Vector2d((bounds.width() - kIconSize) / 2 + bounds.x(), + (bounds.height() - kIconSize) / 2 + bounds.y())); gfx::PaintVectorIcon(canvas, kLeoPlusAddIcon, kIconSize, GetForegroundColor()); return;