bevyengine / bevyengine/bevy

`Camera::world_to_viewport` returns coordinates relative to render target instead of viewport

Open
#20,590 0 comments 0 reactions 0 assignees View on GitHub
A-Rendering C-Bug S-Needs-Design
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## Bevy version and features

Bevy 0.16

## What you did

I was using `Camera::world_to_viewport` for a camera that has a non-zero viewport position.

## What went wrong

The results I were getting had `target_rect.min` (viewport position) added to them. It's confusing as the method name suggests that it converts world position to viewport position (as opposed to screen or other render target).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.