diff options
author | Saracen <SaracenOne@gmail.com> | 2015-10-31 09:05:03 +0000 |
---|---|---|
committer | Saracen <SaracenOne@gmail.com> | 2015-11-02 16:48:11 +0000 |
commit | ff363c94db0d456e171aeacf10f11f5a51ca2ee3 (patch) | |
tree | cf9ba28c4cb43a0edfc2aadd22e21cad77d42c93 /drivers/gles2/rasterizer_gles2.cpp | |
parent | 5072134f419f749b8b47021565dad3b0ee15c979 (diff) |
Another clipping fix: default back to using window size to calculate clipping on viewports which don't have a rendertarget which fixes clipping on the editor viewport.
Diffstat (limited to 'drivers/gles2/rasterizer_gles2.cpp')
-rw-r--r-- | drivers/gles2/rasterizer_gles2.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp index 0bb58708ee..daac4123e0 100644 --- a/drivers/gles2/rasterizer_gles2.cpp +++ b/drivers/gles2/rasterizer_gles2.cpp @@ -9348,10 +9348,23 @@ void RasterizerGLES2::canvas_render_items(CanvasItem *p_item_list,int p_z,const int w = current_clip->final_clip_rect.size.x; int h = current_clip->final_clip_rect.size.y; */ - int x = current_clip->final_clip_rect.pos.x; - int y = viewport.height-(current_clip->final_clip_rect.pos.y+current_clip->final_clip_rect.size.y); - int w = current_clip->final_clip_rect.size.x; - int h = current_clip->final_clip_rect.size.y; + int x; + int y; + int w; + int h; + + if (current_rt) { + x = current_clip->final_clip_rect.pos.x; + y = viewport.height - (current_clip->final_clip_rect.pos.y + current_clip->final_clip_rect.size.y); + w = current_clip->final_clip_rect.size.x; + h = current_clip->final_clip_rect.size.y; + } + else { + x = current_clip->final_clip_rect.pos.x; + y = window_size.height - (current_clip->final_clip_rect.pos.y + current_clip->final_clip_rect.size.y); + w = current_clip->final_clip_rect.size.x; + h = current_clip->final_clip_rect.size.y; + } glScissor(x,y,w,h); |