Skip to content

Commit

Permalink
Merge pull request #40169 from azagaya/3.2
Browse files Browse the repository at this point in the history
Fixed white image in margins when using same image in scene
  • Loading branch information
akien-mga authored Jul 8, 2020
2 parents b1ec15b + d539627 commit 2eb65b5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/gles3/rasterizer_canvas_gles3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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));
Expand All @@ -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]),
Expand All @@ -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]),
Expand Down

0 comments on commit 2eb65b5

Please sign in to comment.