Skip to main content

Function: proportionalSize()

proportionalSize(width, aspect): object

Defined in: src/lib/classes/BrushSettings/index.ts:58

A brush size with the given width and proportions (width ÷ height), in whole pixels. The width is kept within the range where the smaller side is at least MIN_BRUSH_SIZE and the larger side at most MAX_BRUSH_SIZE, so the proportions are kept at either end.

Parameters​

width​

number

aspect​

number

Returns​

object

height​

height: number

width​

width: number

Example​

proportionalSize(0, 3); // { width: 3, height: 1 }
proportionalSize(1000, 0.5); // { width: 128, height: 256 }