From 1824d7249b9ebdf2abc387877049988a61a38605 Mon Sep 17 00:00:00 2001 From: Atul Varma Date: Sun, 28 Feb 2021 20:11:50 -0500 Subject: [PATCH] Add stroke/fill swap button. --- lib/symbol-context-widget.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/symbol-context-widget.tsx b/lib/symbol-context-widget.tsx index ad2a57d..4e6ab29 100644 --- a/lib/symbol-context-widget.tsx +++ b/lib/symbol-context-widget.tsx @@ -10,6 +10,12 @@ export const SymbolContextWidget: React.FC<{ const updateCtx = (updates: Partial) => { onChange({ ...ctx, ...updates }); }; + const swapColors = () => { + updateCtx({ + fill: ctx.stroke, + stroke: ctx.fill, + }); + }; return (

@@ -28,6 +34,7 @@ export const SymbolContextWidget: React.FC<{ onChange={(e) => updateCtx({ fill: e.target.value })} id="fill" />{" "} + {" "}