Trim needless comments and fix the picker width
Remove comments that only restate the code, keeping the section banners and the notes that carry a reason, a measured fact or an external contract. ButtonOptions.width claimed to be a fixed width but only set minWidth, so the Graph and Texture pickers grew with the name they showed. It is now what it promises, with a separate minWidth for the buttons that have two forms. Narrow buttons shrink their padding, otherwise a 24px icon button had 8px left for its glyph and truncate dropped it entirely. __gm.labelsDropped() guards that class: the overflow guard only saw text that was too wide, never a label truncated to nothing. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f16801aef3
commit
4d84231b9f
115 files changed
+707
-1564
No files matched your search
+5
-7
@@ -4,15 +4,14 @@ import { Theme } from './Theme';
|
||||
export interface ControlBoxOptions {
|
||||
fill: number;
|
||||
border: number;
|
||||
/** Corner radius; defaults to `Theme.radius`. */
|
||||
radius?: number;
|
||||
x?: number;
|
||||
y?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The shared look of every control: a rounded fill with a 1 px border. The stroke is inset by
|
||||
* half a pixel so it lands on whole device pixels and stays crisp instead of blurring over two.
|
||||
* The shared look of every control. The stroke is inset by half a pixel so it lands on whole
|
||||
* device pixels and stays crisp instead of blurring over two.
|
||||
*/
|
||||
export function drawControlBox(g: Graphics, w: number, h: number, options: ControlBoxOptions): void {
|
||||
const { fill, border, radius = Theme.radius, x = 0, y = 0 } = options;
|
||||
@@ -29,14 +28,13 @@ export interface GridOptions {
|
||||
w: number;
|
||||
h: number;
|
||||
alpha: number;
|
||||
/** Alpha of the two lines through the origin; omitted = no axes (the graph has no origin to show). */
|
||||
/** Alpha of the two lines through the origin; omitted = no axes. */
|
||||
axisAlpha?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The background grid of the scene view and the graph editor. Drawn in white at a low alpha
|
||||
* rather than in a fixed colour, so it reads on whatever background the scene sets.
|
||||
* `g` is cleared by the caller, which also decides when the step is too dense to be useful.
|
||||
* White at a low alpha rather than a fixed colour, so the grid reads on whatever background the
|
||||
* scene sets. `g` is cleared by the caller.
|
||||
*/
|
||||
export function drawGrid(g: Graphics, options: GridOptions): void {
|
||||
const { originX, originY, step, w, h, alpha, axisAlpha } = options;
|
||||
|
||||
Reference in new issue
Block a user