task->flags = flags;
auto asyncTask = [](SwTask* task) {
+
+ //Valid Stroking?
+ uint8_t strokeAlpha = 0;
+ if (task->sdata->strokeWidth() > FLT_EPSILON) {
+ task->sdata->strokeColor(nullptr, nullptr, nullptr, &strokeAlpha);
+ }
+
//Shape
if (task->flags & (RenderUpdateFlag::Path | RenderUpdateFlag::Transform)) {
shapeReset(task->shape);
uint8_t alpha = 0;
task->sdata->fill(nullptr, nullptr, nullptr, &alpha);
- if (alpha > 0 || task->sdata->fill()) {
+ if (alpha > 0 || task->sdata->fill() || strokeAlpha > 0) {
if (!shapeGenRle(task->shape, task->sdata, task->clip, task->transform)) return;
}
}
}
//Stroke
if (task->flags & (RenderUpdateFlag::Stroke | RenderUpdateFlag::Transform)) {
- if (task->sdata->strokeWidth() > FLT_EPSILON) {
+ if (strokeAlpha > 0) {
shapeResetStroke(task->shape, task->sdata);
- uint8_t alpha = 0;
- task->sdata->strokeColor(nullptr, nullptr, nullptr, &alpha);
- if (alpha > 0) {
- if (!shapeGenStrokeRle(task->shape, task->sdata, task->clip)) return;
- }
+ if (!shapeGenStrokeRle(task->shape, task->sdata, task->clip)) return;
} else {
shapeDelStroke(task->shape);
}
bbox.min.y = yMin >> 6;
bbox.max.y = (yMax + 63) >> 6;
- if (xMax - xMin < 1 || yMax - yMin < 1) return false;
+ if (xMax - xMin < 1 && yMax - yMin < 1) return false;
return true;
}
if (!_checkValid(shape.outline, shape.bbox, clip)) goto end;
+ //Case: Stroke Line
+ if (shape.outline->opened) return true;
+
shape.rle = rleRender(shape.outline, shape.bbox, clip);
end:
if (shape.rle) return true;
shape->lineTo(-53, -5.5);
shape->close();
shape->fill(0, 0, 255, 255);
+ shape->stroke(3);
+ shape->stroke(255, 255, 255, 255);
if (canvas->push(move(shape)) != tvg::Result::Success) return;
}
//Terminate ThorVG Engine
tvg::Initializer::term(tvgEngine);
-}
\ No newline at end of file
+}