summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-11-07 15:37:18 +0100
committerRémi Verschelde <rverschelde@gmail.com>2019-11-07 15:43:04 +0100
commit47389c3a167797ef6e5756937e9d888f6a7719b7 (patch)
tree99d694f6aa2502ebaa795e31d4c1069d5f4afd46
parent99cc4d246f5a9f31fa2e83ad3108013d36dc1965 (diff)
Partial revert of #32657, undoing line shifting by 0.5
As discussed in #32657, this can't be done here as lines can be used with a canvas scale, and this breaks them. A suggestion is to do the pixel shifting at matrix level instead. Fixes #33393. Fixes #33421.
-rw-r--r--drivers/gles2/rasterizer_canvas_gles2.cpp6
-rw-r--r--drivers/gles3/rasterizer_canvas_gles3.cpp6
2 files changed, 4 insertions, 8 deletions
diff --git a/drivers/gles2/rasterizer_canvas_gles2.cpp b/drivers/gles2/rasterizer_canvas_gles2.cpp
index 16e5e92abd..e34705f7b7 100644
--- a/drivers/gles2/rasterizer_canvas_gles2.cpp
+++ b/drivers/gles2/rasterizer_canvas_gles2.cpp
@@ -494,10 +494,8 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur
if (line->width <= 1) {
Vector2 verts[2] = {
- // Offset the line slightly to make sure we always draw the pixel at the from coordinate.
- // Without this, corners of rectangles might be missing a pixel. (See diamond exit rule and #32657)
- Vector2(Math::floor(line->from.x) + 0.5, Math::floor(line->from.y) + 0.5),
- Vector2(Math::floor(line->to.x) + 0.5, Math::floor(line->to.y) + 0.5)
+ Vector2(line->from.x, line->from.y),
+ Vector2(line->to.x, line->to.y)
};
#ifdef GLES_OVER_GL
diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp
index e09ba755ea..edffe852a2 100644
--- a/drivers/gles3/rasterizer_canvas_gles3.cpp
+++ b/drivers/gles3/rasterizer_canvas_gles3.cpp
@@ -548,10 +548,8 @@ void RasterizerCanvasGLES3::_canvas_item_render_commands(Item *p_item, Item *cur
if (line->width <= 1) {
Vector2 verts[2] = {
- // Offset the line slightly to make sure we always draw the pixel at the from coordinate.
- // Without this, corners of rectangles might be missing a pixel. (See diamond exit rule and #32657)
- Vector2(Math::floor(line->from.x) + 0.5, Math::floor(line->from.y) + 0.5),
- Vector2(Math::floor(line->to.x) + 0.5, Math::floor(line->to.y) + 0.5)
+ Vector2(line->from.x, line->from.y),
+ Vector2(line->to.x, line->to.y)
};
#ifdef GLES_OVER_GL