You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-12-01 16:38:31 +00:00
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.
This commit is contained in:
@@ -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 w = current_clip->final_clip_rect.size.x;
|
||||||
int h = current_clip->final_clip_rect.size.y;
|
int h = current_clip->final_clip_rect.size.y;
|
||||||
*/
|
*/
|
||||||
int x = current_clip->final_clip_rect.pos.x;
|
int x;
|
||||||
int y = viewport.height-(current_clip->final_clip_rect.pos.y+current_clip->final_clip_rect.size.y);
|
int y;
|
||||||
int w = current_clip->final_clip_rect.size.x;
|
int w;
|
||||||
int h = current_clip->final_clip_rect.size.y;
|
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);
|
glScissor(x,y,w,h);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user