Skip to content

OptionButton 'fit to longest' does not match dropdown menu size #114831

@Aisoipheo

Description

@Aisoipheo

Tested versions

Engine Version: v4.5.1.stable.fedora.f62fdbde1
Using editor

System information

Fedora 43 - Godot Engine v4.5.1.stable.fedora.f62fdbde1 - Vulkan 1.4.318 - Forward Mobile - AMD Radeon RX 7800 XT (RADV NAVI32)

Issue description

When creating a OptionButton with a few items and checking 'Fit To Longest Item' option dropdown menu of component does not match the size of button and overextends to right for approx 8 pixels. The only way to fix this is to set minsize that is larger than longest item. (Yes i checked options for trimming whitespace and checked that item has no whitespace in the end)

Image

As it is shown above longest item has some space in the end in dropdown menu and it causes dropdown menu to overextend

Steps to reproduce

  1. Scene > New Scene > Add Child Node > Option Button
  2. Set 'Fit to Longest Item' true
  3. Add a few items
  4. Run Current Scene
  5. Open dropdown menu
Image

Minimal reproduction project (MRP)

option-button-bug.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    For team assessment

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions