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

Strange behavior of ImageMode::KeepAspect #3933

Closed
Sliman4 opened this issue Feb 13, 2022 · 0 comments
Closed

Strange behavior of ImageMode::KeepAspect #3933

Sliman4 opened this issue Feb 13, 2022 · 0 comments
Labels
A-Rendering Drawing game state to the screen A-UI Graphical user interfaces, styles, layouts, and widgets C-Bug An unexpected or incorrect behavior

Comments

@Sliman4
Copy link
Contributor

Sliman4 commented Feb 13, 2022

Bevy version

803e8cd

Operating system & version

Arch linux

What you did

pub use bevy::prelude::*;
use bevy::ui::widget::ImageMode;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_startup_system(startup_system)
        .run()
}

fn startup_system(mut commands: Commands, asset_server: Res<AssetServer>) {
    commands.spawn_bundle(UiCameraBundle::default());
    
    commands.spawn_bundle(ImageBundle {
        image: asset_server.load("image.png").into(),
        image_mode: ImageMode::KeepAspect,
        ..Default::default()
    });
}

What you expected to happen

The image keeps its aspect ratio.

What actually happened

2022-02-13.16-03-16.mp4
@Sliman4 Sliman4 added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Feb 13, 2022
@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen A-UI Graphical user interfaces, styles, layouts, and widgets and removed S-Needs-Triage This issue needs to be labelled labels Feb 13, 2022
@bors bors bot closed this as completed in 5972879 Nov 18, 2022
taiyoungjang pushed a commit to taiyoungjang/bevy that referenced this issue Dec 15, 2022
# Objective

Delete `ImageMode`. It doesn't do anything except mislead people into thinking it controls the aspect ratio of images somehow.

Fixes bevyengine#3933 and bevyengine#6637

## Solution

Delete `ImageMode`

## Changelog

Removes the `ImageMode` enum.
Removes the `image_mode` field from `ImageBundle`
Removes the `With<ImageMode>` query filter from `image_node_system`
Renames `image_node_system` to` update_image_calculated_size_system`
alradish pushed a commit to alradish/bevy that referenced this issue Jan 22, 2023
# Objective

Delete `ImageMode`. It doesn't do anything except mislead people into thinking it controls the aspect ratio of images somehow.

Fixes bevyengine#3933 and bevyengine#6637

## Solution

Delete `ImageMode`

## Changelog

Removes the `ImageMode` enum.
Removes the `image_mode` field from `ImageBundle`
Removes the `With<ImageMode>` query filter from `image_node_system`
Renames `image_node_system` to` update_image_calculated_size_system`
ItsDoot pushed a commit to ItsDoot/bevy that referenced this issue Feb 1, 2023
# Objective

Delete `ImageMode`. It doesn't do anything except mislead people into thinking it controls the aspect ratio of images somehow.

Fixes bevyengine#3933 and bevyengine#6637

## Solution

Delete `ImageMode`

## Changelog

Removes the `ImageMode` enum.
Removes the `image_mode` field from `ImageBundle`
Removes the `With<ImageMode>` query filter from `image_node_system`
Renames `image_node_system` to` update_image_calculated_size_system`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen A-UI Graphical user interfaces, styles, layouts, and widgets C-Bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants