diff --git a/src/seedsigner/gui/components.py b/src/seedsigner/gui/components.py index 0706f213..a66afd24 100644 --- a/src/seedsigner/gui/components.py +++ b/src/seedsigner/gui/components.py @@ -22,6 +22,7 @@ class GUIConstants: EDGE_PADDING = 8 COMPONENT_PADDING = 8 LIST_ITEM_PADDING = 4 + FIXED_FONT_HEIGHT_PADDING = 6 BACKGROUND_COLOR = "black" WARNING_COLOR = "#FFD60A" @@ -616,7 +617,8 @@ class FormattedAddress(BaseComponent): # Fixed width font means we only have to measure one max-height character left, top, right, bottom = self.font.getbbox("Q") - char_width, char_height = right - left, bottom - top + ascent, descent = self.font.getmetrics() + char_width, char_height = right - left, bottom - top + descent n = 7 display_str = f"{self.address[:n]} {self.address[n:-1*n]} {self.address[-1*n:]}" diff --git a/src/seedsigner/gui/screens/psbt_screens.py b/src/seedsigner/gui/screens/psbt_screens.py index 502c3921..92211aaf 100644 --- a/src/seedsigner/gui/screens/psbt_screens.py +++ b/src/seedsigner/gui/screens/psbt_screens.py @@ -511,8 +511,9 @@ class PSBTMathScreen(ButtonListScreen): body_font = Fonts.get_font(GUIConstants.BODY_FONT_NAME, (GUIConstants.BODY_FONT_SIZE)*ssf) fixed_width_font = Fonts.get_font(GUIConstants.FIXED_WIDTH_FONT_NAME, (GUIConstants.BODY_FONT_SIZE + 6)*ssf) - left, top, right, bottom = fixed_width_font.getbbox(self.input_amount + "+") - digits_width, digits_height = right - left, bottom - top + left, top, right, bottom = fixed_width_font.getbbox(self.input_amount + "Q") + ascent, descent = fixed_width_font.getmetrics() + digits_width, digits_height = right - left, bottom - top + descent # Draw each line of the equation cur_y = 0