mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-12-22 13:00:08 +00:00
Improve stroke handling in DrawingTracer by simulating line join.
This commit is contained in:
parent
b9899d8d4a
commit
5fdc4cbb36
@ -141,6 +141,10 @@ void DrawingTracer::stroke(GfxState * state)
|
|||||||
// 1. path steps that are not vertical or horizontal lines may still falsely "cover" many chars,
|
// 1. path steps that are not vertical or horizontal lines may still falsely "cover" many chars,
|
||||||
// can we slice those steps further?
|
// can we slice those steps further?
|
||||||
// 2. if the line width is small, can we just ignore the path?
|
// 2. if the line width is small, can we just ignore the path?
|
||||||
|
// 3. line join feature can't be retained. We use line-cap-square to minimize the problem that
|
||||||
|
// some chars actually covered by a line join are missed. However chars covered by a acute angle
|
||||||
|
// with line-join-miter may be still recognized as not covered.
|
||||||
|
cairo_set_line_cap(cairo, CAIRO_LINE_CAP_SQUARE);
|
||||||
GfxPath * path = state->getPath();
|
GfxPath * path = state->getPath();
|
||||||
for (int i = 0; i < path->getNumSubpaths(); ++i) {
|
for (int i = 0; i < path->getNumSubpaths(); ++i) {
|
||||||
GfxSubpath * subpath = path->getSubpath(i);
|
GfxSubpath * subpath = path->getSubpath(i);
|
||||||
|
Loading…
Reference in New Issue
Block a user