summaryrefslogtreecommitdiff
path: root/drivers/gles2/rasterizer_canvas_gles2.cpp
diff options
context:
space:
mode:
authorMarcin Zawiejski <dragmz@gmail.com>2019-01-02 14:47:28 +0100
committerGitHub <noreply@github.com>2019-01-02 14:47:28 +0100
commit4e73274837c0e65aa92fbd17a6b07679fc95a16b (patch)
tree00ba1034442bba1fe4114391ce8023069e52ac79 /drivers/gles2/rasterizer_canvas_gles2.cpp
parent09d090921cc4cbe6d60c0dfd75d28be1cd34222a (diff)
Fix negative size rectangle drawing
Fixes rectangle being drawn as it was a non-negative size in case it actually is. This can be observed e.g. when drawing a negative size selection rectangle (i.e. press mouse button and move cursor up and left).
Diffstat (limited to 'drivers/gles2/rasterizer_canvas_gles2.cpp')
-rw-r--r--drivers/gles2/rasterizer_canvas_gles2.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/gles2/rasterizer_canvas_gles2.cpp b/drivers/gles2/rasterizer_canvas_gles2.cpp
index 375c555d9e..e3d4884a5a 100644
--- a/drivers/gles2/rasterizer_canvas_gles2.cpp
+++ b/drivers/gles2/rasterizer_canvas_gles2.cpp
@@ -465,12 +465,11 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur
state.canvas_shader.use_material((void *)p_material);
}
- Size2 abs_size = r->rect.size.abs();
Vector2 points[4] = {
r->rect.position,
- r->rect.position + Vector2(abs_size.x, 0.0),
- r->rect.position + abs_size,
- r->rect.position + Vector2(0.0, abs_size.y),
+ r->rect.position + Vector2(r->rect.size.x, 0.0),
+ r->rect.position + r->rect.size,
+ r->rect.position + Vector2(0.0, r->rect.size.y),
};
if (r->rect.size.x < 0) {