mirror of
https://github.com/italicsjenga/vello.git
synced 2025-01-09 20:31:29 +11:00
Fix linewidth math
Coarse rasterization wasn't entirely taking line width into account. Also fix swizzle in matrix (not yet used). And fix missing End command in ptcl output (hasn't been a problem because buffer was cleared).
This commit is contained in:
parent
b5e96b5b87
commit
55df3e6cc8
|
@ -221,7 +221,7 @@ void main() {
|
|||
}
|
||||
// Set up for per-scanline coverage formula, below.
|
||||
float invslope = abs(dy) < 1e-9 ? 1e9 : dx / dy;
|
||||
c = abs(invslope) * (0.5 * float(TILE_HEIGHT_PX) + line.stroke.y) * SX;
|
||||
c = (line.stroke.x + abs(invslope) * (0.5 * float(TILE_HEIGHT_PX) + line.stroke.y)) * SX;
|
||||
b = invslope; // Note: assumes square tiles, otherwise scale.
|
||||
a = (line.p0.x - xy0.x - (line.p0.y - 0.5 * float(TILE_HEIGHT_PX) - xy0.y) * b) * SX;
|
||||
break;
|
||||
|
@ -392,4 +392,5 @@ void main() {
|
|||
// removed, then the kernel fails with ERROR_DEVICE_LOST.
|
||||
if (rd_ix >= wr_ix || bin_ix == ~0) break;
|
||||
}
|
||||
Cmd_End_write(cmd_ref);
|
||||
}
|
||||
|
|
Binary file not shown.
|
@ -291,8 +291,8 @@ void main() {
|
|||
case Element_StrokeLine:
|
||||
LineSeg line = Element_StrokeLine_read(this_ref);
|
||||
AnnoStrokeLineSeg anno_line;
|
||||
anno_line.p0 = st.mat.xz * line.p0.x + st.mat.yw * line.p0.y + st.translate;
|
||||
anno_line.p1 = st.mat.xz * line.p1.x + st.mat.yw * line.p1.y + st.translate;
|
||||
anno_line.p0 = st.mat.xy * line.p0.x + st.mat.zw * line.p0.y + st.translate;
|
||||
anno_line.p1 = st.mat.xy * line.p1.x + st.mat.zw * line.p1.y + st.translate;
|
||||
if (tag == Element_StrokeLine) {
|
||||
anno_line.stroke = get_linewidth(st);
|
||||
} else {
|
||||
|
|
Binary file not shown.
Loading…
Reference in a new issue