Comments (2)
I think this is the expected behavior.
The fill itself draws correctly. After adding a stroke the 'problem' appears because we don't close it. If you add shape3->close(), the beginning and the end of the stroke will be joined together and you will get a smooth vertex.
Below I have drawn 4 separate cubics - as you can see the fill connects smoothly, while the strokes with the default cap do not connect.
If you change the stroke cap to Butt (shape->stroke(tvg::StrokeCap::Butt)) you will get a stroke that looks like one whole.
The code:
shape3a->moveTo(cx, cy - radius);
shape3a->cubicTo(cx + halfRadius, cy - radius, cx + radius, cy - halfRadius, cx + radius, cy);
shape3b->moveTo(cx + radius, cy);
shape3b->cubicTo(cx + radius, cy + halfRadius, cx + halfRadius, cy + radius, cx, cy+ radius);
shape3c->moveTo(cx, cy + radius);
shape3c->cubicTo(cx - halfRadius, cy + radius, cx - radius, cy + halfRadius, cx - radius, cy);
shape3d->moveTo(cx - radius, cy);
shape3d->cubicTo(cx - radius, cy - halfRadius, cx - halfRadius, cy - radius, cx, cy - radius);
shape3a->fill(255, 0, 0, 255);
shape3b->fill(0, 255, 0, 255);
shape3c->fill(0, 0, 255, 255);
shape3d->fill(255, 0, 255, 255);
shape3a->stroke(255, 0, 0, 255);
shape3b->stroke(0, 255, 0, 255);
shape3c->stroke(0, 0, 255, 255);
shape3d->stroke(255, 0, 255, 255);
shape3a->stroke(100);
shape3b->stroke(100);
shape3c->stroke(100);
shape3d->stroke(100);
shape3a->stroke(tvg::StrokeCap::Butt);
shape3b->stroke(tvg::StrokeCap::Butt);
shape3c->stroke(tvg::StrokeCap::Butt);
shape3d->stroke(tvg::StrokeCap::Butt);
scene->push(move(shape3a));
scene->push(move(shape3b));
scene->push(move(shape3c));
scene->push(move(shape3d));
from thorvg.
@mgrudzinska
Thank you for your kind explanation. I have checked there are no problems. I will close this issue. :)
from thorvg.
Related Issues (20)
- Enhance Lottie feature
- Scene clipping - doesn't work properly
- Windows build error due to strip option HOT 6
- vcpkg-tool-meson tool is too old. HOT 1
- Improve Code quality HOT 2
- fix broken svg loader HOT 4
- support stroke dash offset function HOT 5
- simple svg renders incorrectly HOT 2
- Introduce TVG Window port HOT 5
- Masking chaining bug
- Support dash offset in TVG binary
- cross compile on mcu HOT 1
- thread safety issue HOT 6
- Thread issues (Godot) HOT 1
- Support Merging-Path property in Lottie
- Support Expression in Lottie
- Lottie stacking order issue
- Lottie Trimpath+Dash+Offset doesn work.
- Incorrect blending issue at InvLumaMasking
- Version 0.10.x fails to build with `NOMINMAX` on VS 2017 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from thorvg.