Number fields derived their display precision from `step`, so `step: 1` (X/Y/Z, width, height, font size) rendered a stored 100.234 as "100" — and because `onChange` parses the text, touching the field wrote the rounded value back into the project. `formatNumber` now renders every number with three decimals, independent of `step`, which is left to control the scrub and arrow-key increment only. Dragging now snaps to the increment's grid (`snapToStep`), so a scrub at `step: 1` always lands on whole numbers even from a fractional start, while Alt (x0.1) and the 0.1-step fields keep their precision. Typed values and arrow keys are untouched. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
23 lines
1.3 KiB
TypeScript
23 lines
1.3 KiB
TypeScript
export { Widget, Box, type Size } from './Widget';
|
|
export { HStack, VStack, Spacer, Stack, type StackOptions } from './layout/Stack';
|
|
export { Theme, textStyle, type TextStyleToken } from './Theme';
|
|
export { initUI, ui, type UIContext } from './UIContext';
|
|
export { drawControlBox, drawGrid, type ControlBoxOptions, type GridOptions } from './draw';
|
|
export { clamp, centreY, formatNumber, NUMBER_DECIMALS, snapToStep, zoomFactor } from './math';
|
|
export { Label } from './widgets/Label';
|
|
export { Button, type ButtonOptions } from './widgets/Button';
|
|
export { Dropdown } from './widgets/Dropdown';
|
|
export { Checkbox } from './widgets/Checkbox';
|
|
export { Panel } from './widgets/Panel';
|
|
export { Splitter } from './widgets/Splitter';
|
|
export { ScrollContainer } from './widgets/ScrollContainer';
|
|
export { ListView, type ListItem, type PickModifiers } from './widgets/ListView';
|
|
export { Popup, type PopupOptions } from './widgets/Popup';
|
|
export { Menu, type MenuItem, type MenuOptions } from './widgets/Menu';
|
|
export { Dialog, type DialogButton } from './widgets/Dialog';
|
|
export { TextField } from './widgets/TextField';
|
|
export { NumberField } from './widgets/NumberField';
|
|
export { ColorField } from './widgets/ColorField';
|
|
export { ColorPicker } from './widgets/ColorPicker';
|
|
export * from './color';
|