-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
119 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
--threads:on | ||
-d:release | ||
--threads:on |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import nimPDF/nimPDF | ||
import ../lines | ||
|
||
# color is already set in stroke and fill color | ||
proc draw_fineliner*(x: Stroke, to: var PDF, scale: float) = | ||
to.saveState() | ||
|
||
# Values found by guesstimation | ||
to.setLineWidth(scale * 0.4) | ||
to.setLineCap(ROUND_END) | ||
to.setLineJoin(MITER_JOIN) | ||
to.setMiterLimit(1.0) | ||
to.moveTo(x.segments[0].x * SCALE_FACTOR, x.segments[0].y * SCALE_FACTOR) | ||
for i in 1..(x.segments.len - 1): | ||
let next = x.segments[i] | ||
to.lineTo(next.x * SCALE_FACTOR, next.y * SCALE_FACTOR) | ||
to.stroke() | ||
|
||
to.restoreState() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import nimPDF/nimPDF | ||
import ../lines | ||
|
||
# color is already set in stroke and fill color | ||
proc draw_highlighter*(x: Stroke, to: var PDF, scale: float) = | ||
to.saveState() | ||
|
||
# TODO: Doesn't quite match remarkable results | ||
to.setLineWidth(scale * 3.0) | ||
to.setLineCap(SQUARE_END) | ||
to.setLineJoin(BEVEL_JOIN) | ||
to.setAlpha(0.5) | ||
to.setBlendMode(BM_OVERLAY) | ||
to.moveTo(x.segments[0].x * SCALE_FACTOR, x.segments[0].y * SCALE_FACTOR) | ||
for i in 1..(x.segments.len - 1): | ||
let next = x.segments[i] | ||
to.lineTo(next.x * SCALE_FACTOR, next.y * SCALE_FACTOR) | ||
to.stroke() | ||
|
||
to.restoreState() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters