diff --git a/src/codecs/imagequant/options.tsx b/src/codecs/imagequant/options.tsx index 82eb82bd..6ae1fda2 100644 --- a/src/codecs/imagequant/options.tsx +++ b/src/codecs/imagequant/options.tsx @@ -2,6 +2,9 @@ import { h, Component } from 'preact'; import { bind } from '../../lib/initial-util'; import { inputFieldValueAsNumber, konami } from '../../lib/util'; import { QuantizeOptions } from './processor-meta'; +import * as style from '../../components/options/style.scss'; +import Expander from '../../components/expander'; +import Select from '../../components/select'; const konamiPromise = konami(); @@ -28,8 +31,10 @@ export default class QuantizerOptions extends Component { const form = (event.currentTarget as HTMLInputElement).closest('form') as HTMLFormElement; const options: QuantizeOptions = { - zx: inputFieldValueAsNumber(form.zx), - maxNumColors: inputFieldValueAsNumber(form.maxNumColors), + zx: form.zx ? inputFieldValueAsNumber(form.zx) : this.props.options.zx, + maxNumColors: form.maxNumColors + ? inputFieldValueAsNumber(form.maxNumColors) + : this.props.options.maxNumColors, dither: inputFieldValueAsNumber(form.dither), }; this.props.onChange(options); @@ -37,29 +42,37 @@ export default class QuantizerOptions extends Component { render({ options }: Props, { extendedSettings }: State) { return ( -
- - -