# Why does my GetViewportSize Node return inaccurate results?

**URL:** <https://forums.unrealengine.com/t/why-does-my-getviewportsize-node-return-inaccurate-results/423178>\
**Category:** UI\
**Tags:** viewport, viewport-bugs, unreal-engine, Blueprint, question, UMG\
**Created:** [April 21, 2018, 12:15am UTC](https://forums.unrealengine.com/t/why-does-my-getviewportsize-node-return-inaccurate-results/423178 "2018-04-21T00:15:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Erdrik](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Erdrik](https://forums.unrealengine.com/u/Erdrik)\
**Post date:** [April 21, 2018, 12:15am UTC](https://forums.unrealengine.com/t/why-does-my-getviewportsize-node-return-inaccurate-results/423178/1 "2018-04-21T00:15:31Z")

</div>

Ive called a GetViewportSize Node and use the results to draw a square around what is suppose to be the edges of the game window using the Draw Line Node in the OnPaint Event.  
But the lines draw a square that is significantly smaller than the the game window.

What could be causing this and what do I need to do to get the Size of the Game Window?

As shown:

 ![238307-badvpsize.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/e/e/bee2c8c171a59c4b1356e7ae5cef13e617ab01a7.jpeg)

---

<div class="post-metadata">

**Author:** ![Erdrik](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Erdrik](https://forums.unrealengine.com/u/Erdrik)\
**Post date:** [April 22, 2018, 7:31pm UTC](https://forums.unrealengine.com/t/why-does-my-getviewportsize-node-return-inaccurate-results/423178/2 "2018-04-22T19:31:56Z")

</div>

Answer found [here](https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/1464370-4-17-2-why-does-my-getviewportsize-node-return-inaccurate-results-solved).

---

<div class="post-metadata">

**Author:** ![BakonGuy](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bakonguy/32/1000091_2.png) [@BakonGuy](https://forums.unrealengine.com/u/BakonGuy)\
**Post date:** [January 27, 2021, 10:51pm UTC](https://forums.unrealengine.com/t/why-does-my-getviewportsize-node-return-inaccurate-results/423178/3 "2021-01-27T22:51:15Z")

</div>

I never found a good answer to this so I’ll post to correct answer here for others searching. You need to divide _GetViewportSize_ by _GetViewportScale_.

 ![328245-ue4editor-2021-01-27-16-46-08.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/9/7/b97c7aad6884f6f542dec30556a3dffd88e793a7.png)
