mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 13:43:43 +00:00
Fix for Rendering Short Paths.
This commit is contained in:
parent
72482877e7
commit
37c7e1efa6
2 changed files with 10 additions and 3 deletions
2
AUTHORS
2
AUTHORS
|
@ -37,4 +37,4 @@ Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||||
Łukasz Pomietło <oficjalnyadreslukasza@gmail.com>
|
Łukasz Pomietło <oficjalnyadreslukasza@gmail.com>
|
||||||
Kelly Loh <kelly@lottiefiles.com>
|
Kelly Loh <kelly@lottiefiles.com>
|
||||||
Dragoș Tiselice <dragos@lottiefiles.com>
|
Dragoș Tiselice <dragos@lottiefiles.com>
|
||||||
|
Marcin Baszczewski <marcin@baszczewski.pl>
|
||||||
|
|
|
@ -374,8 +374,12 @@ static void _lineTo(SwStroke& stroke, const SwPoint& to)
|
||||||
{
|
{
|
||||||
auto delta = to - stroke.center;
|
auto delta = to - stroke.center;
|
||||||
|
|
||||||
//a zero-length lineto is a no-op; avoid creating a spurious corner
|
//a zero-length lineto is a no-op
|
||||||
if (delta.zero()) return;
|
if (delta.zero()) {
|
||||||
|
//round and square caps are expected to be drawn as a dot even for zero-length lines
|
||||||
|
if (stroke.firstPt && stroke.cap != StrokeCap::Butt) _firstSubPath(stroke, 0, 0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* The lineLength is used to determine the intersection of strokes outlines.
|
/* The lineLength is used to determine the intersection of strokes outlines.
|
||||||
The scale needs to be reverted since the stroke width has not been scaled.
|
The scale needs to be reverted since the stroke width has not been scaled.
|
||||||
|
@ -454,6 +458,9 @@ static void _cubicTo(SwStroke& stroke, const SwPoint& ctrl1, const SwPoint& ctrl
|
||||||
//ignoreable size
|
//ignoreable size
|
||||||
if (valid < 0 && arc == bezStack) {
|
if (valid < 0 && arc == bezStack) {
|
||||||
stroke.center = to;
|
stroke.center = to;
|
||||||
|
|
||||||
|
//round and square caps are expected to be drawn as a dot even for zero-length lines
|
||||||
|
if (stroke.firstPt && stroke.cap != StrokeCap::Butt) _firstSubPath(stroke, 0, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue