### Widget text overhaul
#### Current
- Numbers and text overlap
- Combo boxes truncate the value before the label

#### Proposed
**By default, widgets will now truncate their labels before their
values.**
https://github.com/user-attachments/assets/296ea5ab-d2ff-44f2-9139-5d97789e4f12
- Changes the way widget text is rendered, calculated, and truncated
- Truncation now applies in a standard way to the following widgets:
- Text
- Combo
- Number
- Centralises widget draw routines in base class
### Config
```ts
// Truncate **both** widgets and labels evenly
LiteGraph.truncateWidgetTextEvenly = true
// Swap the default from truncating labels before values, to truncating values first (restores legacy behaviour)
// truncateWidgetTextEvenly **must** be `false`.
LiteGraph.truncateWidgetValuesFirst = true
```
### API / interfaces
- Adds rich `Rectangle` concrete impl., with many methods and helpful
accessors (e.g. `right`, `bottom`)
- Actually _improves_ performance due to switch from Float32Array to
Float64Array
- Impact vs plain Float64Array was not detectable outside of a 2M+
instantiation-loop with random data
- Lazy `pos` & `size` `subarray` properties
- Adds `ReadOnlySize`
- Adds higher-level text draw functions to abstract the nitty gritty in
a performant way (binary search)
- Resolves Comfy-Org/ComfyUI_frontend/issues/457
Fixes issue where pinch to zoom would jitter around scale 1 - D&S rounds
the value to exactly 1 when it is "close enough". Good for pointer, poor
UX for precision trackpad.
Adds trackpad gesture support to canvas interaction. Supports:
- Pinch to zoom
- Two-finger panning
Feature is off by default. Also by default, the browser user-agent must
include "Mac" (even if the feature has been enabled).
```ts
// Enable mac trackpad gestures
LiteGraph.macTrackpadGestures = true
// Disable the default Mac user-agent check
LiteGraph.macGesturesRequireMac = false
```
Emits an event when attempting to delete items with nothing selected.
Event is generic and should also be used to report any other
user-initiated actions.
Emitted from LGraphCanvas.canvas
- bubbles
- non-cancellable
```
litegraph:no-items-selected
```
- Disables both buttons when there are less than 2 options
- Enables both buttons when combo list values contains error (identical
first and last items).
- Adds deprecation console warning when widget values are passed as a
function
- Fix buttons always dimmed when using legacy values-as-function
- Resolves#984
Sends the `pointermove` event that triggered `onDragStart` with the
callback.
It is possible for no `pointermove` events to occur, but still be far
from the original `pointerdown` event. In this case, `eMove` will be
`undefined`, and `onDragEnd` will be called immediately after
`onDragStart`.
- `LLink.resolve`: Resolves all IDs on the link to their respective
objects (node IDs, slot indexes)
- `LinkNetwork.getLink`: a more concise pattern to resolve links