From b1692a7435ae9698eff618bef0e370fe3eb89572 Mon Sep 17 00:00:00 2001 From: bobzel Date: Thu, 29 Aug 2024 13:59:00 -0400 Subject: from last cleanup --- src/client/views/smartdraw/SmartDrawHandler.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/client/views/smartdraw') diff --git a/src/client/views/smartdraw/SmartDrawHandler.tsx b/src/client/views/smartdraw/SmartDrawHandler.tsx index 4679941fb..aa10dcead 100644 --- a/src/client/views/smartdraw/SmartDrawHandler.tsx +++ b/src/client/views/smartdraw/SmartDrawHandler.tsx @@ -9,7 +9,7 @@ import ReactLoading from 'react-loading'; import { AiOutlineSend } from 'react-icons/ai'; import { gptAPICall, GPTCallType, gptDrawingColor } from '../../apis/gpt/GPT'; import { InkData, InkField, InkTool } from '../../../fields/InkField'; -import { SVGToBezier } from '../../util/bezierFit'; +import { SVGToBezier, SVGType } from '../../util/bezierFit'; import { INode, parse } from 'svgson'; import { Slider, Switch } from '@mui/material'; import { Doc, DocListCast } from '../../../fields/Doc'; @@ -279,14 +279,14 @@ export class SmartDrawHandler extends ObservableReactComponent<{}> { const svgStrokes: INode[] = svgObject.children; const strokeData: [InkData, string, string][] = []; // eslint-disable-next-line @typescript-eslint/no-explicit-any - svgStrokes.forEach((child) => { - const convertedBezier: InkData = SVGToBezier(child.name, child.attributes); + svgStrokes.forEach(child => { + const convertedBezier: InkData = SVGToBezier(child.name as SVGType, child.attributes); strokeData.push([ convertedBezier.map(point => { return { X: point.X + startPoint.X - this._size / 1.5, Y: point.Y + startPoint.Y - this._size / 2 }; }), - (regenerate ? this._lastInput.autoColor : autoColor) ? child.attributes.stroke : undefined, - (regenerate ? this._lastInput.autoColor : autoColor) ? child.attributes.fill : undefined, + (regenerate ? this._lastInput.autoColor : autoColor) ? child.attributes.stroke : '', + (regenerate ? this._lastInput.autoColor : autoColor) ? child.attributes.fill : '', ]); }); return { data: strokeData, lastInput: this._lastInput, lastRes: svg[0] }; -- cgit v1.2.3-70-g09d2