# gl::ScopedScissor and window matrices

**URL:** <https://discourse.libcinder.org/t/gl-scopedscissor-and-window-matrices/1250>\
**Category:** Uncategorized\
**Created:** [August 13, 2018, 1:40pm UTC](https://discourse.libcinder.org/t/gl-scopedscissor-and-window-matrices/1250 "2018-08-13T13:40:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hperigo](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/hperigo/32/409_2.png) [@hperigo](https://discourse.libcinder.org/u/hperigo)\
**Post date:** [August 13, 2018, 1:40pm UTC](https://discourse.libcinder.org/t/gl-scopedscissor-and-window-matrices/1250/1 "2018-08-13T13:40:46Z")

</div>

Hey there,

because the y axis is flipped in 2D mode ( setMatricesWindow(…) ) by default in cinder, using gl::scissor is a bit confusing. I always have to do some math the get it right. Like so:

```
        auto pos = vec2( 100, 100);
        auto size = (mRect.getSize());
        auto invPos = vec2( (pos.x), (getWindowHeight()) - (pos.y) - (size.y) );
        gl::ScopedScissor sC( toPixels( invPos ), toPixels(size) );

```

I was wondering, is there a more correct/convenient way of doing this?
