aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/Graphics/je_shapes.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-11-01 08:40:29 +0800
committerchai <chaifix@163.com>2018-11-01 08:40:29 +0800
commit2a8b975d44661db15a566a57e7d6fbe428082aef (patch)
tree682e156af77d887bd8d6454d6d9624521d4b958a /src/libjin/Graphics/je_shapes.cpp
parentdde69cd088da0ae6f4a386ef952c3d8775bd6298 (diff)
*更新流程
Diffstat (limited to 'src/libjin/Graphics/je_shapes.cpp')
-rw-r--r--src/libjin/Graphics/je_shapes.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libjin/Graphics/je_shapes.cpp b/src/libjin/Graphics/je_shapes.cpp
index 9859072..aaab1d9 100644
--- a/src/libjin/Graphics/je_shapes.cpp
+++ b/src/libjin/Graphics/je_shapes.cpp
@@ -45,8 +45,8 @@ namespace JinEngine
void line(int x1, int y1, int x2, int y2)
{
float verts[] = {
- x1, y1,
- x2, y2
+ x1 + 0.5f, y1 + 0.5f,
+ x2 + 0.5f, y2 + 0.5f
};
Shader* shader = Shader::getCurrentShader();
@@ -85,13 +85,13 @@ namespace JinEngine
void rect(RenderMode mode, int x, int y, int w, int h)
{
- float coords[] = { x, y, x + w, y, x + w, y + h, x, y + h };
+ float coords[] = { x + 0.5f, y + 0.5f, x + w + 0.5f, y + 0.5f, x + w + 0.5f, y + h + 0.5f, x + 0.5f, y + h + 0.5f };
polygon(mode, coords, 4);
}
void triangle(RenderMode mode, int x1, int y1, int x2, int y2, int x3, int y3)
{
- float coords[] = { x1, y1, x2, y2, x3, y3 };
+ float coords[] = { x1 + 0.5f, y1 + 0.5f, x2 + 0.5f, y2 + 0.5f, x3 + 0.5f, y3 + 0.5f };
polygon(mode, coords, 3);
}