aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/smartdraw/SmartDrawHandler.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-08-29 13:59:00 -0400
committerbobzel <zzzman@gmail.com>2024-08-29 13:59:00 -0400
commitb1692a7435ae9698eff618bef0e370fe3eb89572 (patch)
tree20664940b2774a4b0fffdecaafdd40bfd08c4251 /src/client/views/smartdraw/SmartDrawHandler.tsx
parent0ac79ba6a7ab19b4aafbc11dac9bab4781d4bd40 (diff)
from last cleanup
Diffstat (limited to 'src/client/views/smartdraw/SmartDrawHandler.tsx')
-rw-r--r--src/client/views/smartdraw/SmartDrawHandler.tsx10
1 files changed, 5 insertions, 5 deletions
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] };