Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NSVGShape shape;
- NSVGPath path;
- for(shape=nsvgImage.shapes(); shape != null && shape.address() > 0; shape=shape.next()){
- if((shape.flags() & NanoSVG.NSVG_FLAGS_VISIBLE) == 0){
- continue;
- }
- nvgFillColor(vg, colour);
- nvgStrokeColor(vg, colour);
- nvgStrokeWidth(vg, shape.strokeWidth());
- for(path = shape.paths(); path != null && path.address() > 0; path = path.next()) {
- FloatBuffer pts = path.pts();
- nvgBeginPath(vg);
- nvgMoveTo(vg, pts.get(0), pts.get(1));
- for (int i = 0; i < path.npts()-1; i += 3) {
- int offset = i*2;
- if(offset+7 < path.npts()){
- nvgBezierTo(vg, pts.get(offset+2), pts.get(offset+3), pts.get(offset+4), pts.get(offset+5), pts.get(offset+6), pts.get(offset+7));
- nvgStroke(vg);
- }
- if(path.closed() != 0){
- nvgLineTo(vg, pts.get(0), pts.get(1));
- }
- if(shape.fill().type() != 0){
- nvgFill(vg);
- }
- if(shape.stroke().type() != 0){
- nvgStroke(vg);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement