Merged PR 208: Fix scaling and position of symbols
This commit is contained in:
parent
32684a725b
commit
ec7ee7891e
6 changed files with 38 additions and 10 deletions
|
@ -2,6 +2,8 @@ import * as React from 'react';
|
|||
import { ISymbolModel } from '../../Interfaces/ISymbolModel';
|
||||
import { RestoreX, TransformX } from '../../utils/svg';
|
||||
import { InputGroup } from '../InputGroup/InputGroup';
|
||||
import { TextInputGroup } from '../InputGroup/TextInputGroup';
|
||||
import { PositionReferenceSelector } from '../RadioGroupButtons/PositionReferenceSelector';
|
||||
|
||||
interface ISymbolFormProps {
|
||||
symbol: ISymbolModel
|
||||
|
@ -20,15 +22,17 @@ export function SymbolForm(props: ISymbolFormProps): JSX.Element {
|
|||
type='string'
|
||||
value={props.symbol.id.toString()}
|
||||
isDisabled={true} />
|
||||
<InputGroup
|
||||
<TextInputGroup
|
||||
id='x'
|
||||
labelText='x'
|
||||
inputKey='x'
|
||||
labelClassName=''
|
||||
inputClassName=''
|
||||
type='number'
|
||||
value={TransformX(props.symbol.x, props.symbol.width, props.symbol.config.XPositionReference).toString()}
|
||||
onChange={(event) => props.onChange('x', RestoreX(Number(event.target.value), props.symbol.width, props.symbol.config.XPositionReference))} />
|
||||
<InputGroup
|
||||
value={TransformX(props.symbol.x, props.symbol.width, props.symbol.config.PositionReference).toString()}
|
||||
onChange={(value) => props.onChange('x', RestoreX(Number(value), props.symbol.width, props.symbol.config.PositionReference))} />
|
||||
<TextInputGroup
|
||||
id='height'
|
||||
labelText='Height'
|
||||
inputKey='height'
|
||||
labelClassName=''
|
||||
|
@ -36,8 +40,9 @@ export function SymbolForm(props: ISymbolFormProps): JSX.Element {
|
|||
type='number'
|
||||
min={0}
|
||||
value={props.symbol.height.toString()}
|
||||
onChange={(event) => props.onChange('height', Number(event.target.value))} />
|
||||
<InputGroup
|
||||
onChange={(value) => props.onChange('height', Number(value))} />
|
||||
<TextInputGroup
|
||||
id='width'
|
||||
labelText='Width'
|
||||
inputKey='width'
|
||||
labelClassName=''
|
||||
|
@ -45,7 +50,7 @@ export function SymbolForm(props: ISymbolFormProps): JSX.Element {
|
|||
type='number'
|
||||
min={0}
|
||||
value={props.symbol.width.toString()}
|
||||
onChange={(event) => props.onChange('width', Number(event.target.value))} />
|
||||
onChange={(value) => props.onChange('width', Number(value))} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue