fix: enable default stroke

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>
This commit is contained in:
Vinayak Kulkarni 2023-01-08 20:06:51 +05:30
parent d47615075f
commit 47e585395d
No known key found for this signature in database
GPG key ID: B8C8194CED989C08

View file

@ -469,7 +469,7 @@ const drawPath = (ctx, path, query, z) => {
const pathHasFill = splitPaths.filter((x) => x.startsWith('fill')).length > 0; const pathHasFill = splitPaths.filter((x) => x.startsWith('fill')).length > 0;
if (query.fill !== undefined || pathHasFill) { if (query.fill !== undefined || pathHasFill) {
if ('fill' in query) { if ('fill' in query) {
ctx.fillStyle = query.fill; ctx.fillStyle = query.fill || 'rgba(255,255,255,0.4)';
} }
if (pathHasFill) { if (pathHasFill) {
ctx.fillStyle = splitPaths ctx.fillStyle = splitPaths
@ -525,7 +525,7 @@ const drawPath = (ctx, path, query, z) => {
splitPaths.filter((x) => x.startsWith('stroke')).length > 0; splitPaths.filter((x) => x.startsWith('stroke')).length > 0;
if (query.stroke !== undefined || pathHasStroke) { if (query.stroke !== undefined || pathHasStroke) {
if ('stroke' in query) { if ('stroke' in query) {
ctx.strokeStyle = query.stroke || 'rgba(0,64,255,0.7)'; ctx.strokeStyle = query.stroke;
} }
// Path Width gets higher priority // Path Width gets higher priority
if (pathHasWidth) { if (pathHasWidth) {
@ -533,8 +533,10 @@ const drawPath = (ctx, path, query, z) => {
.find((x) => x.startsWith('stroke:')) .find((x) => x.startsWith('stroke:'))
.replace('stroke:', ''); .replace('stroke:', '');
} }
ctx.stroke(); } else {
ctx.strokeStyle = 'rgba(0,64,255,0.7)';
} }
ctx.stroke();
}; };
const renderOverlay = async ( const renderOverlay = async (