Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui border is quietly ignored for entities with ContentSize #11557

Open
stepancheg opened this issue Jan 27, 2024 · 1 comment
Open

ui border is quietly ignored for entities with ContentSize #11557

stepancheg opened this issue Jan 27, 2024 · 1 comment
Labels
A-UI Graphical user interfaces, styles, layouts, and widgets C-Bug An unexpected or incorrect behavior

Comments

@stepancheg
Copy link
Contributor

stepancheg commented Jan 27, 2024

Bevy version

main

What you did

use bevy::prelude::*;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_systems(Startup, hello_world_system)
        .run();
}

fn hello_world_system(mut commands: Commands) {
    commands.spawn(Camera2dBundle::default());

    commands.spawn(NodeBundle {
        style: Style {
            min_width: Val::Px(500.),
            min_height: Val::Px(500.),
            border: UiRect::all(Val::Px(20.)),
            ..Style::default()
        },
        background_color: BackgroundColor(Color::BLUE),
        border_color: BorderColor(Color::YELLOW_GREEN),
        ..NodeBundle::default()
    });

    commands.spawn((
        TextBundle {
            text: Text::from_section(
                "Hi",
                TextStyle {
                    font_size: 100.,
                    ..TextStyle::default()
                },
            ),
            style: Style {
                min_width: Val::Px(500.),
                min_height: Val::Px(500.),
                left: Val::Px(600.),
                // Here we asked for border.
                border: UiRect::all(Val::Px(5.)),
                ..Style::default()
            },
            background_color: BackgroundColor(Color::VIOLET),
            ..TextBundle::default()
        },
        BorderColor(Color::ORANGE_RED),
    ));
}

What went wrong

There's no border around text node, even if border size is specified explicitly in TextBundle.

image

What is expected

  • Border
  • Or an error
  • Or at least a warning
  • Or at least mention in documentation
@stepancheg stepancheg added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Jan 27, 2024
@matiqo15 matiqo15 added A-UI Graphical user interfaces, styles, layouts, and widgets and removed S-Needs-Triage This issue needs to be labelled labels Jan 27, 2024
@nicoburns
Copy link
Contributor

This is known, considered a bug, and should be fixed by #10690

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-UI Graphical user interfaces, styles, layouts, and widgets C-Bug An unexpected or incorrect behavior
Projects
None yet
Development

No branches or pull requests

3 participants