# GUI artefacts (rectangle)

**URL:** <https://forum.babylonjs.com/t/gui-artefacts-rectangle/10570>\
**Category:** Bugs\
**Created:** [May 5, 2020, 2:02pm UTC](https://forum.babylonjs.com/t/gui-artefacts-rectangle/10570 "2020-05-05T14:02:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Symlis](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/symlis/32/7350_2.png) [@Symlis](https://forum.babylonjs.com/u/Symlis)\
**Post date:** [May 5, 2020, 2:02pm UTC](https://forum.babylonjs.com/t/gui-artefacts-rectangle/10570/1 "2020-05-05T14:02:36Z")

</div>

Hello everyone,  
I came into those weird artefacts that GUI rectangle does. I am making those measurements and there’s the description with text in the middle of it. Sometimes when I move camera or hide those measurement’s they leave those artefacts like in the second picture.

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/6/696ee297c5bb58e5d02a0eb3ade9529804897da4.png)  
picture 1  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/d/da0ebf72931e47f13cf78da737851e00eb52fb4c.png)  
picture 2

**Another example:**  
It’s happening when I move camera then stop for a mili sec and move again etc…

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/f/f088e57223ab61101f2a22498ebdfb32d7430f19.png)

Can I somehow prevent it?

---

<div class="post-metadata">

**Author:** ![Gijs](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/gijs/32/44_2.png) [@Gijs](https://forum.babylonjs.com/u/Gijs)\
**Post date:** [May 5, 2020, 2:46pm UTC](https://forum.babylonjs.com/t/gui-artefacts-rectangle/10570/2 "2020-05-05T14:46:17Z")

</div>

Hi Symlis,

Those two dots on the left probably shouldn’t be there; can you reproduce this in a playground? I think those dots aren’t taken into account with the rectangle measurement, and are outside the clearing area because of that. If so, then setting `useInvalidateRectOptimization` to false on your `AdvancedDynamicTexture` should fix it.

[https://www.babylonjs-playground.com/#XCPP9Y#2499](https://www.babylonjs-playground.com/#XCPP9Y#2499)

---

<div class="post-metadata">

**Author:** ![Symlis](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/symlis/32/7350_2.png) [@Symlis](https://forum.babylonjs.com/u/Symlis)\
**Post date:** [May 7, 2020, 7:49am UTC](https://forum.babylonjs.com/t/gui-artefacts-rectangle/10570/3 "2020-05-07T07:49:37Z")

</div>

`advancedTexture.useInvalidateRectOptimization = false` did the job, thanks!
