Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Kode/Kore
Browse files Browse the repository at this point in the history
  • Loading branch information
RobDangerous committed Jun 27, 2018
2 parents 8041ec7 + 159798b commit b2c8a7b
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions Sources/Kore/Graphics2/Graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -953,20 +953,22 @@ void Graphics2::Graphics2::drawRect(float x, float y, float width, float height,
vec2 p4 = transformation * vec3(x + width + strength / 2, y + strength / 2, 1.0f); // bottom-right
coloredPainter->fillRect(opacity, color, p1.x(), p1.y(), p2.x(), p2.y(), p3.x(), p3.y(), p4.x(), p4.y()); // top

p1 = transformation * vec3(x - strength / 2, y + height + strength / 2, 1.0f);
p3 = transformation * vec3(x + strength / 2, y - strength / 2, 1.0f);
p4 = transformation * vec3(x + strength / 2, y + height + strength / 2, 1.0f);
p1 = transformation * vec3(x - strength / 2, y + height - strength / 2, 1.0f);
p2 = transformation * vec3(x - strength / 2, y + strength / 2, 1.0f);
p3 = transformation * vec3(x + strength / 2, y + strength / 2, 1.0f);
p4 = transformation * vec3(x + strength / 2, y + height - strength / 2, 1.0f);
coloredPainter->fillRect(opacity, color, p1.x(), p1.y(), p2.x(), p2.y(), p3.x(), p3.y(), p4.x(), p4.y()); // left

p1 = transformation * vec3(x - strength / 2, y + height + strength / 2, 1.0f);
p2 = transformation * vec3(x - strength / 2, y + height - strength / 2, 1.0f);
p3 = transformation * vec3(x + width + strength / 2, y + height - strength / 2, 1.0f);
p4 = transformation * vec3(x + width + strength / 2, y + height + strength / 2, 1.0f);
coloredPainter->fillRect(opacity, color, p1.x(), p1.y(), p2.x(), p2.y(), p3.x(), p3.y(), p4.x(), p4.y()); // bottom

p1 = transformation * vec3(x + width - strength / 2, y + height + strength / 2, 1.0f);
p2 = transformation * vec3(x + width - strength / 2, y - strength / 2, 1.0f);
p3 = transformation * vec3(x + width + strength / 2, y - strength / 2, 1.0f);
p4 = transformation * vec3(x + width + strength / 2, y + height + strength / 2, 1.0f);
p1 = transformation * vec3(x + width - strength / 2, y + height - strength / 2, 1.0f);
p2 = transformation * vec3(x + width - strength / 2, y + strength / 2, 1.0f);
p3 = transformation * vec3(x + width + strength / 2, y + strength / 2, 1.0f);
p4 = transformation * vec3(x + width + strength / 2, y + height - strength / 2, 1.0f);
coloredPainter->fillRect(opacity, color, p1.x(), p1.y(), p2.x(), p2.y(), p3.x(), p3.y(), p4.x(), p4.y()); // right
}

Expand Down

0 comments on commit b2c8a7b

Please sign in to comment.