hoffstadt / hoffstadt/DearPyGui

get_viewport_pos() sometimes returns [0, 0]

Open
#2,083 0 comments 0 reactions 0 assignees View on GitHub
state: pending type: bug
Dominant language
C++
Stars
15.6k
Forks
783
PR merge metrics
No merged PRs in 30d

Description

## Version of Dear PyGui

Version: 1.9.0
Operating System: Fedora 36 64-bit

## My Issue/Question

`get_viewport_pos()` sometimes returns [0, 0] even if that's not true.

## To Reproduce

Steps to reproduce the behavior:
1. Run `https://github.com/my1e5/dpg-examples/blob/main/window/drag_menu_bar.py`
2. Optionally, add `print(viewport_pos_x, viewport_pos_y)` under line 11
3. Attempt to drag the menu bar and watch the viewport flicker between its supposed position and the top left of the screen

## Expected behavior

`get_viewport_pos()` should consistently return its actual value.

## Screenshots/Video

https://user-images.githubusercontent.com/50395934/234825549-5dce2366-c57c-4ba1-90ff-dba0a8866c5a.mp4

![image](https://user-images.githubusercontent.com/50395934/234825611-23526538-2040-4b42-a81b-d150a7569a54.png)

(Sample console output with the addition of the print statement)

## Standalone, minimal, complete and verifiable example

`https://github.com/my1e5/dpg-examples/blob/main/window/drag_menu_bar.py`

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.