Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ea9d236

Browse files
高军杰高军杰
高军杰
authored and
高军杰
committed
feat: save
1 parent 9f714dc commit ea9d236

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

‎src/views/draw/components/SvgTools.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ const SvgTools = (props: Iprops) => {
8787
const [currentMode, setCurrentMode] = useState<string>(
8888
props?.drauu?.mode || 'stylus'
8989
)
90+
const [currentColor, setCurrentColor] = useState<string>(
91+
props?.drauu?.brush.color || '#000'
92+
)
9093
const [currentDash, setCurrentDash] = useState<string | undefined>(
9194
props?.drauu?.brush?.dasharray
9295
)
@@ -110,6 +113,7 @@ const SvgTools = (props: Iprops) => {
110113
}
111114
function colorChange(color: string) {
112115
drauu!.brush.color = color
116+
setCurrentColor(color)
113117
}
114118
function save() {
115119
drauu!.el!.setAttribute('xmlns', 'http://www.w3.org/2000/svg')
@@ -151,8 +155,8 @@ const SvgTools = (props: Iprops) => {
151155
<Col>
152156
<ColorPicker
153157
size="small"
154-
onChangeComplete={(color) => colorChange(color.toHexString())}
155-
value={drauu?.brush.color ? drauu?.brush.color : '#000'}
158+
onChange={(color) => colorChange(color.toHexString())}
159+
value={currentColor}
156160
presets={[
157161
{
158162
label: '快速选择',

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /