Merge pull request #2719 from SaracenOne/clipping_fix

Canvas Clipping fix
This commit is contained in:
Juan Linietsky 2015-12-08 17:18:19 -03:00
commit e176bb6a7c
2 changed files with 51 additions and 12 deletions

Binary file not shown.

View File

@ -9169,10 +9169,23 @@ void RasterizerGLES2::_canvas_item_render_commands(CanvasItem *p_item,CanvasItem
//glScissor(viewport.x+current_clip->final_clip_rect.pos.x,viewport.y+ (viewport.height-(current_clip->final_clip_rect.pos.y+current_clip->final_clip_rect.size.height)),
//current_clip->final_clip_rect.size.width,current_clip->final_clip_rect.size.height);
int x = current_clip->final_clip_rect.pos.x;
int y = window_size.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 = current_clip->final_clip_rect.pos.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);
@ -9362,10 +9375,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 = window_size.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 = current_clip->final_clip_rect.pos.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);
@ -9667,10 +9693,23 @@ void RasterizerGLES2::canvas_render_items(CanvasItem *p_item_list,int p_z,const
//glScissor(viewport.x+current_clip->final_clip_rect.pos.x,viewport.y+ (viewport.height-(current_clip->final_clip_rect.pos.y+current_clip->final_clip_rect.size.height)),
//current_clip->final_clip_rect.size.width,current_clip->final_clip_rect.size.height);
int x = current_clip->final_clip_rect.pos.x;
int y = window_size.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 = current_clip->final_clip_rect.pos.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);