Merge pull request #40169 from azagaya/3.2

Fixed white image in margins when using same image in scene
This commit is contained in:
Rémi Verschelde 2020-07-08 08:59:08 +02:00 committed by GitHub
commit 2eb65b5c7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -2141,7 +2141,7 @@ void RasterizerCanvasGLES3::draw_window_margins(int *black_margin, RID *black_im
canvas_begin();
if (black_image[MARGIN_LEFT].is_valid()) {
_bind_canvas_texture(black_image[MARGIN_LEFT], RID());
_bind_canvas_texture(black_image[MARGIN_LEFT], RID(), true);
Size2 sz(storage->texture_get_width(black_image[MARGIN_LEFT]), storage->texture_get_height(black_image[MARGIN_LEFT]));
draw_generic_textured_rect(Rect2(0, 0, black_margin[MARGIN_LEFT], window_h),
@ -2154,7 +2154,7 @@ void RasterizerCanvasGLES3::draw_window_margins(int *black_margin, RID *black_im
}
if (black_image[MARGIN_RIGHT].is_valid()) {
_bind_canvas_texture(black_image[MARGIN_RIGHT], RID());
_bind_canvas_texture(black_image[MARGIN_RIGHT], RID(), true);
Size2 sz(storage->texture_get_width(black_image[MARGIN_RIGHT]), storage->texture_get_height(black_image[MARGIN_RIGHT]));
draw_generic_textured_rect(Rect2(window_w - black_margin[MARGIN_RIGHT], 0, black_margin[MARGIN_RIGHT], window_h),
Rect2(0, 0, (float)black_margin[MARGIN_RIGHT] / sz.x, (float)window_h / sz.y));
@ -2166,7 +2166,7 @@ void RasterizerCanvasGLES3::draw_window_margins(int *black_margin, RID *black_im
}
if (black_image[MARGIN_TOP].is_valid()) {
_bind_canvas_texture(black_image[MARGIN_TOP], RID());
_bind_canvas_texture(black_image[MARGIN_TOP], RID(), true);
Size2 sz(storage->texture_get_width(black_image[MARGIN_TOP]), storage->texture_get_height(black_image[MARGIN_TOP]));
draw_generic_textured_rect(Rect2(0, 0, window_w, black_margin[MARGIN_TOP]),
@ -2181,7 +2181,7 @@ void RasterizerCanvasGLES3::draw_window_margins(int *black_margin, RID *black_im
if (black_image[MARGIN_BOTTOM].is_valid()) {
_bind_canvas_texture(black_image[MARGIN_BOTTOM], RID());
_bind_canvas_texture(black_image[MARGIN_BOTTOM], RID(), true);
Size2 sz(storage->texture_get_width(black_image[MARGIN_BOTTOM]), storage->texture_get_height(black_image[MARGIN_BOTTOM]));
draw_generic_textured_rect(Rect2(0, window_h - black_margin[MARGIN_BOTTOM], window_w, black_margin[MARGIN_BOTTOM]),