Skip to content

Commit

Permalink
fix: Use line color if set (#467)
Browse files Browse the repository at this point in the history
  • Loading branch information
mflerackers authored Oct 19, 2024
1 parent e1e9263 commit cccfeaa
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/gfx/draw/drawLine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,11 @@ export function _drawLinesBevel(opt: DrawLinesOpt) {
for (let i = 0; i < vertices.length; i++) {
attributes.pos[i * 2] = vertices[i].x + offset.x;
attributes.pos[i * 2 + 1] = vertices[i].y + offset.y;
if (opt.color) {
attributes.color[i * 3] = opt.color.r;
attributes.color[i * 3 + 1] = opt.color.g;
attributes.color[i * 3 + 2] = opt.color.g;

This comment has been minimized.

Copy link
@dragoncoder047

dragoncoder047 Oct 20, 2024

Contributor

you did r, g, g, not r, g, b

This comment has been minimized.

Copy link
@mflerackers

mflerackers Oct 20, 2024

Author Member

I probably shouldn't be making PRs before breakfast and coffee

}
}

drawRaw(
Expand Down Expand Up @@ -510,6 +515,11 @@ export function _drawLinesRound(opt: DrawLinesOpt) {
for (let i = 0; i < vertices.length; i++) {
attributes.pos[i * 2] = vertices[i].x + offset.x;
attributes.pos[i * 2 + 1] = vertices[i].y + offset.y;
if (opt.color) {
attributes.color[i * 3] = opt.color.r;
attributes.color[i * 3 + 1] = opt.color.g;
attributes.color[i * 3 + 2] = opt.color.g;
}
}

drawRaw(
Expand Down Expand Up @@ -677,6 +687,11 @@ export function _drawLinesMiter(opt: DrawLinesOpt) {
for (let i = 0; i < vertices.length; i++) {
attributes.pos[i * 2] = vertices[i].x + offset.x;
attributes.pos[i * 2 + 1] = vertices[i].y + offset.y;
if (opt.color) {
attributes.color[i * 3] = opt.color.r;
attributes.color[i * 3 + 1] = opt.color.g;
attributes.color[i * 3 + 2] = opt.color.g;
}
}

drawRaw(
Expand Down

0 comments on commit cccfeaa

Please sign in to comment.